summaryrefslogtreecommitdiff
path: root/mesonbuild/mesonmain.py
diff options
context:
space:
mode:
authorPaolo Bonzini <pbonzini@redhat.com>2025-04-17 17:57:58 +0200
committerEli Schwartz <eschwartz93@gmail.com>2025-04-18 15:38:56 -0400
commitb9db06b2b12a50b95185082910cfef01341fd7db (patch)
treef2a4b9629406099db07f5b73a0274ab824d25237 /mesonbuild/mesonmain.py
parent855cf199fc950de3e764a74e7b545c2213aa601c (diff)
downloadmeson-b9db06b2b12a50b95185082910cfef01341fd7db.tar.gz
fix prefix computation in validate_original_args
validate_original_args only checks whether an option is prefixed with the name of a built-in option that was also set. It does not check whether the prefix is the full name of the option specified with -D. Adding an "=" at the end fixes the test. Fixes: #14487 Reported-by: Alyssa Ross <hi@alyssa.is> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Diffstat (limited to 'mesonbuild/mesonmain.py')
-rw-r--r--mesonbuild/mesonmain.py2
1 files changed, 1 insertions, 1 deletions
diff --git a/mesonbuild/mesonmain.py b/mesonbuild/mesonmain.py
index 6a88501d4..dd265c41b 100644
--- a/mesonbuild/mesonmain.py
+++ b/mesonbuild/mesonmain.py
@@ -247,7 +247,7 @@ def validate_original_args(args):
#longs = [x for x in args if x.startswith('--')]
for optionkey in itertools.chain(mesonbuild.options.BUILTIN_DIR_OPTIONS, mesonbuild.options.BUILTIN_CORE_OPTIONS):
longarg = mesonbuild.options.argparse_name_to_arg(optionkey.name)
- shortarg = f'-D{optionkey.name}'
+ shortarg = f'-D{optionkey.name}='
if has_startswith(args, longarg) and has_startswith(args, shortarg):
sys.exit(
f'Got argument {optionkey.name} as both {shortarg} and {longarg}. Pick one.')