Repository navigation
fix(build): keep the host libgcc_s out of the Linux arm64 binary - #3708
Daniel Meppiel (danielmeppiel) merged 2 commits into
Conversation
python-build-standalone's aarch64 libpython lists libgcc_s.so.1 as NEEDED (for GCC_3.0 long-double helpers); x86_64 does not. PyInstaller therefore copied the ubuntu-24.04-arm runner's GCC 14 libgcc_s.so.1, which needs GLIBC_2.35, and the APM_MAX_GLIBC=2.28 floor check failed the release lane. Exclude libgcc_s.so.1 from the Linux bundle alongside the other system libraries so the host's copy loads, as on x86_64. The floor check and the Rocky Linux 8 smoke step are unchanged. Refs #3399 Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
APM Review Panel:
|
| Persona | B | R | N | Takeaway |
|---|---|---|---|---|
| Supply Chain Security Expert | 0 | 0 | 0 | No supply-chain concerns: libgcc_s joins the existing exclusion set, the host-trust level matches libc, all four defense layers stay in place, and the bundle shrinks. |
| Test Coverage Expert | 0 | 1 | 0 | The bug fix ships with an AST regression test (20/20 passed). CI objdump floor check and Rocky 8 smoke give integration proof. No coverage gap. |
B = blocking-severity findings, R = recommended, N = nits.
Counts are signal strength, not gates. The maintainer ships.
Top 1 follow-ups
- [Test Coverage Expert] After merge, confirm the push run and the manual build-release dispatch pass the arm64 floor check end to end. -- The unit test proves the spec entry exists, and the objdump analysis supports the fix. The full integration proof (PyInstaller bundle, floor gate, Rocky 8 smoke) only runs after merge. Treat the first green arm64 lane as the closing evidence for [FEATURE] Lower the glibc floor of prebuilt Linux binaries to 2.28 (RHEL/Rocky/Alma 8+, Debian 12, Ubuntu 22.04) #3399.
Recommendation
Neither panelist found a blocking issue, the regression test passes, and the bundle ships one fewer library. Both panelists agree on this release-critical fix to an existing mechanism. Ship it, then confirm that the first post-merge arm64 build-release lane passes the APM_MAX_GLIBC=2.28 check to close out #3399.
Full per-persona findings
Supply Chain Security Expert
No findings.
Test Coverage Expert
- [recommended] The regression test covers the new exclusion entry, and existing CI provides integration-tier proof. At
tests/unit/test_build_spec.py.
test_linux_bundle_excludes_host_libgcc_sAST-parsesbuild/apm.specand asserts thatlibgcc_s.so.1is in_exclude_libs, which is the right unit-tier check for a string added to an existing list. Theobjdumpfloor check and Rocky 8 smoke step inbuild-release.ymlprovide the integration proof. The PR touches no critical user-facing surface.
Proof (passed):tests/unit/test_build_spec.py::TestSpecFileSyntax::test_linux_bundle_excludes_host_libgcc_s-- proves: the build spec excludes the host libgcc_s.so.1 from the Linux bundle.
This panel is advisory. It does not block merge. Re-apply the
panel-review label after addressing feedback to re-run.
Generated by autopilot-pr-review-worker. This comment is AI-generated and may contain errors.
There was a problem hiding this comment.
Warning
Copilot couldn't run its full agentic review because it didn't start before the timeout. Make sure your repository has a runner available, or add a copilot-code-review.yml file specifying one with the runs-on attribute. See the docs for more details.
Copilot review overview
1 open issue
What changed in this PR
Updates the Linux arm64 release build to avoid bundling the build-host libgcc_s.so.1 (which can require a newer glibc than allowed), and adds a regression test to ensure the exclusion remains in place.
Changes:
- Add
libgcc_s.so.1to the Linux_exclude_libsset in the PyInstaller spec to prevent bundling the host copy. - Add a unit test that asserts
libgcc_s.so.1remains excluded from the Linux bundle. - Update the changelog entry to reference this follow-up PR.
| File | Description |
|---|---|
build/apm.spec |
Excludes libgcc_s.so.1 from bundled binaries on Linux to keep the glibc floor. |
tests/unit/test_build_spec.py |
Adds a regression test that inspects the spec AST to ensure libgcc_s.so.1 is excluded. |
CHANGELOG.md |
Notes the follow-up PR number for the glibc 2.28 Linux binary change. |
Review effort: Lite

Description
build-release.ymlrun 43322423829 on main failsBuild & Test (ubuntu-24.04-arm, arm64, linux, apm-linux-arm64)in the "Build binary (Unix)" step. The glibc floor check added in #3553 reports:Root cause, checked against the actual python-build-standalone release assets (
cpython-3.12.16+20261110, and the same result for3.12.15+20261021):libpython3.12.so.1.0listsNEEDED libgcc_s.so.1. It needs only twoGCC_3.0symbols (__extenddftf2,__trunctfdf2, the 128-bit long-double helpers). Its highest glibc symbol is still GLIBC_2.17.libpython3.12.so.1.0does not linklibgcc_sat all. That is why x86_64 passed the same check with the same uv-managed Python. fix(build): lower the Linux binary glibc floor to 2.28 #3553 did not use a build container for x86_64 either.libgcc_s.so.1, which needs GLIBC_2.35 (_dl_find_object).Fix: add
libgcc_s.so.1to the existing Linux_exclude_libsset inbuild/apm.spec, next to the other system libraries excluded under #462 and #1534. The binary then loads the host'slibgcc_s.so.1, as x86_64 already does in effect. Every glibc distribution ships it as a base package (libgccon RHEL/Rocky/Alma 8,libgcc-s1on Debian/Ubuntu), and every version since GCC 3.0 provides the twoGCC_3.0symbols. Not bundling it also keeps a newer build-host copy out ofLD_LIBRARY_PATHfor child processes, which is the reason that set exists.I did not switch to a manylinux_2_28 container. It would make arm64 build differently from x86_64 and change the build runner, while the exclusion fixes the actual cause.
The floor check (
APM_MAX_GLIBC=2.28) and the Rocky Linux 8 smoke step are unchanged. The check still reads every bundled ELF file.A regression test in
tests/unit/test_build_spec.pyfails iflibgcc_s.so.1is removed from_exclude_libs.Issue and approved scope
Issue: Refs #3399
Human scope-approval comment: #3399 (comment) (delivered by #3553; the issue is closed)
This PR completes the arm64 half of the #3399 "Done when" list, which #3553 could not verify before merge because arm64 runs only in
build-release.yml. The arm64 bundle needs to pass the glibc 2.28 check and runapm --versionandapm installin Rocky Linux 8. Windows and macOS are unchanged, and the change stays inside the approved files (the release build and its tests).Type of change
Testing
Tested locally
All existing tests pass
Added tests for new functionality (if applicable)
objdump -p/objdump -Tagainst the python-build-standalone aarch64 and x86_64install_only_strippedassets and the aarch64 manylinux wheels. Results are in the Description..venv/bin/python -m pytest -p no:xdist -q tests/unit/test_build_spec.py: 20 passed. Without the new test, the file has 19 tests.Lint contract:
ruff checkandruff format --check(ruff 0.15.12, the version pinned inuv.lock) pass on the changed test file.build/apm.specis not linted by CI.Not run locally: the arm64 PyInstaller build itself. Docker is unavailable on this host, and
build-release.ymlhas noworkflow_dispatchor PR trigger.Post-merge verification: the push to main runs
build-release.yml. The arm64 lane must pass "Build binary (Unix)" (glibc check reading every bundled ELF file) and "Smoke-test binary on Rocky Linux 8 (glibc 2.28)", which runsapm --version,apm initandapm install microsoft/apm-sample-packageagainst the host'slibgcc_son an arm64 Rocky 8 container. Arepository_dispatchmanual-build-releasewill also run the tag-gate jobs on main.Spec conformance (OpenAPM v0.1)
docs/src/content/docs/specs/openapm-v0.1.mdupdated(new/changed
<a id="req-XXX"></a>anchor + prose + Appendix Crow).
docs/src/content/docs/specs/manifests/openapm-v0.1.requirements.ymlupdated.
@pytest.mark.req("req-XXX")test undertests/spec_conformance/added or extended.CONFORMANCE.{md,json}regenerated viauv run --extra dev python -m tests.spec_conformance.gen_statementand committed.