diff options
author | Daniel Mensinger <daniel@mensinger-ka.de> | 2021-06-19 23:14:37 +0200 |
---|---|---|
committer | Daniel Mensinger <daniel@mensinger-ka.de> | 2021-06-20 00:26:06 +0200 |
commit | a73791b529a22f71e9d72d0901cd001f3e25e999 (patch) | |
tree | 79a733e4371d839c2e21b187da330fc4bfe01af5 /mesonbuild/interpreter/interpreter.py | |
parent | f1ac7db2e657c77b4319cbcd0bfbdef489dec802 (diff) | |
download | meson-a73791b529a22f71e9d72d0901cd001f3e25e999.zip meson-a73791b529a22f71e9d72d0901cd001f3e25e999.tar.gz meson-a73791b529a22f71e9d72d0901cd001f3e25e999.tar.bz2 |
fix: Fix strange holder_map bug in combination with subprojects
I was unable to reproduce this in a minimal test-case, so there
is currently no new test :(
Diffstat (limited to 'mesonbuild/interpreter/interpreter.py')
-rw-r--r-- | mesonbuild/interpreter/interpreter.py | 15 |
1 files changed, 6 insertions, 9 deletions
diff --git a/mesonbuild/interpreter/interpreter.py b/mesonbuild/interpreter/interpreter.py index 482ba82..7d1ac79 100644 --- a/mesonbuild/interpreter/interpreter.py +++ b/mesonbuild/interpreter/interpreter.py @@ -752,14 +752,7 @@ external dependencies (including libraries) must go to "dependencies".''') def func_subproject(self, nodes, args, kwargs): if len(args) != 1: raise InterpreterException('Subproject takes exactly one argument') - subp_name = args[0] - subp = self.do_subproject(subp_name, 'meson', kwargs) - # Update the holder maps from the subproject. Additional entries to the - # holder maps can be added through imported Meson modules - if isinstance(subp.held_object, Interpreter): - self.holder_map.update(subp.held_object.holder_map) - self.bound_holder_map.update(subp.held_object.bound_holder_map) - return subp + return self.do_subproject(args[0], 'meson', kwargs) def disabled_subproject(self, subp_name, disabled_feature=None, exception=None): sub = SubprojectHolder(NullSubprojectInterpreter(), os.path.join(self.subproject_dir, subp_name), @@ -824,7 +817,7 @@ external dependencies (including libraries) must go to "dependencies".''') elif method == 'cmake': return self._do_subproject_cmake(subp_name, subdir, subdir_abs, default_options, kwargs) else: - raise InterpreterException(f'The method {method} is invalid for the subproject {subp_name}') + raise mesonlib.MesonBugException(f'The method {method} is invalid for the subproject {subp_name}') # Invalid code is always an error except InvalidCode: raise @@ -879,6 +872,10 @@ external dependencies (including libraries) must go to "dependencies".''') self.build.subprojects[subp_name] = subi.project_version self.coredata.initialized_subprojects.add(subp_name) self.summary.update(subi.summary) + # Update the holder maps from the subproject. Additional entries to the + # holder maps can be added through imported Meson modules + self.holder_map.update(subi.holder_map) + self.bound_holder_map.update(subi.bound_holder_map) return self.subprojects[subp_name] def _do_subproject_cmake(self, subp_name, subdir, subdir_abs, default_options, kwargs): |