Closed FFY00 closed 1 year ago
This is expected. See the documentation for get_path()
: https://mesonbuild.com/Python-module.html#get_path It returns an absolute path as defined by the sysconfig
Python module. You should not use it to derive installation paths, at least not when building wheels. You should use get_install_dir()
instead.
It is possible to pass absolute paths as installation paths. meson-python cannot deal with those, but when writing build definitions to be used to build wheels, this is a bug in the meson.build
, not in meson-python.
Also, note that py.get_path()
does not respect --prefix
, thus it would not work with the heuristic either, thus the build definition is technically not correct (or at least it would do something unexpected) also outside meson-python.
Closing this as per https://github.com/mesonbuild/meson-python/issues/344#issuecomment-1468737855.
@dnicolodi thanks!
When writing a test to check something else, I hit a case where Meson still uses the full path in the metadata, instead of having a placeholder. This happens because I install from
py.get_path('purelib')
.The heuristics that used to deal with this were removed in #280. We were under the impression these issues were fixed in newer Meson versions, but apparently using paths returned from functions, at least in
install_subdir
, is still broken. I should have tried this when reviewing the PR, sorry. IIRC, I did try another similar snippet, which IIRC was working, but I shouldn't have stopped there. We should have had a test covering this already too.Reproducible: