Commit Graph

35 Commits

Author SHA1 Message Date
Anton Midyukov
7fe7d9cc0f reports.mk: allow read access to the report to everyone
Fixes access for others to targets.log
2023-05-30 22:53:28 +07:00
Anton Midyukov
b627d75552 reports: DEBUG must be enabled, CHECK must be disabled
We cannot get IMAGE_OUTPATH from the build.log, and there is currently
no other mechanism. Creating a CHECK directory was a bad idea. It should
have been created only for CHECK, but it was always created when DEBUG
was not enabled. So it's better to just issue a warning.
2023-05-30 22:27:33 +07:00
Anton Midyukov
b5198e47ba reports.mk: archive report with REPORT=2 2022-12-30 20:04:01 +07:00
Anton Midyukov
ddda90b60b reports.mk: do not abort, if not available rpm cache 2022-01-20 18:15:57 +07:00
Anton Midyukov
27819496d6 reports.mk: fix whitespace 2022-01-20 18:11:26 +07:00
Michael Shigorin
51ae114eba reports.mk: don't call rpmquery with empty list
xargs -r is a good habit usually.

Fixes: c771783654
2021-10-25 17:14:45 +07:00
Anton Midyukov
9d5aca71ab reports.mk: fix build with REPORT=1, CHECK=1 and undefined DEBUG 2021-08-23 20:53:19 +07:00
Anton Midyukov
31d9010c79 reports.mk: add pkg.list
Useful for checking changes.
2021-07-15 16:16:39 +07:00
Anton Midyukov
93032ae778 reports.mk: save distcfg.mk to report directory, when check build (CHECK=1) 2021-07-14 17:54:08 +07:00
Anton Midyukov
4cd075ac1a reports.mk: convert targets.svgz to pdf, if rsvg-convert is available 2021-07-14 13:09:05 +07:00
Anton Midyukov
af9dfa1636 reports.mk: fix launch together with the CHECK option
If the CHECK option is enabled, then now the report directory is
generated successfully and is called "$(IMAGE_NAME).$(IMAGE_TYPE)".
2021-06-18 18:06:29 +07:00
Anton Midyukov
2e6e001c6c reports.mk: move logs to reports directory 2021-06-06 19:55:23 +07:00
Anton Midyukov
f9ef0e95f7 reports.mk: generate targets.svgz instead targets.png
SVGZ is more than a hundred times smaller than PNG.
a
2021-04-29 21:26:51 +07:00
Michael Shigorin
1d8b9f494d reports.mk: provide bashism with bash
Wrote that it's a bashism myself and neglected
to specify the proper shell, sigh.

This SHELL manipulation could ruin tracing
piggybacked onto it within lib/report.mk
but it's too late at this stage anyways.
2021-04-29 12:29:22 +07:00
Michael Shigorin
6f584cdc52 reports.mk: use process substitution to dedup
The first half of both pipes was clearly a copy-pasted
initial logfile processing; the file can be of considerable
size (e.g. several megabytes) so it might be slightly more
efficient and cool (but a bit more arcane) to use bash(1)'s
process substitution along with good ol' tee(1) like this:

$ echo -e '1\n2\n3' |tee /dev/stderr 2> >(grep 2 >STDERR) |grep 1 >STDOUT
$ head STD*
==> STDERR <==
2

==> STDOUT <==
1
2021-04-29 12:29:22 +07:00
Michael Shigorin
4c701def7c reports.mk: streamline basedir(1) equivalent
That "clever hack" with two rev(1) invocations
seems pretty stupid to me: too much processes
and processing instead of simple prefix removal.

One can also have that as ${var##*/} when dealing
with a shell variable and avoiding extra forks, BTW.
2021-04-29 12:29:22 +07:00
Michael Shigorin
4a419e6bbb reports.mk: factor out reports/packages
..making it fit 80 columns while at that
to avoid horizontal spaghetti code.
2021-04-29 12:29:22 +07:00
Anton Midyukov
c771783654 reports.mk: Generate rpm and srpms lists 2021-04-16 15:34:11 +07:00
Anton Midyukov
88d0d01647 reports.mk: Rewrite reports directory
Previously, when rebuilding, the new reports were copied as a
subdirectory.
2021-04-16 15:31:03 +07:00
Anton Midyukov
3e0c6379ce reports.mk: not show reports message on users screen 2020-01-20 22:46:08 +07:00
Michael Shigorin
5e20cec7e2 reports.mk: refactor report output
Make it uniform through a function -- with the initially desired effect
of no extra lines while building multiple images with REPORT=1
(those were useless anyways printing repeatedly the same path
that's relative to a particular builddir).
2020-01-13 12:09:41 +03:00
Michael Shigorin
f8ae619bbb cleanlog, reports.mk: factor the script out
Sometimes REPORT=1 just wasn't passed to make, and the build.log
saved is noisy and harder to compare through diff(1); let's move
the implementation out of the makefile and into a standalone
script so it can be reused like this:

  BUILDDIR=$(sed -rn "s/^mki-image-scripts: export GLOBAL_BUILDDIR='(.*)'$/\1/p" build/build.log
  bin/cleanlog < build/build.log > build/reports/clean.log

See "export GLOBAL_BUILDDIR=" line in the particular log
(grabbing that one from stdin is not exactly trivial though).
2019-06-10 19:47:14 +03:00
Michael Shigorin
9cc9d88143 reports.mk: added "contents" one
"Provide iso contents file" has been a long-standing
feature request regarding both starterkits and distros
proper; release managers used to compensate this with
their own scripts.

Suggested-by: sem@, legion@ and someone else too
2018-06-11 12:31:04 +03:00
Michael Shigorin
796a82193d reports.mk: that space was extra
graphviz is usually around so this buglet has lived
a really long life: "a " "b" instead of "a" "b".
2014-06-04 19:09:11 +04:00
Michael Shigorin
aa8699c4a4 reports.mk: diffable logs
This is a mild generalization of what has been done by hand
to figure out a problem with make-initrd-propagator-0.10-alt1:
stripping anything intrinsically volatile off the build.log.

The filter set isn't perfect, and the proper logging will
involve mkimage tweaks as well (e.g., one generally isn't
interested in instrumental chroots' population that much,
so it should only be verbose at the higher debug levels).
2012-10-27 22:13:58 +03:00
Mikhail Efremov
9bd853e88c Add LIBDIR variable.
Allow to put the log files and reports in a custom directory instead
of IMIGEDIR.
2012-06-21 17:11:02 +04:00
Michael Shigorin
454e7162f3 no build means *no* build (and less reports), really
It's hard to tell a successful build from a failed one
if downstream hides the exit code; it's useless to continue
a `for' loop if a pipe shoves that to a subshell; well it seems
that a bashism is worth a thousand quirks with extra fds here.
Minor regexp enhancements are also due.

reports.mk made a bit more resilient/prudent either.
2012-05-06 19:17:10 +03:00
Michael Shigorin
0439df3159 reports.mk: fixups and hardening
No need for .reports/ in toplevel directory even after build failure,
and a few more hasty hacking fixups are also due, shame on me.
2012-05-06 19:17:10 +03:00
Michael Shigorin
6e6f572b43 better output directory and results structuring
Following m-p-d, a more involved default output directory
structure is feasible now:

  ~/out/name/date/name-date-arch.type

instead of plain

  ~/out/name-date-arch.type

This particular behaviour can be achieved by passing
SORTDIR='$(IMAGE_NAME)/$(DATE)'; note the single quotes.

Reports are also saved in this resulting structure
albeit the place is still highly debatable.
2012-04-23 23:35:43 +03:00
Michael Shigorin
c692da6a06 reports.mk: cosmetic tweaks
REPORT_PATH comes from a makefile;
let's use corresponding notation.
2012-04-23 23:28:40 +03:00
Michael Shigorin
6647e8996a reports.mk: fixed behaviour with no REPORT set
Toplevel Makefile is a bit optimistic regarding
calling reports.mk...
2012-04-23 23:10:29 +03:00
Michael Shigorin
6ada32dc91 reports.mk: added reports/scripts
This one extracts the exact time-ordered list of script hooks
run while building the image.

Some commons refactoring is also due.
2012-04-23 23:10:29 +03:00
Michael Shigorin
931d23e86c reports.mk: handle missing gra{phviz,cefully}
If there's no dot(1) then its input file should just be stored;
thanks glebfm@ for reminding about this.
2012-04-09 22:03:29 +03:00
Michael Shigorin
665c70a444 use PATH instead of hardwired pathlets
bin/ prefix tried to become a permatemp(tm).  No way.
2012-04-07 15:45:40 +03:00
Michael Shigorin
788cad885e initial target tracing support and reporting
The purpose is being able to examine particular target interdependency
graph for a given image having been configured to avoid convoluted
dependencies (loops in particular).

The implementation is based on SHELL hook hint by John Graham-Cumming:
http://cmcrossroads.com/ask-mr-make/6535-tracing-rule-execution-in-gnu-make
2012-03-19 19:23:38 +02:00