Skip to content

Running Python from the build directory can lead to wrong libpython being loaded #128469

Open

Description

@FFY00

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

Activity

  1. added a commit that references this issue on Jan 4, 2025
  2. added
    buildThe build process and cross-build
    on Jan 6, 2025
  3. changed the title [-]Set `RPATH` on the builddir Python executable[/-] [+]Running Python from the build directory can lead to wrong `libpython` being loaded[/+] on Jan 8, 2025
  4. added a commit that references this issue on Jan 8, 2025
  5. added 2 commits that reference this issue on Jan 29, 2025
  6. encukou commented on Jan 30, 2025

    @encukou
    Member

    The new test fails on some buildbots, for example here: https://buildbot.python.org/#/builders/543/builds/7232/steps/7/logs/stdio

    Can you fix it today, or should we revert it for now?

  7. FFY00 commented on Jan 30, 2025

    @FFY00
    MemberAuthor

    Yes, I will look at it in a bit.

  8. added a commit that references this issue on Jan 31, 2025
  9. added a commit that references this issue on Jan 31, 2025
  10. added 2 commits that reference this issue on Feb 7, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    buildThe build process and cross-buildtype-featureA feature request or enhancement

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions