diff options
Diffstat (limited to 'mesonbuild/interpreter/interpreter.py')
-rw-r--r-- | mesonbuild/interpreter/interpreter.py | 11 |
1 files changed, 5 insertions, 6 deletions
diff --git a/mesonbuild/interpreter/interpreter.py b/mesonbuild/interpreter/interpreter.py index 42e9b70..b527115 100644 --- a/mesonbuild/interpreter/interpreter.py +++ b/mesonbuild/interpreter/interpreter.py @@ -222,7 +222,6 @@ class Interpreter(InterpreterBase, HoldableObject): subproject: str = '', subdir: str = '', subproject_dir: str = 'subprojects', - modules: T.Optional[T.Dict[str, T.Union[ExtensionModule, NewExtensionModule, NotFoundExtensionModule]]] = None, default_project_options: T.Optional[T.Dict[str, str]] = None, mock: bool = False, ast: T.Optional[mparser.CodeBlockNode] = None, @@ -235,10 +234,7 @@ class Interpreter(InterpreterBase, HoldableObject): self.coredata = self.environment.get_coredata() self.backend = backend self.summary = {} - if modules is None: - self.modules = {} - else: - self.modules = modules + self.modules = {} # Subproject directory is usually the name of the subproject, but can # be different for dependencies provided by wrap files. self.subproject_directory_name = subdir.split(os.path.sep)[-1] @@ -821,7 +817,10 @@ external dependencies (including libraries) must go to "dependencies".''') with mlog.nested(subp_name): new_build = self.build.copy() subi = Interpreter(new_build, self.backend, subp_name, subdir, self.subproject_dir, - self.modules, default_options, ast=ast, is_translated=is_translated) + default_options, ast=ast, is_translated=is_translated) + # Those lists are shared by all interpreters. That means that + # even if the subproject fails, any modification that the subproject + # made to those lists will affect the parent project. subi.subprojects = self.subprojects subi.modules = self.modules subi.holder_map = self.holder_map |