diff options
author | Xavier Claessens <xavier.claessens@collabora.com> | 2022-06-14 09:01:04 -0400 |
---|---|---|
committer | Eli Schwartz <eschwartz93@gmail.com> | 2022-06-14 16:01:20 -0400 |
commit | d85a9733e6af45c9e3111f23ecec9e614eaeaeeb (patch) | |
tree | e87cb782752a2ab8af84986f2ef47787d628ff48 /unittests/platformagnostictests.py | |
parent | e559ea0b7c96f2436d82ed9f94fe78d7c2aaef1d (diff) | |
download | meson-d85a9733e6af45c9e3111f23ecec9e614eaeaeeb.zip meson-d85a9733e6af45c9e3111f23ecec9e614eaeaeeb.tar.gz meson-d85a9733e6af45c9e3111f23ecec9e614eaeaeeb.tar.bz2 |
Fix crash when a reconfigure adds a new subproject
When a subproject is disabled on the initial configuration we should not
add it into self.coredata.initialized_subprojects because that will
prevent calling self.coredata.init_builtins() on a reconfigure if the
subproject gets enabled.
Fixes: #10225.
Diffstat (limited to 'unittests/platformagnostictests.py')
-rw-r--r-- | unittests/platformagnostictests.py | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/unittests/platformagnostictests.py b/unittests/platformagnostictests.py index f45e6b4..4b99b2f 100644 --- a/unittests/platformagnostictests.py +++ b/unittests/platformagnostictests.py @@ -83,3 +83,14 @@ class PlatformAgnosticTests(BasePlatformTests): mesonlog = os.path.join(self.builddir, 'meson-logs/meson-log.txt') with open(mesonlog, mode='r', encoding='utf-8') as file: self.assertIn(log_msg, file.read()) + + def test_new_subproject_reconfigure(self): + testdir = os.path.join(self.unit_test_dir, '107 new subproject on reconfigure') + self.init(testdir) + self.build() + + # Enable the subproject "foo" and reconfigure, this is used to fail + # because per-subproject builtin options were not initialized: + # https://github.com/mesonbuild/meson/issues/10225. + self.setconf('-Dfoo=enabled') + self.build('reconfigure') |