diff options
author | Dylan Baker <dylan@pnwbakers.com> | 2019-04-21 13:10:02 -0700 |
---|---|---|
committer | Jussi Pakkanen <jpakkane@gmail.com> | 2019-04-21 23:10:02 +0300 |
commit | 3edc7f343b938b9040c53004407f47f58fc15fcb (patch) | |
tree | baa304e972aba33fb7135b223bc9c5e31a2cf911 /run_unittests.py | |
parent | bffd28d4b22b685b2fcf5a5b5983e3f9c69102e7 (diff) | |
download | meson-3edc7f343b938b9040c53004407f47f58fc15fcb.zip meson-3edc7f343b938b9040c53004407f47f58fc15fcb.tar.gz meson-3edc7f343b938b9040c53004407f47f58fc15fcb.tar.bz2 |
coredata: store cross/native files in the same form they will be used (#5224)
* coredata: store cross/native files in the same form they will be used
Currently they're forced to absolute paths when they're stored in the
coredata datastructure, then when they're loaded we de-absolute path
them to check if they're in the system wide directories. This doesn't
work at all, since the ninja backend will generat a dependency on a
file that is in the source directory unless the path was already given
as absolute. This results in builds being retriggereed forever due to
a non-existant file.
The right way to do this is to figure out whether the file is in the
build directory, is absolute, or is in one of the system paths at
creation time, and store that path as absolute. Then the code that
reads the file and the code that generates the dependencies in the
ninja backend just takes the computed list and there is no mismatch
between them.
Fixes #5257
* run_unittests: Add a test for correct native file storage
This tests the bug in #5257
Diffstat (limited to 'run_unittests.py')
-rwxr-xr-x | run_unittests.py | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/run_unittests.py b/run_unittests.py index faef00f..4d70d86 100755 --- a/run_unittests.py +++ b/run_unittests.py @@ -5911,6 +5911,21 @@ class NativeFileTests(BasePlatformTests): extra_args=['--native-file', os.path.join(testcase, 'nativefile'), '-Ddef_libdir=liblib', '-Dlibdir=liblib']) + def test_compile_sys_path(self): + """Compiling with a native file stored in a system path works. + + There was a bug which caused the paths to be stored incorrectly and + would result in ninja invoking meson in an infinite loop. This tests + for that by actually invoking ninja. + """ + testcase = os.path.join(self.common_test_dir, '1 trivial') + + # It really doesn't matter what's in the native file, just that it exists + config = self.helper_create_native_file({'binaries': {'bash': 'false'}}) + + self.init(testcase, extra_args=['--native-file', config]) + self.build() + class CrossFileTests(BasePlatformTests): |