Skip to content

Commit

Permalink
Ensure meson's prefix is a valid absolute path
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
shoeffner committed Oct 23, 2024
1 parent f46c61e commit 9ed628c
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion conan/tools/meson/meson.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)

Expand Down

0 comments on commit 9ed628c

Please sign in to comment.