-
-
Notifications
You must be signed in to change notification settings - Fork 228
CI experiment: Build on latest Debian #772
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
base: main
Are you sure you want to change the base?
Conversation
Mostly just want to see what the symbol validation failures are....
The problem with this is the glibc version will be too new and binaries won't run an older Linux distros. We currently use Debian 8 Jessie as our base image / glibc for x86-64 and Debian 9 for aarch64 and cross-compiled arches. Debian 8 is running glibc 2.17, which is ancient. Debian 9 is running glibc 2.24. Per https://github.com/pypa/manylinux manylinux2014 is glibc 2.17. So upgrading to Debian 9 would drop manylinux2014 ABI compatibility and would make manylinux_2_24 the minimum supported platform tag. IMO I think enough time has passed that we should switch to Debian 9. (It would be awesome if uv could record metrics for the glibc version seen in the wild. This would really help make data based decisions about when it is safe to drop ABI compatibility.) |
Yea, I'm working on that, this is not for review yet ;) |
Still not ready for review, but the last commit is the beginning of a tool to decrease the symbol version requirements where safe (a lot of symbols gained a new symbol version when glibc consolidated libdl, libm, etc. into libc). It is not yet wired into the build. With a manual (non-standalone) build of CPython from source, I am down to about 30 too-new symbols with that, of which ~half ought to be weakly linked (there's an example of how to do that with |
Couldn't you build with That is the modern approach for targeting lower glibc versions these days, while allowing modern distro + toolchain instead of needing a much older environment as a workaround. |
I really should play with But the thing this draft PR is getting at is targeting older glibc versions while adding support for newer features via e.g. weak linking. Both the |
You can target a lower glibc by appending the version to the target, which is what would be desired here? Nothing specific to Debian. Should you want to cross-compile, you can sort out sysroots like you would with the other toolchains. The latest Zig can also do a static glibc build, but only with the native target (uses the hosts static glibc package IIRC), no cross-compilation or different glibc version support there (note: static glibc is rarely advisable, and definitely not for this project). In Rust land, Zig also had the benefit for static builds with musl targets, especially for cross-compilation it was much simpler when building a project with some external dependencies like OpenSSL were to be built IIRC (Rust would need a toolchain setup for that target).
I'm just bringing it up since like with Docker it does simplify things, and when it's possible to delegate through convenience of tooling I tend to prefer that provided it's a not a maintenance burden (I can't confidently say that Zig won't be, some projects do run into issues when building with Zig that can be friction to troubleshoot and get resolved upstream).
Not exactly my area of expertise, but while looking into this project I noticed the That one in particular is perhaps a rather niche concern, I ran into it when troubleshooting a major performance regression for Python software running in containers at the time 😓 EDIT: Actually it seems like you've run into it as well (last I recall this was partially resolved with Docker v25, but was still waiting on it's adoption of Containerd 2.x), I did extensive research into this issue and got the fixes pushed upstream (roughly it comes from bad config choices in the systemd service files distributed): python-build-standalone/cpython-unix/base.Dockerfile Lines 32 to 40 in 1abe862
On Github Actions runners, you won't have that problem (limit is 65K). Debian isn't affected as much either as a Docker build host since it patched a related systemd change (a workaround for another debian issue related to their patched PAM). I would assume it'd be much simpler for you to leverage Zig to support customized builds via the I haven't verified, but it might help resolve concerns like this: python-build-standalone/cpython-unix/build-zstd.sh Lines 17 to 22 in 1abe862
Depending on all the various packages you're building from source, you could potentially delegate quite a few of those too if that was acceptable. Quite a few have sys packages at |
Sorry, I was a bit unclear - what I'm saying is that we can get this same benefit without Zig by setting up a sysroot manually, which isn't that hard to do (at least just for targeting an older glibc version—it's harder for non-Linux and
I think that's right, yes. The goal here is for
This one is in apt itself, i.e., an artifact of using an older version of apt as part of an older container.
That's an interesting question, I'll take a look! Anyway again the purpose of this PR at the moment is just to see what the CI failures are if we were to target the newest glibc without doing anything fancy (because we have a validation test that things work on older versions of Debian). I pushed my commit for trying to do some weak linking stuff just so it wasn't solely on my laptop, but it's not ready yet, this PR is intentionally in draft without a useful description :) |
For linking, they distribute a metadata file annotating all the glibc versions and their symbols. Then at link time it generates a symbol map of sorts for the linker that instructs the linker which symbols are in a fake For C/C++ compilation where they need glibc C headers, I believe they distribute every distinct version of the header files from all glibc versions then create a symlink/hardlink tree that is added to the compiler include path. Essentially a dynamic sysroot. Or at least this is how things worked when I looked at it a few years ago. Fun fact: at one point I was going to author a Rust shim for LLVM/Clang that essentially implemented Since Astral is now in the hosted package building space, maybe building this is something that interests you. Charlie knows how to reach me :) |
Mostly just want to see what the symbol validation failures are....