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.
pull/9078/head
Xavier Claessens 4 years ago committed by Xavier Claessens
parent 566383c727
commit 5462ea921f
  1. 7
      mesonbuild/interpreter/interpreter.py
  2. 3
      test cases/unit/72 summary/subprojects/sub2/meson.build
  3. 3
      test cases/unit/72 summary/subprojects/sub2/subprojects/subsub/meson.build
  4. 5
      unittests/allplatformstests.py

@ -825,6 +825,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
@ -854,7 +855,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):
@ -1177,8 +1177,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()

@ -1,5 +1,6 @@
project('sub2')
error('This subproject failed')
subproject('subsub')
summary('Section', 'Should not be seen')
error('This subproject failed')

@ -0,0 +1,3 @@
project('subsub')
summary('Something', 'Some value')

@ -3091,6 +3091,10 @@ class AllPlatformTests(BasePlatformTests):
integer: 1
boolean: True
subsub undefined
Something: Some value
My Project 1.0
Configuration
@ -3120,6 +3124,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])

Loading…
Cancel
Save