Repository navigation
Publish Linux gap wheels (manylinux_2_28 x86_64, musllinux_1_2 aarch64) - #3
Merged
Merged
Conversation
…ch64 Stage now takes Linux wheels for the three Linux lab targets, each with exactly auditwheel's repaired tag: 3.14t and 3.15 manylinux_2_28_x86_64, 3.14 musllinux_1_2_aarch64. - A bounds-checked ELF reader (program headers, dynamic segment, version needs) checks every ELF file in the wheel: each needed library must be bundled in the wheel or on auditwheel 6.8.2's manylinux_2_28 or musllinux_1_2 list, and for glibc every symbol version must be one the policy allows (no GLIBC above 2.28, nor GLIBCXX/CXXABI/GCC above it). Anything unreadable refuses the wheel. Windows keeps the PE check. - install-test runs Linux targets with docker run in a minimal image pinned by digest: python:3.14-alpine, python:3.15-slim-trixie, and debian:trixie-slim with a sha256-checked python-build-standalone 3.14t. - The index withdraws our Linux wheel when PyPI ships one for an older or equal manylinux/musllinux of the same architecture. - README and index page name the published targets. Co-Authored-By: Claude Opus 5.5 <[email protected]>
…NPATH Review fixes for the Linux stage check: - Version needs from ld-linux-* are checked like any other, so a _dl_find_object@GLIBC_2.35 or GLIBC_PRIVATE need is refused. - The version-needs walk follows vn_next/vna_next to 0 by address, as _dl_check_map_versions does, and refuses a file whose chains don't match DT_VERNEEDNUM and each vn_cnt (needs hidden past a count). - PT_LOAD segments must be in vaddr order and may not share a page with a different file offset, so offset() reads what the loader maps. - A needed library counts as bundled only if it is in the needing file's folder or on its DT_RUNPATH (else DT_RPATH) under $ORIGIN, within the wheel and its install scheme; anything else must be on the allowlist. - Library, version and search-path names are restricted to a safe character set, and one wheel's ELF files may be read up to 1 GB in all. - install-test containers run with --cap-drop ALL and no-new-privileges, and the host copies tested.json only if it's a regular file. - read_tested binds each answer to its artifact's slug, not the target its JSON names. - README says "links against" and that dlopen'd libraries aren't checked. Co-Authored-By: Claude Opus 5.5 <[email protected]>
Drop the needing file's own folder from the places a needed library may be found: only $ORIGIN entries of its DT_RUNPATH (or DT_RPATH when there is no RUNPATH) count. A wheel that works only because the package preloads a library with ctypes isn't published. Co-Authored-By: Claude Opus 5.5 <[email protected]>
- installed() maps only the wheel's own <name>-<version>.data folder (from its one .dist-info folder) by install scheme, as pip does; another top-level *.data folder installs as is. A wheel without exactly one .dist-info folder is refused. - The segment page-sharing check uses the largest page a kernel of that machine uses: 4 KiB on x86_64, 64 KiB on aarch64. A flat 64 KiB would refuse ordinary x86_64 binaries (lz4, zstandard, numpy all fail it). - README step 4: only $ORIGIN RUNPATH/RPATH entries count. Co-Authored-By: Claude Opus 5.5 <[email protected]>
This was referenced Nov 17, 2026
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.
Stage, install-test and publish now handle the three Linux lab targets. Until now this was Windows only. Nothing goes public from this PR on its own: every publish run still waits for a maintainer to approve the
publishenvironment.What gets published
Each target gets exactly one tag: the one auditwheel repairs to in the target's pinned build image.
linux_*tags, compressed tag sets and any other manylinux version are refused.3.14t linux-x86_64cp314-cp314t-manylinux_2_28_x86_643.14 musl-aarch64cp314-cp314-musllinux_1_2_aarch643.15 linux-x86_64cp315-cp315-manylinux_2_28_x86_64Stage checks (trusted job, parses bytes and never runs them)
elf_needsis a bounds-checked reader for untrusted ELF files. It reads them the way the dynamic loader does (program headers,PT_DYNAMIC,DT_NEEDED,DT_VERNEED) and returns the needed libraries and the version needs (.gnu.version_r). It returnsNone(and the wheel is refused) for: a 32-bit or big-endian file, the wronge_machine, truncated tables, offsets outside a loaded segment, a missingDT_NULL, version chains that don't end, or non-ASCII names.missing_libsrunself_needson every.so/.so.Nin the wheel, and on any other member that starts with the ELF magic.<dist>.libs/and sets RUNPATH there.REPAIR_TOOLSpins:src/auditwheel/policy/manylinux-policy.json(manylinux_2_28, x86_64) andmusllinux-policy.json(musllinux_1_2, wherelibc.somaps tolibc.musl-aarch64.so.1as auditwheel does).GLIBC_2.34,GLIBC_PRIVATEandGLIBCXX_3.4.30are refused. Versions fromld-linux*are skipped, as in auditwheel.take_wheelpicks the check from the target: PE for Windows, ELF for Linux (byplat).Install test in minimal containers
Linux targets run
docker runon a runner of their architecture, not on GitHub's runner image. The checkout and staged wheels are mounted read-only, and no token or secret is passed in. The job keeps its existing properties: read-only token, no caches,persist-credentials: false. Windows targets are unchanged and still use setup-python.All image digests are multi-arch indexes, read from the Docker Hub registry API on 2026-11-17:
3.14 musl-aarch64:python:3.14-alpine@sha256:5862d971…(CPython 3.14.10). It's the same digest the build uses. Runner:ubuntu-24.04-arm.3.15 linux-x86_64:python:3.15-slim-trixie@sha256:65a65fc7…(CPython 3.15.2, glibc 2.41). Runner:ubuntu-latest.3.14t linux-x86_64: there's no official free-threaded image, so it usesdebian:trixie-slim@sha256:a72b4433…plus python-build-standalone202611103.14.10 freethreaded install_only. That archive is pinned by URL and by the sha256 from the release's SHA256SUMS. The runner downloads it, checks it withsha256sum -c, unpacks it and mounts it read-only at/opt/python, so no curl or CA store is added to the image (pip uses its bundled certifi). Runner:ubuntu-latest.install_and_importalready handlesbin/vsScripts/. Thetestsmatrix now carriesimage,interpreter,python_urlandpython_sha256, set to empty strings for Windows.Also
build_gap_index.covers: our Linux wheel now drops out of the index once PyPI ships the same Python and ABI for an older or equal manylinux or musllinux version of the same architecture (including the legacymanylinux2014/2010/1aliases). Without this, pip would prefer ourmanylinux_2_28wheel over PyPI'smanylinux_2_17one.Not done
REPAIR_TOOLS. A test asserts the auditwheel pin.Tests
uvx --python 3.14 [email protected]: 92 passed, 1 skipped. The skip is a real-interpreter ELF test that runs only on Linux x86_64, so it runs in CI.New tests cover:
tag_okfor the new tags, and refusal oflinux_*, compressed sets,manylinux_2_17/2014/2_34, the wrong ABI, the wrong arch and the wrong libc.plat, its policy and a digest-pinned test image.GLIBC_2.34and other version needs, truncated or garbage bytes, 32-bit and big-endian files, the wrong machine, and corrupted tables.stage_reasonandtake_wheelfor Linux wheels.install-testfor a Linux target.The ELF checker was also run by hand on real PyPI wheels (lz4, zstandard and numpy for manylinux, with numpy's bundled OpenBLAS, and orjson for musllinux aarch64). All passed with nothing missing.
🤖 Generated with Claude Code