python-build-standalone icon indicating copy to clipboard operation
python-build-standalone copied to clipboard

Setting `RUNPATH` to `lib` directory

Open GertBurger opened this issue 1 year ago • 1 comments

We vendor some 3rd party dependencies to reduce the number of system deps we have and to ensure consistency between installations.

Whilst evaluating this project as a basis for the python we'd like to ship we noticed that no RPATH or RUNPATH is set, which prevents loading of shared libraries from the most obvious location being the lib directory that is being shipped.

The only ticket I found that seems related is #227

I attempted to set the RUNPATH using pathelf but for some unknown reason it doesn't have any effect. Setting an RPATH worked but since it is deprecated and not really fit for our purpose we would rather not use it.

I'm not sure if it is possible to set a relocatable RUNPATH so setting a default one might not be possible. Being able to set one at all would be very useful.

My knowledge in this area is somewhat limited so I might be missing something obvious.

Thoughts?

P.S. the command was patchelf --set-rpath '/somepath/lib/' /somepath/bin/python3.9 where somepath is equivalent to the python directory in the release artifacts.

GertBurger avatar Aug 26 '24 17:08 GertBurger

I put a note in #227 about this in case it's helpful

mzpqnxow avatar Nov 28 '24 01:11 mzpqnxow