Skip to content

fix: support debian multiarch with local toolchains #3100

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 4 commits into from
Jul 16, 2025

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
Projects
None yet
Development

Successfully merging this pull request may close these issues.

local_runtime_repo fails to discover and link against python3.8 shared libraries on Ubuntu 20.04
3 participants
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy