Skip to content

Conversation

rickeylev
Copy link
Collaborator

@rickeylev rickeylev commented Jul 16, 2025

Apparently, there is a "multiarch" style of Python installations, where the shared
libraries can be in a sub-directory. The best docs I could find about this are
https://wiki.debian.org/Python/MultiArch.

To fix, looking at the MULTIARCH sysconfig var tells what subdirectory, if any
should be looked in.

Along the way, fix a changelog issue reference url.

Fixes #3099

@rickeylev rickeylev requested a review from aignas as a code owner July 16, 2025 04:23
@aignas aignas enabled auto-merge July 16, 2025 04:26
@rickeylev rickeylev disabled auto-merge July 16, 2025 04:30
@rickeylev
Copy link
Collaborator Author

cc @ekeranen this is slightly different than your patch -- it symlinks origin -> lib/{multiarch_dirname}/{libname}. In your original patch, the second symlink call could overwrite the first.

Hrm, though -- maybe that is wrong? because the libs will be in a sub-dir? Which...all the libpython* stuff probably wants to be in the same dir. But idk if both the regular and multiarch locations could exist? If they do, then what?

Looking at my local system, /usr/bin/python's MULTIARCH does return a value, however, LIBDIR is already pointing there. This is py 3.12. Is py3.8 doing some older behavior?

@ekeranen
Copy link

What about implementing this only as a fallback?

if origin.exists: ... elif origin_multiarch.exists: # ... this python installation doesn't set LIBDIR correctly. Fallback to LIBDIR/MULTIARCH. ... 
@rickeylev rickeylev enabled auto-merge July 16, 2025 05:25
@rickeylev rickeylev disabled auto-merge July 16, 2025 05:25
Copy link

@ekeranen ekeranen left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, thanks!

@rickeylev rickeylev enabled auto-merge July 16, 2025 05:27
@rickeylev
Copy link
Collaborator Author

yeah, good idea. done.

@rickeylev rickeylev added this pull request to the merge queue Jul 16, 2025
Merged via the queue into bazel-contrib:main with commit 2c7187d Jul 16, 2025
3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

3 participants