Fixes relative to RPATH handling - #788
Conversation
3c3bcf5 to
f84c84f
Compare
54c1583 to
21c079d
Compare
|
This should fix RPATH handling for good. The only thing not included is automatic translation of the There is one case in which this may break projects that work now: when libraries or modules require setting an RPATH to dynamically link to a library installed in the Python install path (with something like @rgommers I think I added test cases for all scenarios we discussed. It would be great if you could test with packages that may be affected and that do not pin the meson-python version to any released version. |
87b4cee to
1fa120b
Compare
At a closer look, I found that on install, Meson prepends |
Emit a warning when this is done. This is required to keep some backward compatibility with packages that relied on the incomplete RPATH handling behavior before mesonbuild#788 to work.
ccf0833 to
0e5d285
Compare
Emit a warning when this is done. This is required to keep some backward compatibility with packages that relied on the incomplete RPATH handling behavior before mesonbuild#788 to work.
e4aca5f to
7120ea2
Compare
Fixed |
fde50f8 to
412e465
Compare
This is the only thing discussed here that remains to be addressed. I pulled in the test, which fails as expected. However, I do not understand what the expectations are, nor how it would be possible to support this use case. |
This shows that build RPATHs are not correctly stripped.
Update typing annotation while there. This does not introduce any functional changes, except removing duplicates entries from RPATH. Fixes mesonbuild#813.
There is no need to perform the check for every native file installed.
for packages using internal shared libraries relocated by meson-python. Fixes mesonbuild#711.
Revise tests to exercise support when executed with Meson > 1.6
Requires Meson 1.9.0. Extend some tests to strictly check that only the expected RPATH entries remain. This is complicated by the need to account for additional RPATH entries required by the Python runtime.
Emit a warning when this is done. This is required to keep some backward compatibility with packages that relied on the incomplete RPATH handling behavior before mesonbuild#788 to work.
The tests package builds an extension module that links with two libraries, one installed alongside the extension module, and another installed in a sub-directory. The location of both libraries needs to be added to the RPATH. The test requires install_rpath support and thus Meson version 1.6 or later for install_rpath to be recorded in the metadata. Ignore the warning emitted building the package on macOS due to the '$ORIGIN' to '@loader_path' translation.
Warn that the translation of $ORIGIN into @loader_path on macOS is provided only for backward compatibility and it is discouraged to rely on it.
I spent a bit more time on this and I have a better understanding. The test package builds a The use of This breaks because
Relevant |
I guess this should be possible if we know the type of the original entry, and updating them one by one. But agree with deferral to gh-905.
Having another look now - seems like it's all happy. |
rgommers
left a comment
There was a problem hiding this comment.
All seems happy in CI and local testing; of the extra test packages I created, fixes for cases 1, 2, and 3 looks good; case 4 we deferred, and case 5 we descoped as not realistic enough. So all good, in it goes.
Thanks again @dnicolodi!
|
WDYT about releasing this immediately as 0.22.0? Would be good to get some feedback quickly in case anything is still off (seems unlikely, but hard to be sure), and I like the idea of a release with just this change in it. |
Seems like a good idea. |
Builds on top of #783 and replaces #724
Fixes #711
Fixes #813