Fix reconfiguration on --wipe. Closes #14279.
diff --git a/mesonbuild/options.py b/mesonbuild/options.py index 7c22332..7ed2ec3 100644 --- a/mesonbuild/options.py +++ b/mesonbuild/options.py
@@ -1305,7 +1305,7 @@ # A) a system option in which case the subproject is None # B) a project option, in which case the subproject is '' (this method is only called from top level) # - # The key parsing fucntion can not handle the difference between the two + # The key parsing function can not handle the difference between the two # and defaults to A. assert isinstance(keystr, str) key = OptionKey.from_string(keystr) @@ -1350,8 +1350,7 @@ # # Some base options (sanitizers etc) might get added later. # Permitting them all is not strictly correct. - assert isinstance(keystr, str) - if ':' not in keystr and not self.is_compiler_option(key) and not self.is_base_option(key): + if key.subproject is None and not self.is_compiler_option(key) and not self.is_base_option(key): raise MesonException(f'Unknown options: "{keystr}"') self.pending_project_options[key] = valstr else:
diff --git a/unittests/allplatformstests.py b/unittests/allplatformstests.py index 865b5e3..634a860 100644 --- a/unittests/allplatformstests.py +++ b/unittests/allplatformstests.py
@@ -5143,3 +5143,8 @@ testdir = os.path.join(self.unit_test_dir, '117 empty project') args = ['-Db_ndebug=if_release'] self.init(testdir, extra_args=args) + + def test_wipe_with_args(self): + testdir = os.path.join(self.common_test_dir, '1 trivial') + self.init(testdir, extra_args=['-Dc_args=-DSOMETHING']) + self.init(testdir, extra_args=['--wipe'])