astral-sh / astral-sh/python-build-standalone

Setting `RUNPATH` to `lib` directory

Open
#306 2 comments 0 reactions 0 assignees View on GitHub
enhancement
Dominant language
Python
Stars
4.4k
Forks
314
Avg merge
1d 9h
Merged PRs (30d)
27

Description

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.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.