qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [PATCH v2 24/24] configure: automatically parse command line for mes


From: Thomas Huth
Subject: Re: [PATCH v2 24/24] configure: automatically parse command line for meson -D options
Date: Wed, 13 Oct 2021 13:27:39 +0200
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.14.0

On 13/10/2021 13.11, Paolo Bonzini wrote:
On 13/10/21 09:43, Paolo Bonzini wrote:
On 12/10/21 20:15, Thomas Huth wrote:

Old output with --help:

  --enable-trace-backend=B Set trace backend
                            Available backends: nop, dtrace, ftrace, simple, stderr, ust

New output:

   --enable-trace-backends=CHOICE
                            Set available tracing backends [log]

Why does it fail to list the choices here? ... it works for the other
options like "--enable-malloc"?

Oh, that's a pity: array options don't include the choices in their introspection data.  I'll fix it up ad hoc and submit a patch to Meson.

---------------- 8< ----------------
From: Paolo Bonzini <pbonzini@redhat.com>
Subject: [PATCH] meson-buildoptions: restore list of tracing backends

Manually patch the introspection data to include the tracing backends.

This works around a deficiency in Meson that will be fixed by
https://github.com/mesonbuild/meson/pull/9395.

Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
---
  scripts/meson-buildoptions.py | 18 +++++++++++++++++-
  scripts/meson-buildoptions.sh |  3 ++-
  2 files changed, 19 insertions(+), 2 deletions(-)

diff --git a/scripts/meson-buildoptions.py b/scripts/meson-buildoptions.py
index 54b591d8a4..256523c09d 100755
--- a/scripts/meson-buildoptions.py
+++ b/scripts/meson-buildoptions.py
@@ -66,7 +66,7 @@ def sh_print(line=""):


  def help_line(left, opt, indent, long):
-    right = f"{opt['description']}"
+    right = f'{opt["description"]}'
      if long:
          value = value_to_help(opt["value"])
          if value != "auto":
@@ -150,7 +150,23 @@ def print_parse(options):
      print("}")


+def fixup_options(options):
+    # Meson <= 0.60 does not include the choices in array options, fix that up
+    for opt in options:
+        if opt["name"] == "trace_backends":
+            opt["choices"] = [
+                "dtrace",
+                "ftrace",
+                "log",
+                "nop",
+                "simple",
+                "syslog",
+                "ust",
+            ]

Do we need a check for a fixed meson version here?

 Thomas




reply via email to

[Prev in Thread] Current Thread [Next in Thread]