Running Python from the build directory can lead to wrong `libpython` being loaded
Nobody has claimed this yet.
- Dominant language
- Python
- Stars
- 77.2k
- Forks
- 35.9k
- PR merge metrics
- PR metrics pending
Description
Feature or enhancement
Proposal:
Right now, since we don't set RPATH, when using a shared libpython and running Python from the build directory, the library might resolve to the system, instead of the local one.
If possible, it would be good to set RPATH on the Python binary in the build directory, to force the local libpython library to be loaded. It would also be preferred to use RPATH instead of RUNPATH, as the prior has precedence over LD_LIBRARY_PATH, which users might have set.
Has this already been discussed elsewhere?
No response given
Links to previous discussion of this feature:
No response
Linked PRs
- gh-128470
- gh-128645
- gh-129506
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Review the linked pull requests gh-128470, gh-128645, and gh-129506 first, since they cover the proposed build-directory loading change. Verify that running Python from the build directory loads the local shared libpython and that RPATH is used instead of RUNPATH where supported.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- python
- Domain
- build-system
- Issue type
- Feature
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 20/100