diff options
author | Paolo Bonzini <pbonzini@redhat.com> | 2021-03-16 08:58:04 +0100 |
---|---|---|
committer | Xavier Claessens <xclaesse@gmail.com> | 2021-03-16 09:35:48 -0400 |
commit | 5cd7f5f8c5e374348e55b791caf01604c238f3e5 (patch) | |
tree | f2bbfd87618da572271ab2bf782665e2b86bb639 /mesonbuild/interpreter.py | |
parent | 32e49b5ff20bf2868330aa6985a65b3e9323ebd5 (diff) | |
download | meson-5cd7f5f8c5e374348e55b791caf01604c238f3e5.zip meson-5cd7f5f8c5e374348e55b791caf01604c238f3e5.tar.gz meson-5cd7f5f8c5e374348e55b791caf01604c238f3e5.tar.bz2 |
msetup: do not print bogus "Option ... is:" messages
get_non_matching_default_options is checking a string from
project_default_options against a validated value from
coredata.options.
Passing the string to validate_value ensures that the comparison
is sound; otherwise, "false" might be compared against False
and a bogus difference is printed.
Diffstat (limited to 'mesonbuild/interpreter.py')
-rw-r--r-- | mesonbuild/interpreter.py | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/mesonbuild/interpreter.py b/mesonbuild/interpreter.py index 3e39720..d554cce 100644 --- a/mesonbuild/interpreter.py +++ b/mesonbuild/interpreter.py @@ -2447,7 +2447,12 @@ class Interpreter(InterpreterBase): def get_non_matching_default_options(self) -> T.Iterator[T.Tuple[str, str, coredata.UserOption]]: for def_opt_name, def_opt_value in self.project_default_options.items(): cur_opt_value = self.coredata.options.get(def_opt_name) - if cur_opt_value is not None and def_opt_value != cur_opt_value.value: + try: + if cur_opt_value is not None and cur_opt_value.validate_value(def_opt_value) != cur_opt_value.value: + yield (str(def_opt_name), def_opt_value, cur_opt_value) + except mesonlib.MesonException: + # Since the default value does not validate, it cannot be in use + # Report the user-specified value as non-matching yield (str(def_opt_name), def_opt_value, cur_opt_value) def build_func_dict(self): |