mconf: fix crash printing list-valued option augments

print_augments() formatted the raw value with a string width spec,
which raises TypeError for list values such as c_args. Use the same
stringify() helper as the regular option display.

Fixes #15991.
This commit is contained in:
Maxandre Ogeret authored and Paolo Bonzini committed 2026-07-09 07:18:17 +02:00
1 parent 2b4f5dcd1b
commit 22675c6a65
2 files changed
+9 -1

No files matched your search

+1 -1
View File
@@ -355,7 +355,7 @@ class Conf:
if self.coredata.optstore.augments:
mlog.log('\nCurrently set option augments:')
for k, v in self.coredata.optstore.augments.items():
mlog.log(f'{k!s:21}{v:10}')
mlog.log(f'{k!s:21}{stringify(v):10}')
else:
mlog.log('\nThere are no option augments.')
+8
View File
@@ -4190,6 +4190,14 @@ class AllPlatformTests(BasePlatformTests):
self.init(testdir)
self._run(self.mconf_command + [self.builddir])
def test_configure_with_augments(self):
# A list-valued augment used to crash `meson configure <builddir>`.
testdir = os.path.join(self.unit_test_dir, '47 reconfigure')
self.init(testdir, extra_args=['-Dsub1:c_args=-DFOO'])
out = self._run(self.mconf_command + [self.builddir])
self.assertIn('sub1:c_args', out)
self.assertIn('[-DFOO]', out)
def test_summary(self):
testdir = os.path.join(self.unit_test_dir, '71 summary')
out = self.init(testdir, extra_args=['-Denabled_opt=enabled', f'-Dpython={sys.executable}'])