Skip to content

TST: exercise transitive RPATH lookup with a shared library chain - #905

Open
dnicolodi wants to merge 18 commits into
mesonbuild:mainfrom
dnicolodi:rpath-fixes-transitive
Open

dnicolodi wants to merge 18 commits into
mesonbuild:mainfrom
dnicolodi:rpath-fixes-transitive

Conversation

@dnicolodi

Copy link
Copy Markdown
Member

This includes #788 and adds a test to demonstrates the issue described here #788 (comment) I do not have a good idea about how to fix (but a couple of bad ones) and this use case does not seem to be common enough to hold merging #788 so I moved the addition of the test case here.

dnicolodi and others added 18 commits September 20, 2026 21:16
This entries are not meaningful. This has the additional benefit of
not returning an empty string RPATH entry for binaries with RPATH unset.
in preparation to modernize it.  Keep the legacy version around to
make sure that no regressions compared to the current behavior (which
may be incorrect but relied upon by existing packages) are introduced
while reworking the RPATH handling.
This reorganizes the test package to a flatter layout that helps
visualizing all the parts involved in the test and introduces an
asymmetry between the source layout and the installation layout that
demonstrates the bugs in RPATH handling as currently implemented.
meson-python does not support `install_rpath` yet and Meson does not
expose it in introspection data prior to version 1.6.0.  Use
`link_args` to set the RPATH.
macOS requires using `@loader_path` in place of `$ORIGIN`.
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.

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants