diff options
author | Vili Väinölä <vilivainola@gmail.com> | 2022-06-01 18:31:33 +0300 |
---|---|---|
committer | Dylan Baker <dylan@pnwbakers.com> | 2022-06-01 12:32:53 -0700 |
commit | 18e2f8b2b3c7b3cb29e7d7ff037b175411f47f25 (patch) | |
tree | 8377bb862185c15f028b29389447e9482a7fd8e2 /unittests | |
parent | eec7b2c359fe1ab2945c67465848294996bd2f9d (diff) | |
download | meson-18e2f8b2b3c7b3cb29e7d7ff037b175411f47f25.zip meson-18e2f8b2b3c7b3cb29e7d7ff037b175411f47f25.tar.gz meson-18e2f8b2b3c7b3cb29e7d7ff037b175411f47f25.tar.bz2 |
Fix sandbox violation when using subproject as a symlink
Fix "Tried to grab file outside current (sub)project" error when subproject exists within
a source tree but it is used through a symlink. Using subprojects as symlinks is very useful
feature when migrating an existing codebase to meson that all sources do not need to be
immediately moved to subprojects folder.
Diffstat (limited to 'unittests')
-rw-r--r-- | unittests/allplatformstests.py | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/unittests/allplatformstests.py b/unittests/allplatformstests.py index 42bc60e..71e919e 100644 --- a/unittests/allplatformstests.py +++ b/unittests/allplatformstests.py @@ -4263,3 +4263,16 @@ class AllPlatformTests(BasePlatformTests): if self.backend is Backend.ninja: self.assertIn('Generating file.txt with a custom command', out) self.assertIn('Generating subdir/file.txt with a custom command', out) + + def test_symlinked_subproject(self): + testdir = os.path.join(self.unit_test_dir, '106 subproject symlink') + subproject_dir = os.path.join(testdir, 'subprojects') + subproject = os.path.join(testdir, 'symlinked_subproject') + symlinked_subproject = os.path.join(testdir, 'subprojects', 'symlinked_subproject') + if not os.path.exists(subproject_dir): + os.mkdir(subproject_dir) + os.symlink(subproject, symlinked_subproject) + self.addCleanup(os.remove, symlinked_subproject) + + self.init(testdir) + self.build() |