-
Notifications
You must be signed in to change notification settings - Fork 875
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
Add support for musl Python toolchain fetches #4160
Conversation
I'm not sure... Wouldn't this always download the musl Pythons on our Linux builds now, since we only ship musl? My guess is we do need to determine this dynamically. |
Eek that might be true. Okay, back to the goblin elf approach. I'll need to chat with Konsti about that code. |
I'm actually a bit worried about the use of |
Oh interesting thanks for the link I didn't see #3857 or #3855. I'll need to look into that further. These were not intended to be fully "production ready" when written. I certainly wouldn't be surprised if we need to do something more robust or restore more of the implementation we were using before we moved platform information queries to rely on a Python implementation. |
tl;dr: We need to go back to the libc detection from #2381. There are three different libc configurations supported by rust: glibc dynamically linked (x86_64-unknown-linux-gnu), statically linked with musl (x86_64-unknown-linux-musl), musl dynamically linked ( The libc that uv itself uses doesn't matter since we don't load libraries ourself, but the python we download and start needs to match the libc the user expects. Finding the platform default is non-trivial since you can install glibc on alpine (https://wiki.alpinelinux.org/wiki/Running_glibc_programs) and musl on ubuntu ( On that note, python-build-standalone is currently statically linked for musl and fails to loads any compiled native module (#2382). This is a blocker for deploying python-build-standalone on alpine targets. |
Moving this back to draft as it will require significant revisions. |
I'll open an issue for proper musl detection. This pull request is superseded by #4236 |
Closes #3857 Instead of using custom `Arch`, `Os`, and `Libc` types I just use `target-lexicon`'s which enumerate way more variants and implement display and parsing. We use a wrapper type to represent a couple special cases to support the "x86" alias for "i686" and "macos" for "darwin". Alternatively we could try to use our `platform-tags` types but those capture more information (like operating system versions) that we don't have for downloads. As discussed in #4160, this is not sufficient for proper libc detection but that work is larger and will be handled separately.
Previously, we always assumed GNU.
I considered restoring some of the
platform-host
crate which was removed in #2381. I'm not sure we actually need to do the whole ELF inspection thing though since we don't need version information andtarget-lexicon
seems to have what we need. I presume sincetarget-lexicon::HOST
is a const, that the information is based on the uv's target host not the runtime host. This seems okay for toolchain download assumptions? If not, we can go back to the ELF inspection technique but I'm not fully comfortable modifying that code.