On Mon, Feb 19, 2024 at 04:47:52AM -0800, Andrea Bolognani wrote:
On Mon, Feb 19, 2024 at 10:35:14AM +0100, Martin Kletzander wrote:
> We warned users before the meson times, so do like an S Club 7 and bring
> it all back.
>
> Add the information into the 'Miscellaneous' section of the summary,
> because even though using `warning()` looks better, it scrolls on by
> once the summary is printed.
>
> Signed-off-by: Martin Kletzander <mkletzan(a)redhat.com>
> ---
> meson.build | 8 ++++++++
> 1 file changed, 8 insertions(+)
>
> diff --git a/meson.build b/meson.build
> index 2f3d73b93085..6482493d7136 100644
> --- a/meson.build
> +++ b/meson.build
> @@ -818,6 +818,7 @@ optional_programs = [
> 'tc',
> ] + optional_test_programs
>
> +missing_optional_programs = []
> foreach name : optional_programs
> prog = find_program(name, required: false, dirs: libvirt_sbin_path)
> varname = name.underscorify()
> @@ -825,6 +826,9 @@ foreach name : optional_programs
> prog_path = prog.full_path()
> else
> prog_path = name
> + if name in optional_test_programs
> + missing_optional_programs += [ name ]
> + endif
> endif
>
> conf.set_quoted(varname.to_upper(), prog_path)
> @@ -2330,6 +2334,10 @@ misc_summary = {
> 'sysctl config': conf.has('WITH_SYSCTL'),
> 'userfaultfd sysctl': conf.has('WITH_USERFAULTFD_SYSCTL'),
> }
> +if missing_optional_programs.length() > 0
> + misc_summary += {'Some programs are missing, not all tests will be
executed':
> + missing_optional_programs}
> +endif
> summary(misc_summary, section: 'Miscellaneous', bool_yn: true, list_sep:
' ')
>
> devtools_summary = {
> --
> 2.43.1
> _______________________________________________
> Devel mailing list -- devel(a)lists.libvirt.org
> To unsubscribe send an email to devel-leave(a)lists.libvirt.org
I like it, but I'm going to suggest a slightly tweaked
implementation.
With the diff below squashed in, the output will turn into
Optional programs
Missing : black (some tests will be skipped!)
which is less busy and more readable IMO. I think it's more likely to
catch the user's eye compared to being yet another line at the bottom
of the Miscellaneous section.
I liked that the first column got wider, but to be honest it catches
your eye only if you are used to the output.
And I like your version better. If you have it squashed locally, then
feel free to push that.
diff --git a/meson.build b/meson.build
index 6482493d71..7845f60ff7 100644
--- a/meson.build
+++ b/meson.build
@@ -2334,10 +2334,6 @@ misc_summary = {
'sysctl config': conf.has('WITH_SYSCTL'),
'userfaultfd sysctl': conf.has('WITH_USERFAULTFD_SYSCTL'),
}
-if missing_optional_programs.length() > 0
- misc_summary += {'Some programs are missing, not all tests will be executed':
- missing_optional_programs}
-endif
summary(misc_summary, section: 'Miscellaneous', bool_yn: true, list_sep: '
')
devtools_summary = {
@@ -2345,6 +2341,15 @@ devtools_summary = {
}
summary(devtools_summary, section: 'Developer Tools', bool_yn: true)
+if missing_optional_programs.length() > 0
+ missing_list = ' '.join(missing_optional_programs)
+ missing_warn = ' (some tests will be skipped!)'
+ test_programs_summary = {
+ 'Missing': missing_list + missing_warn,
+ }
+ summary(test_programs_summary, section: 'Optional programs', bool_yn: true)
the bool_yn doesn't do anything here, but that's fine
Reviewed-by: Martin Kletzander <mkletzan(a)redhat.com>
+endif
+
if conf.has('WITH_QEMU')
qemu_warn = ''
if qemu_user == 'root'
--
Andrea Bolognani / Red Hat / Virtualization