aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorXavier Claessens <xavier.claessens@collabora.com>2021-08-09 11:47:34 -0400
committerNirbheek Chauhan <nirbheek@centricular.com>2021-08-10 16:06:45 +0530
commit9009c0912ff8773353195dd463f8b20fff355dfa (patch)
tree931e966fae1fc8173738a774869c74c1b5035afb
parent1eded7025b74e392275008415d5c26c88dc4545e (diff)
downloadmeson-9009c0912ff8773353195dd463f8b20fff355dfa.zip
meson-9009c0912ff8773353195dd463f8b20fff355dfa.tar.gz
meson-9009c0912ff8773353195dd463f8b20fff355dfa.tar.bz2
interpreter: Fix missing subsubproject summary when subproject fails
In the case main->subp->subsubp, if subsubp succeed to configure but subp subsequentially fails, subsubp is still being built but its summary was missing.
-rw-r--r--mesonbuild/interpreter/interpreter.py7
-rwxr-xr-xrun_unittests.py5
-rw-r--r--test cases/unit/72 summary/subprojects/sub2/meson.build3
-rw-r--r--test cases/unit/72 summary/subprojects/sub2/subprojects/subsub/meson.build3
4 files changed, 14 insertions, 4 deletions
diff --git a/mesonbuild/interpreter/interpreter.py b/mesonbuild/interpreter/interpreter.py
index a5b2597..8374562 100644
--- a/mesonbuild/interpreter/interpreter.py
+++ b/mesonbuild/interpreter/interpreter.py
@@ -923,6 +923,7 @@ external dependencies (including libraries) must go to "dependencies".''')
subi.modules = self.modules
subi.holder_map = self.holder_map
subi.bound_holder_map = self.bound_holder_map
+ subi.summary = self.summary
subi.subproject_stack = self.subproject_stack + [subp_name]
current_active = self.active_projectname
@@ -952,7 +953,6 @@ external dependencies (including libraries) must go to "dependencies".''')
self.build.merge(subi.build)
self.build.subprojects[subp_name] = subi.project_version
self.coredata.initialized_subprojects.add(subp_name)
- self.summary.update(subi.summary)
return self.subprojects[subp_name]
def _do_subproject_cmake(self, subp_name, subdir, subdir_abs, default_options, kwargs):
@@ -1280,8 +1280,9 @@ external dependencies (including libraries) must go to "dependencies".''')
# Print all summaries, main project last.
mlog.log('') # newline
main_summary = self.summary.pop('', None)
- for _, summary in sorted(self.summary.items()):
- summary.dump()
+ for subp_name, summary in sorted(self.summary.items()):
+ if self.subprojects[subp_name].found():
+ summary.dump()
if main_summary:
main_summary.dump()
diff --git a/run_unittests.py b/run_unittests.py
index 9f853d8..97ca598 100755
--- a/run_unittests.py
+++ b/run_unittests.py
@@ -5310,6 +5310,10 @@ class AllPlatformTests(BasePlatformTests):
integer: 1
boolean: True
+ subsub undefined
+
+ Something: Some value
+
My Project 1.0
Configuration
@@ -5339,6 +5343,7 @@ class AllPlatformTests(BasePlatformTests):
Subprojects
sub : YES
sub2 : NO Problem encountered: This subproject failed
+ subsub : YES
''')
expected_lines = expected.split('\n')[1:]
out_start = out.find(expected_lines[0])
diff --git a/test cases/unit/72 summary/subprojects/sub2/meson.build b/test cases/unit/72 summary/subprojects/sub2/meson.build
index 86b9cfd..2560bd0 100644
--- a/test cases/unit/72 summary/subprojects/sub2/meson.build
+++ b/test cases/unit/72 summary/subprojects/sub2/meson.build
@@ -1,5 +1,6 @@
project('sub2')
-error('This subproject failed')
+subproject('subsub')
summary('Section', 'Should not be seen')
+error('This subproject failed')
diff --git a/test cases/unit/72 summary/subprojects/sub2/subprojects/subsub/meson.build b/test cases/unit/72 summary/subprojects/sub2/subprojects/subsub/meson.build
new file mode 100644
index 0000000..98a5a26
--- /dev/null
+++ b/test cases/unit/72 summary/subprojects/sub2/subprojects/subsub/meson.build
@@ -0,0 +1,3 @@
+project('subsub')
+
+summary('Something', 'Some value')