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/9285/head
Xavier Claessens 4 years ago committed by Nirbheek Chauhan
parent 1eded7025b
commit 9009c0912f
  1. 7
      mesonbuild/interpreter/interpreter.py
  2. 5
      run_unittests.py
  3. 3
      test cases/unit/72 summary/subprojects/sub2/meson.build
  4. 3
      test cases/unit/72 summary/subprojects/sub2/subprojects/subsub/meson.build

@ -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()

@ -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])

@ -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')
Loading…
Cancel
Save