aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJussi Pakkanen <jpakkane@gmail.com>2021-08-15 11:45:02 +0300
committerJussi Pakkanen <jpakkane@gmail.com>2021-08-15 11:45:02 +0300
commit021d8caa378b968605ad82457a729c42d44e1c00 (patch)
treef593a47f4b3269341271eca614414ef6b49abb04
parentcce2ba58ce354a51fc97b2025d9f36a825aacd02 (diff)
downloadmeson-021d8caa378b968605ad82457a729c42d44e1c00.zip
meson-021d8caa378b968605ad82457a729c42d44e1c00.tar.gz
meson-021d8caa378b968605ad82457a729c42d44e1c00.tar.bz2
Revert "interpreter: Fix holder_map not being updated when subproject fails"reverts
This reverts commit 566383c727219fc20cf1c90c0fe7dae4bcac5c96.
-rw-r--r--mesonbuild/interpreter/interpreter.py11
-rw-r--r--test cases/python/6 failing subproject/meson.build5
-rw-r--r--test cases/python/6 failing subproject/subprojects/bar/meson.build4
3 files changed, 6 insertions, 14 deletions
diff --git a/mesonbuild/interpreter/interpreter.py b/mesonbuild/interpreter/interpreter.py
index b527115..42e9b70 100644
--- a/mesonbuild/interpreter/interpreter.py
+++ b/mesonbuild/interpreter/interpreter.py
@@ -222,6 +222,7 @@ 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,
@@ -234,7 +235,10 @@ class Interpreter(InterpreterBase, HoldableObject):
self.coredata = self.environment.get_coredata()
self.backend = backend
self.summary = {}
- self.modules = {}
+ if modules is None:
+ self.modules = {}
+ else:
+ self.modules = 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]
@@ -817,10 +821,7 @@ 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,
- 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.
+ self.modules, default_options, ast=ast, is_translated=is_translated)
subi.subprojects = self.subprojects
subi.modules = self.modules
subi.holder_map = self.holder_map
diff --git a/test cases/python/6 failing subproject/meson.build b/test cases/python/6 failing subproject/meson.build
deleted file mode 100644
index cc33a1c..0000000
--- a/test cases/python/6 failing subproject/meson.build
+++ /dev/null
@@ -1,5 +0,0 @@
-project('foo', 'cpp')
-
-# Regression test for https://github.com/mesonbuild/meson/issues/9038
-dependency('bar', required: false, allow_fallback: true)
-python = import('python').find_installation('python3').dependency()
diff --git a/test cases/python/6 failing subproject/subprojects/bar/meson.build b/test cases/python/6 failing subproject/subprojects/bar/meson.build
deleted file mode 100644
index 21431ca..0000000
--- a/test cases/python/6 failing subproject/subprojects/bar/meson.build
+++ /dev/null
@@ -1,4 +0,0 @@
-project('bar', 'cpp')
-
-python = import('python').find_installation('python3')
-dependency('nonexistant-dependency')