Repository navigation
ci(cli-release): build Linux binaries at glibc 2.17 (manylinux2014 + python-build-standalone) - #48
Merged
Merged
Conversation
…loor)
The linux-x86_64 / linux-arm64 binaries were built on ubuntu-22.04
(glibc 2.35). PyInstaller links the bundled libpython against the build
host's glibc, and glibc is backward- but not forward-compatible, so the
binary aborts at startup on any older host:
libpython3.11.so.1.0: /lib/x86_64-linux-gnu/libm.so.6:
version `GLIBC_2.35' not found
That breaks every non-latest distro — RHEL/Rocky/Alma 8 & 9 (2.28/2.34),
Ubuntu 20.04 / Debian 11 (2.31), and more.
Build the two Linux targets inside a manylinux_2_28 container instead, so
the binaries get a glibc 2.28 floor. manylinux_2_28 is the lowest glibc
that still satisfies node20 (the v4 actions' runtime), so it works as a
plain job `container:` with no docker-run rework. macOS/Windows jobs are
unchanged (container is empty for those matrix entries).
manylinux's own /opt/python is static (Py_ENABLE_SHARED=0), which
PyInstaller can't bundle, so the container step installs the AlmaLinux 8
shared-libpython python3.11 via dnf (+ python3.11-pip, shipped
separately) and pins Poetry's venv to it.
Validated end-to-end in the aarch64 container against the real CLI:
91 tests pass, pyinstaller bundles libpython3.11.so.1.0, `greffer --help`
runs, and the bundled libpython's max referenced symbol is GLIBC_2.28.
Excludes only CentOS 7 / Amazon Linux 2 (glibc < 2.28, both EOL); those
would require manylinux2014 + a docker-run-on-host build.
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
…ld-standalone) Supersedes the manylinux_2_28 (glibc 2.28) approach to cover CentOS 7 and Amazon Linux 2 as well — a single 2.17-floor binary per arch runs on everything (backward compat: the lowest floor covers all higher), so there's no need to ship multiple glibc variants. 2.17 means manylinux2014, which can't be a job `container:` (node20, the v4 actions' runtime, needs glibc >= 2.28) and is CentOS-7 based with no shared-libpython python3.11 (PyInstaller needs a SHARED libpython). So: - checkout + upload stay on the host; only the build runs via `docker run` inside the container. - a relocatable shared-libpython interpreter is fetched from python-build-standalone (pinned; bump periodically). macOS / Windows jobs unchanged (native build, gated on !matrix.image). Validated with the verbatim `docker run` command on native aarch64: 91 tests pass, pyinstaller bundles libpython3.11.so.1.0, the binary runs, and every bundled .so references only GLIBC_2.17. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
…-2.17 boot test) Three robustness fixes for the python-build-standalone download path: - Integrity: verify the fetched interpreter tarball against a hard-pinned per-arch sha256 before extracting (the PBS release publishes no sidecar, so the hash is computed at pin time and lives in the matrix). Aborts the release if the asset ever changes. - Resilience: wrap the download in a portable retry loop. manylinux2014 ships curl 7.29 (CentOS 7), which lacks --retry-all-errors, so the loop is hand-rolled rather than relying on curl flags. - Verification: in addition to the static "max bundled GLIBC symbol <= 2.17" regression guard, actually boot the freshly built binary inside a centos:7 container (multi-arch, glibc 2.17 — the real floor) so CI proves it runs on the oldest supported glibc, not just that the symbols look right. Validated on native aarch64: sha256 -c passes on the real asset and rejects a bad hash, 91 tests pass, the floor guard reports GLIBC_2.17, and greffer --help runs under centos:7. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Adversarial review (release-engineering focus) found a release-blocking ownership bug plus robustness gaps; all fixed: - BLOCKER: PyInstaller runs as root in the container, so cli/dist/ was created root-owned on the bind mount and the host-side Package step (running as the unprivileged runner user) could not write the tarball into it — every Linux release would fail. Chown the cli/ subtree back to the host uid/gid (derived from the mount) at the end of the build; this also clears root-owned leftovers (caches, egg-info) that would break workspace cleanup on reused/self-hosted runners. Scoped to cli/ so it always exists and skips the checkout-owned .git/ tree. - Boot test now reuses the digest-pinned manylinux2014 image (glibc 2.17, on quay, already pulled, multi-arch) instead of Docker Hub's centos:7, removing an anonymous-pull-rate-limit flake that could fail a release. - Pin both manylinux2014 images by digest (they build the shipped binary — part of the supply chain, like the sha256-pinned PBS asset). - Download retry loop now fails explicitly when attempts are exhausted instead of relying on a later step tripping over the missing file; no misleading trailing sleep on the final attempt. - glibc-floor guard asserts it actually inspected symbols, so an empty result can't pass as "clean". - Gate the generic --help smoke-test to macOS/Windows; Linux relies on the dedicated glibc-2.17 boot test (which exercises the real floor). - publish: assert all five target artifacts are present before cutting the release, so artifact-naming drift can't ship a silent subset. Re-validated end-to-end on native aarch64 (full build, sha256, floor guard, chown, 2.17 boot) and in isolation (retry exhaustion, empty-symbol guard, target-presence check). Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
…ncy, precise boot-test note All minor, no behavior change to the build: - Fix stale "four arches"/"four jobs" comments (the matrix builds five targets: linux x2, darwin x2, windows). - Add a per-ref concurrency group (cancel-in-progress: false) so two quick pushes or a tag re-push can't run two publish jobs racing the same GitHub Release. - Reword the boot-test comment: the image is digest-pinned per-arch (the matrix pins the matching aarch64/x86_64 digest), not a multi-arch index. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Member
Author
Adversarial expert review — passed (4 rounds → CLEAN)Ran an independent release-engineering reviewer (GitHub Actions / PyInstaller / glibc / manylinux / Docker-in-CI / supply-chain) in a loop until a clean pass:
Every fix re-validated end-to-end on native aarch64 (full build, sha256, floor guard, chown, glibc-2.17 boot) and in isolation (retry exhaustion, empty-symbol guard, target-presence check). Commits: |
Member
Author
|
@codex review |
|
You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
Operators on non-latest Linux distros can't run the installed binary:
The
linux-*assets are built onubuntu-22.04(glibc 2.35). PyInstaller links the bundledlibpython— and every shared lib it pulls in — against the build host's glibc, and glibc is backward- but not forward-compatible, so the binary aborts at startup on anything older.Fix — one binary per arch at the glibc 2.17 floor
A glibc-2.17 binary runs on everything (backward compat: the lowest floor covers all higher), so no need to ship multiple glibc variants:
2.17 means manylinux2014, which forces two changes vs a plain job container:
container:. checkout + upload stay on the host; only the build runs viadocker runin the container.python3.11(PyInstaller needs a shared libpython) → fetch a relocatable one from python-build-standalone.macOS / Windows jobs unchanged (native build, gated on
!matrix.image).Hardening (third commit)
Because the build now downloads a third-party interpreter, the PBS path is hardened:
--retry-all-errors)..soreferences a symbol newer thanGLIBC_2.17, and the freshly built binary is booted inside a realcentos:7(glibc 2.17) container so CI proves it runs on the oldest supported glibc.Validation (native aarch64, real CLI)
poetry install --with release, 91 tests pass,pyinstaller greffer.specbundleslibpython3.11.so.1.0✅sha256sum -cpasses on the real asset, rejects a tampered hash ✅GLIBC_2.17; every bundled.soreferences only GLIBC_2.17 ✅greffer --helpruns undercentos:7✅The PR's own
pull_requestCI exercises the real native x86_64 + arm64 matrix.Notes
manylinux_2_28(2.28) → superseded bymanylinux2014(2.17) → hardening. Squash on merge.pbs_url+pbs_sha256together for CPython security updates.cli-v*tag is cut.🤖 Generated with Claude Code