From 9ed628c424718e0093627ec8009a21f48ac55a27 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sebastian=20H=C3=B6ffner?= Date: Wed, 23 Oct 2024 11:10:22 +0200 Subject: [PATCH] Ensure meson's prefix is a valid absolute path The path / is not considered an absolute path on Windows, failing with: ERROR: prefix value '/' must be an absolute path os.path.abspath ensures that "/" becomes a valid absolute path on all major platforms, resolving to "/" on Linux and macOS, and to "C:\" (or whichever filesystem is currently active, could be E:\ as well) on Windows. Closes #17204. --- conan/tools/meson/meson.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/conan/tools/meson/meson.py b/conan/tools/meson/meson.py index 1f99ade0efc..4e9d940fc0c 100644 --- a/conan/tools/meson/meson.py +++ b/conan/tools/meson/meson.py @@ -47,7 +47,7 @@ def configure(self, reconfigure=False): cmd += f' --native-file "{native}"' cmd += ' "{}" "{}"'.format(build_folder, source_folder) # Issue related: https://github.com/mesonbuild/meson/issues/12880 - cmd += ' --prefix=/' # this must be an absolute path, otherwise, meson complains + cmd += f' --prefix={os.path.abspath("/")}' # this must be an absolute path, otherwise, meson complains self._conanfile.output.info("Meson configure cmd: {}".format(cmd)) self._conanfile.run(cmd)