diff options
author | Nirbheek Chauhan <nirbheek@centricular.com> | 2022-01-28 14:59:33 +0530 |
---|---|---|
committer | Nirbheek Chauhan <nirbheek.chauhan@gmail.com> | 2022-01-30 02:13:42 +0530 |
commit | 2512c25c0bb3649c4cc8be20ac30d59630241ae4 (patch) | |
tree | e3d7ec5c29f28a3fd2860951c15d692e0294c14d /mesonbuild/backend | |
parent | 029652ecb5da390ff3acc71ab98c9d53b2aa1a12 (diff) | |
download | meson-2512c25c0bb3649c4cc8be20ac30d59630241ae4.zip meson-2512c25c0bb3649c4cc8be20ac30d59630241ae4.tar.gz meson-2512c25c0bb3649c4cc8be20ac30d59630241ae4.tar.bz2 |
ninja backend: Fix usage of same constants file for native and cross
For example:
```
meson builddir \
--native-file vs2019-paths.txt \
--native-file vs2019-win-x64.txt \
--cross-file vs2019-paths.txt \
--cross-file vs2019-win-arm64.txt
```
This was causing the error:
> ERROR: Multiple producers for Ninja target "/path/to/vs2019-paths.txt". Please rename your targets.
Fix it by using a set() when generating the list of regen files, and
add a test for it too.
Diffstat (limited to 'mesonbuild/backend')
-rw-r--r-- | mesonbuild/backend/backends.py | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/mesonbuild/backend/backends.py b/mesonbuild/backend/backends.py index e43c8c7..eb4d03f 100644 --- a/mesonbuild/backend/backends.py +++ b/mesonbuild/backend/backends.py @@ -1191,14 +1191,14 @@ class Backend: def get_regen_filelist(self) -> T.List[str]: '''List of all files whose alteration means that the build definition needs to be regenerated.''' - deps = [str(Path(self.build_to_src) / df) - for df in self.interpreter.get_build_def_files()] + deps = OrderedSet([str(Path(self.build_to_src) / df) + for df in self.interpreter.get_build_def_files()]) if self.environment.is_cross_build(): - deps.extend(self.environment.coredata.cross_files) - deps.extend(self.environment.coredata.config_files) - deps.append('meson-private/coredata.dat') + deps.update(self.environment.coredata.cross_files) + deps.update(self.environment.coredata.config_files) + deps.add('meson-private/coredata.dat') self.check_clock_skew(deps) - return deps + return list(deps) def generate_regen_info(self) -> None: deps = self.get_regen_filelist() @@ -1210,7 +1210,7 @@ class Backend: with open(filename, 'wb') as f: pickle.dump(regeninfo, f) - def check_clock_skew(self, file_list: T.List[str]) -> None: + def check_clock_skew(self, file_list: T.Iterable[str]) -> None: # If a file that leads to reconfiguration has a time # stamp in the future, it will trigger an eternal reconfigure # loop. |