summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorXavier Claessens <xavier.claessens@collabora.com>2021-03-20 10:38:01 -0400
committerXavier Claessens <xclaesse@gmail.com>2021-03-22 14:45:10 -0400
commit20a90cf709a399e639e6f092ab0bb06c087084dc (patch)
tree8e1c32060189494dcef135e2d0f268897585b225
parent9dc7abe697af9e53fcd9783f6b2f5b2e223ba3c6 (diff)
downloadmeson-20a90cf709a399e639e6f092ab0bb06c087084dc.tar.gz
cmd_line_file.txt: Use cross/native file path resolved by coredata
This fix issue when using --wipe and the machine file was passed as a pipe and written locally, or when the file was resolved in XDG_DATA_HOME or XDG_DATA_DIRS. Fixes: #8560
-rw-r--r--mesonbuild/coredata.py4
-rw-r--r--mesonbuild/msetup.py4
2 files changed, 6 insertions, 2 deletions
diff --git a/mesonbuild/coredata.py b/mesonbuild/coredata.py
index aa8379430..d4179d2c0 100644
--- a/mesonbuild/coredata.py
+++ b/mesonbuild/coredata.py
@@ -905,9 +905,9 @@ def write_cmd_line_file(build_dir: str, options: argparse.Namespace) -> None:
properties = OrderedDict()
if options.cross_file:
- properties['cross_file'] = [os.path.abspath(f) for f in options.cross_file]
+ properties['cross_file'] = options.cross_file
if options.native_file:
- properties['native_file'] = [os.path.abspath(f) for f in options.native_file]
+ properties['native_file'] = options.native_file
config['options'] = {str(k): str(v) for k, v in options.cmd_line_options.items()}
config['properties'] = properties
diff --git a/mesonbuild/msetup.py b/mesonbuild/msetup.py
index 139b47609..5c7bb17e0 100644
--- a/mesonbuild/msetup.py
+++ b/mesonbuild/msetup.py
@@ -246,6 +246,10 @@ class MesonApp:
b.devenv.append(intr.backend.get_devenv())
build.save(b, dumpfile)
if env.first_invocation:
+ # Use path resolved by coredata because they could have been
+ # read from a pipe and wrote into a private file.
+ self.options.cross_file = env.coredata.cross_files
+ self.options.native_file = env.coredata.config_files
coredata.write_cmd_line_file(self.build_dir, self.options)
else:
coredata.update_cmd_line_file(self.build_dir, self.options)