[RFC PATCH] meson-buildoptions: Remove duplicated entry of --gdb in the help text

Alex Bennée posted 1 patch 4 days, 9 hours ago
Patches applied successfully (tree, apply log)
git fetch https://github.com/patchew-project/qemu tags/patchew/20260202174123.1943748-1-alex.bennee@linaro.org
Maintainers: John Snow <jsnow@redhat.com>, Cleber Rosa <crosa@redhat.com>, Paolo Bonzini <pbonzini@redhat.com>, "Alex Bennée" <alex.bennee@linaro.org>, Thomas Huth <thuth@redhat.com>
scripts/meson-buildoptions.py | 9 ++++++++-
scripts/meson-buildoptions.sh | 1 -
2 files changed, 8 insertions(+), 2 deletions(-)
[RFC PATCH] meson-buildoptions: Remove duplicated entry of --gdb in the help text
Posted by Alex Bennée 4 days, 9 hours ago
Since --gdb has recently been added to meson_options.txt, the help
text shows up twice in the output of "./configure --help":

 $ ./configure --help | grep gdb
   --gdb=GDB-path           gdb to use for gdbstub tests [/usr/bin/gdb]
   --gdb=VALUE              Path to GDB

As the probed value is of interest we want to keep the configure text
so make meson-buildoptions able to handle deferring to configure.

Fixes: b46b3818cf8 ("tests/functional: Provide GDB to the functional tests")
Signed-off-by: Alex Bennée <alex.bennee@linaro.org>

---
AJB:
  - This is an alternative take on Thomas's approach in 20260114155355.82096-1-thuth@redhat.com
---
 scripts/meson-buildoptions.py | 9 ++++++++-
 scripts/meson-buildoptions.sh | 1 -
 2 files changed, 8 insertions(+), 2 deletions(-)

diff --git a/scripts/meson-buildoptions.py b/scripts/meson-buildoptions.py
index e636d258e8a..9e3a75c8b11 100644
--- a/scripts/meson-buildoptions.py
+++ b/scripts/meson-buildoptions.py
@@ -53,6 +53,11 @@
     "werror",
 }
 
+# Options that configure prints help for, so we can skip
+CONFIGURE_HELP = {
+    "gdb",
+}
+
 # Builtin options that should be definable via configure.  Some of the others
 # we really do not want (e.g. c_args is defined via the native file, not
 # via -D, because it's a mix of CFLAGS and --extra-cflags); for specific
@@ -189,7 +194,9 @@ def print_help(options):
         key = cli_help_key(opt)
         # The first section includes options that have an arguments,
         # and booleans (i.e., only one of enable/disable makes sense)
-        if require_arg(opt):
+        if opt["name"] in CONFIGURE_HELP:
+            pass
+        elif require_arg(opt):
             metavar = cli_metavar(opt)
             left = f"--{key}={metavar}"
             help_line(left, opt, 27, True)
diff --git a/scripts/meson-buildoptions.sh b/scripts/meson-buildoptions.sh
index 3d0d1323446..e8edc5252a3 100644
--- a/scripts/meson-buildoptions.sh
+++ b/scripts/meson-buildoptions.sh
@@ -58,7 +58,6 @@ meson_options_help() {
   printf "%s\n" '  --enable-ubsan           enable undefined behaviour sanitizer'
   printf "%s\n" '  --firmwarepath=VALUES    search PATH for firmware files [share/qemu-'
   printf "%s\n" '                           firmware]'
-  printf "%s\n" '  --gdb=VALUE              Path to GDB'
   printf "%s\n" '  --iasl=VALUE             Path to ACPI disassembler'
   printf "%s\n" '  --includedir=VALUE       Header file directory [include]'
   printf "%s\n" '  --interp-prefix=VALUE    where to find shared libraries etc., use %M for'
-- 
2.47.3


Re: [RFC PATCH] meson-buildoptions: Remove duplicated entry of --gdb in the help text
Posted by Thomas Huth 3 days, 20 hours ago
On 02/02/2026 18.41, Alex Bennée wrote:
> Since --gdb has recently been added to meson_options.txt, the help
> text shows up twice in the output of "./configure --help":
> 
>   $ ./configure --help | grep gdb
>     --gdb=GDB-path           gdb to use for gdbstub tests [/usr/bin/gdb]
>     --gdb=VALUE              Path to GDB
> 
> As the probed value is of interest we want to keep the configure text
> so make meson-buildoptions able to handle deferring to configure.
> 
> Fixes: b46b3818cf8 ("tests/functional: Provide GDB to the functional tests")
> Signed-off-by: Alex Bennée <alex.bennee@linaro.org>
> 
> ---
> AJB:
>    - This is an alternative take on Thomas's approach in 20260114155355.82096-1-thuth@redhat.com
> ---
>   scripts/meson-buildoptions.py | 9 ++++++++-
>   scripts/meson-buildoptions.sh | 1 -
>   2 files changed, 8 insertions(+), 2 deletions(-)

Reviewed-by: Thomas Huth <thuth@redhat.com>
Tested-by: Thomas Huth <thuth@redhat.com>


Re: [RFC PATCH] meson-buildoptions: Remove duplicated entry of --gdb in the help text
Posted by Gustavo Romero 4 days, 8 hours ago
Hi Alex,

On 2/2/26 14:41, Alex Bennée wrote:
> Since --gdb has recently been added to meson_options.txt, the help
> text shows up twice in the output of "./configure --help":
> 
>   $ ./configure --help | grep gdb
>     --gdb=GDB-path           gdb to use for gdbstub tests [/usr/bin/gdb]
>     --gdb=VALUE              Path to GDB
> 
> As the probed value is of interest we want to keep the configure text
> so make meson-buildoptions able to handle deferring to configure.
> 
> Fixes: b46b3818cf8 ("tests/functional: Provide GDB to the functional tests")
> Signed-off-by: Alex Bennée <alex.bennee@linaro.org>

oops :)

Reviewed-by: Gustavo Romero <gustavo.romero@linaro.org>


Cheers,
Gustavo

> ---
> AJB:
>    - This is an alternative take on Thomas's approach in 20260114155355.82096-1-thuth@redhat.com
> ---
>   scripts/meson-buildoptions.py | 9 ++++++++-
>   scripts/meson-buildoptions.sh | 1 -
>   2 files changed, 8 insertions(+), 2 deletions(-)
> 
> diff --git a/scripts/meson-buildoptions.py b/scripts/meson-buildoptions.py
> index e636d258e8a..9e3a75c8b11 100644
> --- a/scripts/meson-buildoptions.py
> +++ b/scripts/meson-buildoptions.py
> @@ -53,6 +53,11 @@
>       "werror",
>   }
>   
> +# Options that configure prints help for, so we can skip
> +CONFIGURE_HELP = {
> +    "gdb",
> +}
> +
>   # Builtin options that should be definable via configure.  Some of the others
>   # we really do not want (e.g. c_args is defined via the native file, not
>   # via -D, because it's a mix of CFLAGS and --extra-cflags); for specific
> @@ -189,7 +194,9 @@ def print_help(options):
>           key = cli_help_key(opt)
>           # The first section includes options that have an arguments,
>           # and booleans (i.e., only one of enable/disable makes sense)
> -        if require_arg(opt):
> +        if opt["name"] in CONFIGURE_HELP:
> +            pass
> +        elif require_arg(opt):
>               metavar = cli_metavar(opt)
>               left = f"--{key}={metavar}"
>               help_line(left, opt, 27, True)
> diff --git a/scripts/meson-buildoptions.sh b/scripts/meson-buildoptions.sh
> index 3d0d1323446..e8edc5252a3 100644
> --- a/scripts/meson-buildoptions.sh
> +++ b/scripts/meson-buildoptions.sh
> @@ -58,7 +58,6 @@ meson_options_help() {
>     printf "%s\n" '  --enable-ubsan           enable undefined behaviour sanitizer'
>     printf "%s\n" '  --firmwarepath=VALUES    search PATH for firmware files [share/qemu-'
>     printf "%s\n" '                           firmware]'
> -  printf "%s\n" '  --gdb=VALUE              Path to GDB'
>     printf "%s\n" '  --iasl=VALUE             Path to ACPI disassembler'
>     printf "%s\n" '  --includedir=VALUE       Header file directory [include]'
>     printf "%s\n" '  --interp-prefix=VALUE    where to find shared libraries etc., use %M for'


Re: [RFC PATCH] meson-buildoptions: Remove duplicated entry of --gdb in the help text
Posted by Paolo Bonzini 4 days, 9 hours ago
On 2/2/26 18:41, Alex Bennée wrote:
> Since --gdb has recently been added to meson_options.txt, the help
> text shows up twice in the output of "./configure --help":
> 
>   $ ./configure --help | grep gdb
>     --gdb=GDB-path           gdb to use for gdbstub tests [/usr/bin/gdb]
>     --gdb=VALUE              Path to GDB
> 
> As the probed value is of interest we want to keep the configure text
> so make meson-buildoptions able to handle deferring to configure.
> 
> Fixes: b46b3818cf8 ("tests/functional: Provide GDB to the functional tests")
> Signed-off-by: Alex Bennée <alex.bennee@linaro.org>
> 
> ---
> AJB:
>    - This is an alternative take on Thomas's approach in 20260114155355.82096-1-thuth@redhat.com
> ---
>   scripts/meson-buildoptions.py | 9 ++++++++-
>   scripts/meson-buildoptions.sh | 1 -
>   2 files changed, 8 insertions(+), 2 deletions(-)
> 
> diff --git a/scripts/meson-buildoptions.py b/scripts/meson-buildoptions.py
> index e636d258e8a..9e3a75c8b11 100644
> --- a/scripts/meson-buildoptions.py
> +++ b/scripts/meson-buildoptions.py
> @@ -53,6 +53,11 @@
>       "werror",
>   }
>   
> +# Options that configure prints help for, so we can skip
> +CONFIGURE_HELP = {
> +    "gdb",
> +}

That's reasonable, yes.

Acked-by: Paolo Bonzini <pbonzini@redhat.com>

Thanks,

Paolo

> +
>   # Builtin options that should be definable via configure.  Some of the others
>   # we really do not want (e.g. c_args is defined via the native file, not
>   # via -D, because it's a mix of CFLAGS and --extra-cflags); for specific
> @@ -189,7 +194,9 @@ def print_help(options):
>           key = cli_help_key(opt)
>           # The first section includes options that have an arguments,
>           # and booleans (i.e., only one of enable/disable makes sense)
> -        if require_arg(opt):
> +        if opt["name"] in CONFIGURE_HELP:
> +            pass
> +        elif require_arg(opt):
>               metavar = cli_metavar(opt)
>               left = f"--{key}={metavar}"
>               help_line(left, opt, 27, True)
> diff --git a/scripts/meson-buildoptions.sh b/scripts/meson-buildoptions.sh
> index 3d0d1323446..e8edc5252a3 100644
> --- a/scripts/meson-buildoptions.sh
> +++ b/scripts/meson-buildoptions.sh
> @@ -58,7 +58,6 @@ meson_options_help() {
>     printf "%s\n" '  --enable-ubsan           enable undefined behaviour sanitizer'
>     printf "%s\n" '  --firmwarepath=VALUES    search PATH for firmware files [share/qemu-'
>     printf "%s\n" '                           firmware]'
> -  printf "%s\n" '  --gdb=VALUE              Path to GDB'
>     printf "%s\n" '  --iasl=VALUE             Path to ACPI disassembler'
>     printf "%s\n" '  --includedir=VALUE       Header file directory [include]'
>     printf "%s\n" '  --interp-prefix=VALUE    where to find shared libraries etc., use %M for'