Repository navigation
gcc 15.2.0 → 16.2.0, with gcc-runtime split out (pm#1182) - #1545
bryan-minimal wants to merge 38 commits into
Conversation
Consumers that need libgcc_s, libstdc++, libgomp, libatomic or libquadmath at run time now take a subset of gcc-runtime instead of gcc, so a box no longer pulls in the whole compiler. gcc-runtime-fortran carries libgfortran, for openblas. gcc-runtime copies the published gcc's files byte for byte (checked on both arches). For that, gcc's own build graph must not reach gcc-runtime: ncurses drops its C++ binding, binutils drops gprofng, and gmp drops C++, with gmpxx a new package for maude, libpoly and cvc5. gcc_runtime_guard.py enforces this. Also folded in, to pay for one world rebuild instead of several: - gcc's outputs follow the registry spec's example (gominimal/arch#183): 27 outputs, with no file in two of them; - breaker output globs name every file of their prebuilt objects (OQ-42); - #1499: amd64 binutils and ghc-9.6.7 move to gen-16's plain-loader objects; - #1535: arm64 gcc, and gcc-runtime's breaker with it, move to gen-17's glibc-seed object. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
gcc 16 builds against glibc 2.43 unpatched, so the libgomp -Wno-error=discarded-qualifiers workaround goes away. Fixes for packages that failed to build with gcc 16, all found by the world-build canary pkgs#1340: - abseil-cpp: build as C++17, so the installed ABI does not need C++20; - foundationdb: include <cstdint> in ClientWorkload.h; - cbmc: backport diffblue/cbmc#9024 for gcc 16's -Werror; - gcc-arm-none-eabi: 14.2.0 -> 16.2.0 and newlib 4.4.0 -> 4.6.0. The source is the upstream https URL (gominimal/arch#183 model §6.1). Its sha256 matches ftp.gnu.org's copy, and the sha512 matches gcc.gnu.org's sha512.sum. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
Warning Review limit reached
This review includes 149 billable files and costs up to $37.25. View limit details
|
rust/build.ncl: keep gcc-runtime, take main's rustc-1.99.1 stage0 and 1.100.0. rustc-1.99.1 (new on main): subsetOf gcc-runtime, as rustc-1.98.1. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
No change: the previous run on this head was cancelled before a verdict. Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
minimal's planner seed-builds any dependent of an unbuilt cycle member against its replace_on_cycle once the other deps are cached (planner.rs dep_candidate). After a cancelled run, #1545 seeded this package against arm64's gen-17 gcc seed, which ships no Fortran, and failed. Seed builds are never published, so write a placeholder (not named libgfortran.so.5) and exit; the real build copies gcc 16's libgfortran as before. stage.sh is unchanged (gcc_runtime_guard passes). The proper fix is in minimal's planner. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
/build |
The bbe77a4 run failed on arm64 mathlib-oleans: minimal's orchestrator reused a gcc-runtime subset cut from the gcc 15 breaker seed pass (subsets keyed on (bsr, outputs) only; ~/workspace/gominimal/GCC16_ARM64_LIBSTDCXX_2026-11-19.md). gcc, gcc-runtime and gcc-runtime-fortran are now cached on arm64, so this run has no seed pass. `/build` is ignored on a non-gated PR, hence this empty commit. Also retries tmd on amd64 (a network reset). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Conflicts: foundationdb, ghostscript and grpc. Each keeps main's change (openssl 4, ghostscript dropping libstdcpp, grpc's ca-certificates) on top of this branch's subsetOf gcc-runtime. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Conflict: ruff 0.17.6 (main) on top of this branch's subsetOf gcc-runtime. The other merged bumps (ruby, gradle, bun, postgres, restic) merged clean. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
apalache, cargo-fuzz, cargo-llvm-cov, cargo-mutants and quint merged with `subsetOf gcc [...]`; gcc_runtime_guard.py fails them on this branch. Same outputs, from gcc-runtime. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…as gcc subsets) Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…n on main by a test dep's whole-gcc closure Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…trace): 27 packages
glibc dlopens libgcc_s.so.1 to unwind on pthread_cancel and pthread_exit,
and aborts without it ("libgcc_s.so.1 must be installed for ... to work").
backtrace() also dlopens it, and returns no frames without it. A dlopen is
not DT_NEEDED, so missing-runtime_deps cannot see it.
On main, ncurses and gmp carried subsetOf gcc ["libgcc", "libstdcpp"],
which hid the gap. Rule 4 now keeps gcc-runtime out of both, so this branch
exposed it (iperf3, 2963cec).
I scanned the gcc-16 build artifacts, amd64 and arm64, of every package
whose runtime closure lacked libgcc for undefined imports of these symbols.
This commit adds libgcc to 27 of those packages. redis drops its unused
["libstdcpp"]: no redis ELF NEEDs libstdc++.
Not fixed at this layer, because gcc's build graph reaches them and
gcc_runtime_guard rule 4 forbids gcc-runtime there: python
(gcc -> glibc -> python) and openssl (gcc -> glibc -> python -> openssl).
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
libgcc_s via glibc's dlopen: audit and fix (e5e9e58)Why. glibc dlopens On main, ncurses and gmp carried Method.
Fixed: libgcc added to runtime_deps (27 packages).
Not fixed at this layer (rule 4: gcc's build graph reaches them).
29 packages still have libgcc_s missing only through these two: curl, wget, openssh, nginx, rsync, tmux, the py-* packages and others. The real fix is to take python out of glibc's build graph, or to split it. I left that out of scope. Skipped.
None of the existing standalone tests for these packages exercise thread cancellation or exit, and I added no new tests in this pass. |
|
Note on the two rule-4 exceptions in the libgcc_s change (e5e9e58): python and openssl can't take
If we want python covered too, the clean fix is a bootstrap python for glibc's build, which takes python out of gcc's graph. That's a follow-up, not a blocker for this PR. |
# Conflicts: # packages/rustc-1.98.1/build.ncl
…ches (158.0.8127.88) Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…ps source
- gcc-runtime/build.ncl, gcc-runtime{,-fortran}/stage.sh, gcc/build.sh:
the cycle comments described gcc -> ... -> ncurses/gmp -> gcc-runtime,
which rule 4 now forbids. gcc-runtime is on no bootstrap cycle (its
build deps are all inside gcc's graph); the comments say so, and why
the breaker and the stage stay.
- gcc-runtime-fortran: the seed-pass placeholder branch now refuses when
the gcc in the root is the real gcc version (build_args gcc_version),
so only the bootstrap breaker can take it. loads_without_gcc already
fails on an artifact with no libgfortran.so.5.
- gmp, gmpxx: source from https://mirrors.kernel.org/gnu/gmp (same
sha256; checked against the mirror's bytes). gmpxx's header comment
moves below the import lines.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
glibc dlopens libgcc_s.so.1 to unwind on pthread_cancel, pthread_exit and thrd_exit (aborting without it), and backtrace() dlopens it too. A dlopen is not DT_NEEDED, so missing-runtime_deps cannot see it; e5e9e58 fixed 27 packages from a one-time scan, and nothing stopped it coming back. - libgcc_dlopen_importers.toml: the 82 packages whose built ELFs import one of the symbols (both arches, full fleet: 586 packages, 10,313 ELFs; no cache artifact for android-sdk, claude-code, edgedelta, foundationdb). - libgcc_dlopen_guard.py (blocking, recipe-only): each listed package needs gcc-runtime's libgcc in its runtime closure (runtime_deps only, subsets pull in the parent's runtime_deps, helper .runtime_deps followed; if/match deps fail closed). Reuses gcc_runtime_guard's parsing helpers. Its edges and verdicts match `mip dump --packages` on both arches for every package. - libgcc_dlopen_scan.py + weekly workflow: streams every package's artifact from cache.minimal.dev (sha256 checked against the index), reads .dynsym, and fails when the data file is missing, stale or changed; --write regenerates it. On gcc-16 as of 10BC8 40bb0b0 the guard fails for python and openssl. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…moved packages python-bootstrap's interpreter imports pthread_exit, but it runs only in glibc's build and sits in gcc's build graph, where rule 4 forbids gcc-runtime. libgcc_dlopen_build_only.toml exempts it with a reason; the guard fails if any recipe takes an exempt package in runtime_deps, and the scan leaves exempt packages out of the importers list. llvm-21 and rustc-1.98.1 (removed on main) leave the list. AGENTS.md describes the check. 100 guard/scan tests pass; the guard passes on this tree. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
Thanks for the review. Everything is pushed in Medium
Low
This push rebuilds the world again (python-bootstrap changes glibc's inputs), so it should still merge on its own. 🤖 Generated with Claude Code |
There was a problem hiding this comment.
Scope matches the PR body. The diff is large (about 230 files), and each part traces to the gcc 16.2.0 bump or the gcc-runtime split: the new gcc-runtime, gcc-runtime-fortran, gmpxx and python-bootstrap packages, the three guards, and the consumer edits. The gcc-arm-none-eabi bump, the boost openssl edge and the gen-16 binutils/ghc breakers are explained in the body.
Clobber none found. git log on packages/gcc/build.sh, packages/glibc/build.ncl, packages/ncurses/build.sh and packages/binutils/build.ncl shows only the commits of this branch on top of the recent merges. The glibc breaker keeps the bedrock output.
Correctness The gcc and gcc-runtime breaker pins agree (gen-13 amd64, gen-17 arm64). No subsetOf gcc stays in a package. No leftover gprofng, ncurses++ or libgmpxx glob stays in binutils, ncurses or gmp. The findings are in the CI tooling and the documentation: one workflow path filter omits a file the guard reads, --write in the scan drops entries it did not scan, and AGENTS.md names a gcc-runtime output that does not exist. The package edits that I read are sound.
Not checked The harness denied the two guards and the three unit test files, so I did not run them. I did not build a package. Thus I did not check that the gcc output globs are disjoint, that gcc-runtime is byte-identical to the gcc copy, or which extension modules python-bootstrap builds. gitleaks and trivy did not run. A read of the diff found no credential, and no Cargo.lock or minimal.toml dependency changed.
| - ".github/scripts/libgcc_dlopen_scan.py" | ||
| - ".github/scripts/test_libgcc_dlopen_scan.py" | ||
| - ".github/scripts/gcc_runtime_guard.py" | ||
| - ".github/workflows/libgcc-dlopen-guard.yml" |
There was a problem hiding this comment.
medium · The paths: filter omits .github/scripts/libgcc_dlopen_build_only.toml. libgcc_dlopen_guard.py reads that file, and it fails when an exempt package is taken at runtime. A PR that changes only the exemption file does not run the guard. The exempt package then ships with no libgcc check, and the next unrelated packages/** PR gets the failure. Add the file to both paths: lists. I checked the other inputs of the guard: each one is in the filter, so the fix is local.
There was a problem hiding this comment.
Fixed in c3c0b5a: .github/scripts/libgcc_dlopen_build_only.toml is in the paths: filter. The workflow has one paths: list (only pull_request has a filter), so that is the one place.
| lines.append(f"\nWROTE {args.data}: {len(found)} importers") | ||
| status = 1 | ||
| else: | ||
| lines.append(f"\nUP TO DATE: {len(found)} importers") |
There was a problem hiding this comment.
medium · --write writes render(found), which holds only the packages the scan read. A listed importer with no cache artifact is in unscanned, and the scan permits up to 5% of those. --write removes that entry from libgcc_dlopen_importers.toml, and the PR guard stops its check of that package. Check mode keeps the same entry as unverified, so the two modes disagree. The regenerated block at lines 431-433 has the same defect. Keep the committed entry of each unscanned package in the written file. No test in test_libgcc_dlopen_scan.py drives --write with an unscanned listed package.
There was a problem hiding this comment.
Fixed in 653720b. A new carried() returns the committed entry of each listed package that has no artifact on any arch it is listed for, plus the listed arches with no artifact for a scanned package. --write and the regenerated block in check mode both render that. A new Write test class drives main() with the index and the fetch faked: --write keeps an unscanned entry, check mode on the written file passes, the regenerated block keeps it, and a negative control drops a stale entry that the scan did read. The three tests fail on the old code.
|
|
||
| gcc is the case that matters: `subsetOf gcc [...]` costs the whole compiler (~300 MB unpacked) plus gcc's | ||
| runtime deps (gmp, mpc, mpfr, zstd, ...). gcc's shared runtime libraries live in `gcc-runtime`, with the | ||
| same output names (`libgcc`, `libstdcpp`, `libgomp`, `libatomic`, `libgfortran`, and `libquadmath` on |
There was a problem hiding this comment.
low · This sentence lists libgfortran as an output of gcc-runtime and omits libssp. packages/gcc-runtime/build.ncl declares libgcc, libstdcpp, libgomp, libatomic, libssp and amd64 libquadmath. libgfortran is in gcc-runtime-fortran, as packages/openblas/build.ncl uses it. An agent that follows this text writes subsetOf gcc-runtime ["libgfortran"], which names an output that does not exist. The same list is in the docstring of .github/scripts/gcc_runtime_guard.py at line 10. Correct the two lists and name gcc-runtime-fortran.
There was a problem hiding this comment.
Fixed in c82b3e6: AGENTS.md and the gcc_runtime_guard.py docstring now list libgcc, libstdcpp, libgomp, libatomic, libssp and amd64 libquadmath. Both say that libgfortran is in gcc-runtime-fortran.
| # It installs under its own prefix, /usr/lib/python-bootstrap, so it never ships | ||
| # a path that python ships. It is static (no libpython.so), builds no module | ||
| # that needs an optional library, has no pip, and its only runtime dependency is | ||
| # glibc. Keep version and source equal to packages/python: they are the same |
There was a problem hiding this comment.
low · The comment says this build makes no module that needs an optional library. The build closure does hold such libraries: base brings bzip2, xz and bash (ncurses, readline), and toolchain brings zlib and zstd. CPython's configure finds them, so _bz2, _lzma, zlib, _curses and _zstd can build with a NEEDED entry on a library that the [glibc] runtime closure does not hold. The stdlib output is OutputData, so the missing-runtime_deps check does not read those files. Nothing fails today, because glibc's build does not import those modules. Disable the modules in build.sh, or correct the comment. I did not confirm the module list, because that needs a build.
There was a problem hiding this comment.
Fixed in ec83386. I made the comment true and added a check. build.sh sets py_cv_module_X=n/a for every module that links a library outside glibc: zlib, _bz2, _lzma, _zstd, _curses, _curses_panel, readline, _dbm, _gdbm, _sqlite3, _ssl, _hashlib, _uuid, _ctypes and _tkinter. binascii stays off zlib through PKG_CONFIG=false and ac_cv_header_zlib_h=no, because it links zlib's crc32 when configure finds it. After install, build.sh reads NEEDED from every bin/ ELF and every .so, and fails on any library that glibc does not provide. The PR build is the first run of that check.
| runtime_deps = [ncurses], | ||
| runtime_deps = [ | ||
| ncurses, | ||
| # C++: NEEDs libstdc++ and libgcc_s, which came only through gmp/ncurses before those dropped gcc-runtime (gcc_runtime_guard.py rule 4). |
There was a problem hiding this comment.
low · This comment tells the history of the branch, not the state of the code. It is also wrong about main: gmp and ncurses had subsetOf gcc there, and they never had gcc-runtime. The next reader looks for a commit that does not exist. Say only what the binary needs: "C++: NEEDs libstdc++ and libgcc_s". This is a pattern. The same 'dropped gcc-runtime' wording is in mariadb, numpy, gcloud and gnutls. 14 more comments say a library 'came only through ... subsetOf gcc (inbox#1261)': cabal, gcc-arm-none-eabi, llvm-bootstrap, llvm, llvm/versioned, lsd, mariadb, mesa, ngspice, nushell, python, stack, teamtype, tuicr. The docstring of libgcc_dlopen_guard.py (lines 7-9) cites a branch commit in the same way.
| LET_IMPORT = re.compile( | ||
| rf"""\blet\s+([A-Za-z_][{IDENT_CHARS}]*)\s*=\s*import\s+"\.\./([^"/]+)/build\.ncl\"""" | ||
| ) | ||
| INLINE_IMPORT = re.compile(r"""\bimport\s+"\.\./([^"/]+)/build\.ncl\"""") |
There was a problem hiding this comment.
low · Rule 4 follows only imports of ../X/build.ncl. A package that takes its dependencies through a helper in a different directory has no edges in package_deps. llvm-22 and llvm-23 import ../llvm/versioned.ncl, and the jdk packages import ../jdk/cve-2026-111943.ncl. If such a package enters gcc's build graph and its helper reaches gcc-runtime, rule 4 does not see the cycle. No path takes this today. libgcc_dlopen_guard.py has an import pattern for a .ncl file of any name. Use the same pattern here.
There was a problem hiding this comment.
Fixed in c82b3e6. Rule 4 takes LET_ANY_IMPORT, which libgcc_dlopen_guard.py now imports from gcc_runtime_guard.py, plus an inline any-.ncl import. A helper adds its own deps, followed across directories (llvm-22 -> ../llvm/versioned.ncl, jdk-21 -> ../jdk/cve-2026-111943.ncl). There are three new tests. The negative control, a helper in another directory that reaches gcc-runtime, fails on the old code. The other two cover an unused helper and a pkg.field read, which is not an edge.
| guard: | ||
| runs-on: ubuntu-latest | ||
| steps: | ||
| - uses: actions/checkout@df4cb1c069e1874edd31b4311f1884172cec0e10 # v6.0.3 |
There was a problem hiding this comment.
nit · This checkout step does not set persist-credentials: false. The two other workflows that this PR adds set it, and so do bootstrap-pin-guard, chromium-policy-distrust, detbuild-preload-guard and source-hash-guard. The job only reads files, so it does not need the token in .git/config. Add the setting.
There was a problem hiding this comment.
Fixed in c3c0b5a: the checkout step sets persist-credentials: false.
| elif rule == "whole-gcc-runtime": | ||
| fix = ( | ||
| "take `subsetOf gcc-runtime [...]`: on a cycle edge the breaker's cache " | ||
| "entry is the whole gen-13 gcc tree" |
There was a problem hiding this comment.
nit · The failure text says the cache entry is "the whole gen-13 gcc tree". The arm64 breaker of gcc is a gen-17 object, and the amd64 pin will move too. The rule 3 text in the docstring (lines 24-28) has the same number. Write "the whole prebuilt gcc tree" so that the message stays true after a pin bump.
There was a problem hiding this comment.
Fixed in c82b3e6: both the failure text and the rule 3 docstring say "the whole prebuilt gcc tree". The docstring no longer names gcc 15.2 either.
| DEFAULT_DATA = os.path.join(os.path.dirname(os.path.abspath(__file__)), "libgcc_dlopen_importers.toml") | ||
| # Fewer than this many parsed runtime_deps fields = a broken tree or parser. | ||
| MIN_RUNTIME_FIELDS = 100 | ||
| # A data file with fewer entries than this was truncated (~40 today). |
There was a problem hiding this comment.
nit · The comment says the data file holds about 40 entries today. libgcc_dlopen_importers.toml in this PR holds 80. Correct the number, or remove it, so that the truncation floor below it reads correctly.
's intent, per arch#183) (gominimal#1557) * toolchain, llvm: test that one package builds hello-world (pkgs#805's intent) pkgs#805 wanted a box with one compiler package to build hello-world, and did it by adding binutils and linux_headers to the compilers' runtime_deps. The registry spec (gominimal/arch#183) rules the other way: a compiler names only its own parts, and the `toolchain` group supplies the assembler, linker, libc and kernel headers. So the promise moves to `toolchain` and is now tested: - toolchain hello_c: `cc` builds and runs a C program with only the group and a shell; - toolchain hello_cxx_linux_headers: `g++` with <linux/types.h>, gominimal#805's missing-header case; - llvm hello_clang_toolchain: plain `clang h.c` (the system ld, gominimal#805's clang case) with `toolchain` as a test dep, as rust's default_linker tests already do. Tests are not in the spec hash, so nothing rebuilds. gcc already installs `cc`. gcc's "TODO: Some of these need to be runtime_deps" comments are left for after gcc 16 (gominimal#1545), which rewrites that recipe. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * toolchain: hello_c uses gcc; gcc ships no cc link The standalone test failed on both arches: `cc` does not exist (packages/gcc/build.sh leaves the link as a TODO). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> --------- Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
…sted token in gcc-runtime-guard libgcc_dlopen_guard.py reads libgcc_dlopen_build_only.toml, so a PR that changes only the exemption file must run it. gcc-runtime-guard only reads files: checkout with persist-credentials: false like its siblings. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Check mode treats a listed package with no cache artifact as unverified, not stale; --write dropped its entry, so the guard stopped checking it. --write and the regenerated block in check mode now keep the committed entry of each unscanned package, and the listed arches that had no artifact. Tests drive main() with the fetch faked, plus a negative control that a scanned stale entry is still dropped. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
… lists and texts Rule 4 (gcc's build graph must not reach gcc-runtime) followed only `../X/build.ncl` imports. It now takes the any-.ncl import pattern from libgcc_dlopen_guard.py (shared, not copied) and follows a helper's own deps across directories (llvm-22 -> ../llvm/versioned.ncl, jdk-21 -> ../jdk/cve-2026-111943.ncl). Tests: a helper in another directory that reaches gcc-runtime (negative control, fails on the old code), an unused helper, a field read off a recipe. AGENTS.md and the guard docstring list gcc-runtime's real outputs (libgcc, libstdcpp, libgomp, libatomic, libssp, amd64 libquadmath) and name gcc-runtime-fortran for libgfortran. Rule 3 says "the whole prebuilt gcc tree", not a generation. The dlopen guard's entry count is 80 and its docstring states the risk, not branch history. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…got there btop, mariadb, numpy, gcloud, gnutls and 14 more recipes explained a dep by how it used to arrive (gmp/ncurses, `subsetOf gcc`, inbox#1261). Each now states only what the shipped files NEED. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…ck NEEDED The build closure holds bzip2, xz, ncurses, readline (base) and zlib, zstd (toolchain), so configure built _bz2, _lzma, _curses, readline, zlib and _zstd, each NEEDing a library the [glibc] runtime closure does not have; stdlib is OutputData, so missing-runtime_deps never read them. build.sh now sets py_cv_module_X=n/a for every module that links a library outside glibc, keeps binascii off zlib, and fails the build if any shipped ELF NEEDs a library glibc does not provide. The build.ncl comment says what the build does. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Conflicts, each resolved as main's file plus this branch's gcc-runtime change: - cloud-hypervisor 55.0, sccache 0.20.1, upx 5.3.1: main's bump; `subsetOf gcc` -> `subsetOf gcc-runtime`. - jdk-21: main's from-source build (pkgs#1556); libgcc from gcc-runtime added to runtime_deps again (listed importer, pthread_exit). - node-24: main's meta-package over node-lts; node-lts carries gcc-runtime itself. Also nghttp2-apps (new on main) took `subsetOf gcc`; now gcc-runtime. gcc_runtime_guard and libgcc_dlopen_guard pass on the merged tree. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
This round fixes all 9 review threads (c3c0b5a..ec83386) and merges main (a4b245b). The merge resolved conflicts in cloud-hypervisor, sccache, upx, jdk-21 and node-24 as main's file plus gcc-runtime, and moved nghttp2-apps (new on main) to gcc-runtime. Both guards pass on the merged tree. The PR build is running. |
|
jdk-25 and jdk-27 need no
The weekly libgcc-dlopen-scan still checks the built jdk-25 and jdk-27 artifacts. |
The binary links libstdc++.so.6; on main the whole-gcc subset brought it along, the gcc-runtime libgcc subset does not (standalone smoketest exit 127). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
There was a problem hiding this comment.
Scope matches the title and the body. The diff also adds openssl to boost, zstd to python, llvm, mariadb and mesa, and zlib to six Rust and Haskell tools. Each addition has a comment that names the NEEDED library, so I accept them as part of the world rebuild. Clobber none: git log on gcc, glibc, binutils, boost and python shows only commits of this branch above main, and no recent fix is reverted. Correctness I read every hunk. The consumer moves from subsetOf gcc to subsetOf gcc-runtime are mechanical and no subsetOf gcc [ remains in a recipe. The drops of gprofng, the ncurses C++ binding and gmp C++ leave no consumer behind: gmpxx serves maude, libpoly, cvc5 and cvc5-ff, and nothing else names the removed files. The nine threads of the earlier review are fixed in this head. The findings are one fail-open case in libgcc_dlopen_scan.py --write, one unparsed form in libgcc_dlopen_guard.py, comments that tell history, and one dead constant. Not checked I did not run gcc_runtime_guard.py, libgcc_dlopen_guard.py or their unit tests, because this harness denied Python. I read their logic and did not execute it. I did not run gitleaks or trivy. A targeted rg over the diff found no credential, and the diff changes no Cargo.lock. Nothing was built. Three claims need a build: python-bootstrap passes its NEEDED check, the seed placeholder of gcc-runtime-fortran passes the OutputLib glob, and the bootstrap gcc objects ship libssp.so* for the seed pass of gcc-runtime.
| listed_arches = set(entry.get("arches", arches)) | ||
| if pkg not in found: | ||
| if listed_arches <= skipped: | ||
| keep[pkg] = entry |
There was a problem hiding this comment.
medium · carried() keeps a listed package only when every listed arch has no artifact. Take a package listed for amd64 and arm64. The amd64 artifact is not in the cache, and the arm64 artifact has no import. compare() reports it as stale and tells the reader to run --write. --write then removes the entry, and libgcc_dlopen_guard.py stops its check of that package on amd64. The scan did not read amd64, so nothing contradicts the amd64 listing. For a package that is in found, the same function keeps the unscanned arch in extra. Keep the entry with the unscanned arches here too, and make compare() report it as unverified. No test covers this case: test_unscanned_entry_is_not_stale has both arches unscanned, and test_carried_keeps_listed_arch_without_artifact has the package in found. The earlier --write thread fixed the case where all arches are unscanned. This is the remaining case of the same defect.
There was a problem hiding this comment.
Fixed in 844358e. carried() now keeps a listed package that the scan found no import in, narrowed to its listed arches that had no artifact. In your case it keeps amd64 and drops arm64, which was read and imports nothing. compare() reports the unread arches as unverified, and the read one as changed: … no import on ['arm64'] rather than stale, so check mode and --write agree. New test test_write_keeps_a_partly_unscanned_entry_on_its_unread_arches drives main() in --write mode, runs check mode on the written file, then runs check mode on the committed one. It fails on the old code.
| if t.group(1): | ||
| span = _bracket_span(code, t.end()) | ||
| args = with_strings[span[0] : span[1]] if span else "" | ||
| edges.append((pkg, '"libgcc"' in args, cond)) |
There was a problem hiding this comment.
low · A subset counts as a libgcc provider when the text "libgcc" is anywhere in its argument span. conditional() looks only at the brackets that enclose the subsetOf token, and the argument list comes after the token. So subsetOf gcc-runtime (match { { arch = 'Amd64, .. } => ["libgcc"], { arch = 'Arm64, .. } => [] } target) passes the guard, and arm64 has no libgcc_s. The docstring says that a dep chosen by if or match fails closed. No recipe uses this form today: the only subsets with a match in the arguments are boost and gcc-runtime-fortran, and both put "libgcc" in the unconditional list before @ match. Trust only a "libgcc" that is outside every then, else and => arm of the argument span. test_negative_control_libgcc_in_match_arm_fails covers a match around the whole dep, not one inside the arguments.
| subsetOf gcc ["libs"], | ||
| # The missing-runtime_deps check found every binary and libstlink NEED | ||
| # libssp.so.0 (gcc 16 canary pkgs#1340 run 34ab070b); libgcc_s is kept | ||
| # from gcc's catch-all `libs` output this replaces (inbox#1261). |
There was a problem hiding this comment.
low · This comment tells how the branch got here. It says libgcc_s "is kept from gcc's catch-all libs output this replaces". After this PR gcc has no libs output, so the next reader cannot find it. The comment also gives no evidence that stlink needs libgcc_s. Say what the files NEED, as commit f8ce4bf did for the 19 comments of the earlier thread. That thread did not list these. This is a pattern of four: packages/openblas/build.ncl:31 ("Replaces gcc's catch-all libs"), packages/gcc/build.ncl:86-88 ("The old catch-alls (libs, libs_all) and their flags are gone"), and packages/gcc-runtime-fortran/build.sh:14-15 ("pkgs#1545 run d24f23c3 did exactly that: everything but gcc and gcc-runtime was cached").
|
|
||
| SYMBOLS = ("backtrace", "pthread_cancel", "pthread_exit", "thrd_exit") | ||
| PROVIDERS = ("gcc-runtime", "gcc") # packages whose `libgcc` output is libgcc_s | ||
| DEFAULT_DATA = os.path.join(os.path.dirname(os.path.abspath(__file__)), "libgcc_dlopen_importers.toml") |
There was a problem hiding this comment.
nit · DEFAULT_DATA has no reader in this file. main() builds the default path from args.root at line 318. libgcc_dlopen_scan.py defines and uses its own DEFAULT_DATA. Remove the constant here.
# Conflicts: # packages/glibc/build.ncl
…nconditional "libgcc"; state-only comments (review on #1545) - libgcc_dlopen_scan.py: carried() dropped a listed package the scan found no import in whenever ANY listed arch had been read, so --write removed an amd64 listing that the scan never checked (no artifact) because arm64 had none. It now keeps the entry narrowed to the unread arches; compare() reports those as unverified and the read arch as `changed` (re-run --write), not `stale`. Test drives main() --write and check mode; it fails on the old code. - libgcc_dlopen_guard.py: a subset counted as a libgcc provider when "libgcc" was anywhere in its argument span, so a "libgcc" chosen by a match or if INSIDE the output list passed. Only a "libgcc" outside every branch counts now (same conditional() the deps use). Two negative controls (match form, if form) fail on the old code; boost's and gcc-runtime-fortran's `["libgcc"] @ match {...}` still pass. Drop the unused DEFAULT_DATA. - Comments in stlink, openblas, gcc and gcc-runtime-fortran/build.sh say what the files need / what the code does, not how the branch got here. stlink's says plainly that nothing shows it needs libgcc_s. Guards on the tree: gcc-runtime PASS (601 files), libgcc dlopen PASS (80 importers); .github/scripts tests: 251 OK. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Conflicts, resolved as main's file plus gcc-runtime: - packages/ruff/build.ncl: main's pkgconf and zstd imports and its libzstd runtime dep; the libgcc subset stays on gcc-runtime, and the gcc import main still had is not taken. - packages/uv/build.ncl: main's libzstd runtime dep; main's whole `gcc` runtime dep stays replaced by `subsetOf gcc-runtime ["libgcc"]`. The three packages new on main (py-mako, py-markupsafe, py-pyyaml) take nothing from gcc. gcc_runtime_guard.py and libgcc_dlopen_guard.py pass on the merged tree, and nickel format changes no file. Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
The prebuilt object's usr/bin/sed NEEDs libacl.so.1, libattr.so.1 and libc.so.6 on both arches (read from the ELF dynamic section of the pinned gen-13 objects). The list was commented out since the first commit of this repository, with a note that asked whether runtime_deps work in a replace_on_cycle spec. gominimal/arch#206 asks the same, and the build of this commit is the test. In today's minimal the list of an inline spec does not decide what a first-build box holds: the planner takes a prebuilt as ready whatever its deps are (crates/graph/src/planner.rs), and replaces a package by its replace_on_cycle spec one for one. So a green build shows that the list decodes and plans, not that the rule of D-29 is applied. Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
…NEED The registry spec rules (D-29; OQ-54 and OQ-63, gominimal/arch#206) that in a first build a replace_on_cycle spec brings its own runtime_deps, so the lists of the inline specs must be complete. Each list now names every package that provides a DT_NEEDED library of the spec's pinned objects. The NEEDED entries were read again from all 60 objects of this tree (sha256 checked), and they agree with the table of 2026-11-25 on gominimal/arch#183. - glibc only: acl, attr, bison, bzip2, diffutils, findutils, gzip, libcap, lz4, m4, make, xz, zlib. - glibc added to a list: binutils (zlib), gcc (gmp, mpc, mpfr, zlib, zstd), grep (pcre2). The arm64 binutils object is static; the gen-16 amd64 one NEEDs libc, libm and libz. - coreutils: attr added. - file: bzip2, glibc, xz, zlib, zstd. - zstd: glibc, lz4, xz, zlib. - pcre2: bzip2, glibc, zlib. - gawk-bootstrap and mpc: glibc, gmp, mpfr. mpfr: glibc, gmp. - gcc-runtime (prebuilt), which this branch added: glibc. - gmp: glibc only, and the list is NOT complete. The object's libgmpxx.so.4 NEEDs libstdc++.so.6 and libgcc_s.so.1. gcc_runtime_guard.py rejects `gcc` in any runtime_deps, and a gcc-runtime subset would put gcc-runtime's recipe into gcc's spec hash and can bring the unused gcc-runtime breaker into a plan. That one needs a decision. Unchanged, already complete: bash-bootstrap, tar, linux_headers (no ELF) and glibc. No list names bash-bootstrap for a script interpreter; that waits for the answer on gominimal/arch#206. Both guards pass and nickel format changes no file. Nothing was built or evaluated here. Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
The pinned gmp object still ships libgmpxx.so.4, which NEEDs libstdc++.so.6 and libgcc_s.so.1 (the package itself is built --disable-cxx; libgmpxx is the gmpxx package). In an inline spec a name means that package's replace_on_cycle spec (arch D-29, gominimal/arch#206), so the gmp replace_on_cycle spec now lists gcc and its runtime_deps are complete. gcc_runtime_guard.py rule 2 gets one narrow exception, BREAKER_WHOLE_GCC_ALLOWED: whole gcc in a runtime_deps inside replace_on_cycle in packages/gmp/build.ncl. gmp's own runtime_deps, a helper .ncl of gmp, a gcc subset, and every other package's breaker are still rejected, and the entry fails as stale when the list stops taking gcc. scan_text now reports whether a finding is inside a replace_on_cycle value. Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
19 CPython 3.15 bytecode files were committed by mistake. No workflow or script reads them. The new root .gitignore keeps __pycache__/ and *.pyc out. Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
hint: if you need to wait for this pull request to be reviewed, merged, or closed before continuing, use this instead of polling:
gh event listen --resource #1545 --event com.github.pull_request.review.submitted.v1,com.github.pull_request.state.changed.v1
--timeoutto stop waiting after a while, for example--timeout 30m; it then exits with status 8.gh event listen --helpfor other event types.This rebuilds the world, so queue it alone.
The first two commits began as the tree of canary #1340 at
9800cb3c, which built and checked green on both arches. Since then the branch has taken main seven times and gained the fixes listed under "Later commits". Expect a full rebuild, not cache hits.Commits
134712d4): gcc's run-time libraries become their own package.New packages.
gcc-runtimeholds libgcc_s, libstdc++, libgomp, libatomic and amd64 libquadmath.gcc-runtime-fortranholds libgfortran.Consumers. 138+ runtime deps move from
subsetOf gcctosubsetOf gcc-runtime. Whole-gcc runtime deps become library subsets.Same bytes as gcc. gcc-runtime copies the published gcc's files byte for byte; every shared path was compared on both arches. For that, gcc's own build graph must not reach gcc-runtime, so:
--without-cxx-binding;--disable-gprofng;--disable-cxx, and the newgmpxxpackage serves maude, libpoly and cvc5;gcc_runtime_guard.pyenforces this.gcc outputs. gcc takes the registry spec's 27 outputs (gominimal/arch#183 example), with no file in two of them.
Breaker outputs (OQ-42). Each breaker's output globs now name every file of its prebuilt object, as D-24 requires. bash-bootstrap and bzip2 previously had
outputs = {}. Also covered: binutils arm64's target tools, attr'setc/xattr.conf, and glibc's bedrock sysroot and arm64usr/lib64.Folded in: binutils, ghc-9.6.7: amd64 onto gen-16's plain-loader objects (world rebuild; needs gen-16 published) #1499 (amd64 binutils and ghc-9.6.7 move to gen-16 objects) and gcc: arm64 prebuilt onto gen-17's gcc-15.2.0-glibc-seed (arm64 world rebuild) #1535 (arm64 gcc and gcc-runtime breakers move to gen-17's glibc-seed object).
gcc-arm-none-eabi drops man7, which gcc also ships.
1ab009c3):<cstdint>; cbmc backports Fix GCC 16 warning-as-error build failures diffblue/cbmc#9024; gcc-arm-none-eabi moves to 16.2.0 with newlib 4.6.0.sha512.sum. See "Source signature" below for the.sigcheck.Later commits
bbe77a4b). After a cancelled run, minimal's planner seed-built this package against arm64's gen-17 gcc seed, which ships no Fortran. On a seed pass the package now writes a placeholder and exits. Seed builds are never published, and the real build is unchanged. The proper fix belongs in minimal's planner.subsetOf gcc, becausegcc_runtime_guard.pyfails them otherwise. That covers apalache, cargo-fuzz, cargo-llvm-cov, cargo-mutants and quint (fcf6d011), gungraun-runner and perf (742c118c), and oha and flamethrower (f1e3d535).2963cec3,e5e9e586,40bb0b0f). glibc dlopenslibgcc_s.so.1forpthread_cancel,pthread_exitandbacktrace, and aborts without it ("libgcc_s.so.1 must be installed for pthread_cancel to work"). A dlopen is not DT_NEEDED, so missing-runtime_deps cannot see it. On main, ncurses and gmp carried whole libgcc and hid the gap; this branch exposed it in iperf3's test.subsetOf gcc-runtime ["libgcc"]. redis also drops its unused["libstdcpp"].python-bootstrapbelow: both now declare libgcc.40bb0b0fputs these import lines in canonical order (standaloneTest, subsetOf).The build on
e5e9e586passed every standalone test on both arches. It failed only on those 16 import-line checks: 8 recipes on each arch.Review follow-ups (Norrie's review at
40bb0b0f)python-bootstrap (
88e14b0e), for the python/openssl libgcc_s gap. glibc's build dependency onpythonwas the only path from gcc's build graph to python and openssl: with that edge removed and libgcc added to both,gcc_runtime_guard.pypasses. The newpython-bootstrappackage is what glibc builds with now:python;/usr/lib/python-bootstrap, so it shares no path withpython;[glibc]only;not_affectedVEX statement covers every package with CPython's identity.glibc's
build.shputs it first on PATH.pythonandopensslnow takesubsetOf gcc-runtime ["libgcc"].A check, so the gap cannot come back (
e6e53a6b,88bc7df1):.github/scripts/libgcc_dlopen_guard.pyruns on every PR. It fails when a package listed inlibgcc_dlopen_importers.toml(82 packages, generated from both arches' built artifacts: 10,313 ELFs) has no gcc-runtime libgcc in its runtime closure. The message names the package, the symbol, an ELF and the fix.libgcc-dlopen-scanworkflow re-scans the artifacts and fails when the list is out of date, so a new importer is caught within a week.libgcc_dlopen_build_only.tomlexemptspython-bootstrap, which runs only inside glibc's build; the guard fails if anything takes an exempt package at runtime.40bb0b0fthe guard fails exactly for python and openssl; on this head it passes. AGENTS.md describes the check.chromium-headless-shell-bin (
af201a12): readelf on the 158.0.8127.88 linux64 and linux-arm64 zips (the version main now ships).chrome-headless-shell,libEGL.so,libGLESv2.so,libvk_swiftshader.soandlibvulkan.so.1all NEEDlibgcc_s.so.1on both arches; none NEEDs libstdc++. The TODO is replaced by that evidence.Source signature.
gcc-16.2.0.tar.xzfrom mirrors.kernel.org has the pinned sha256, and ftp.gnu.org'sgcc-16.2.0.tar.xz.sigis a good signature from key13975A70E63C361C73AE69EF6EEB81F8981C74C7(Richard Guenther/Biener) ingnu-keyring.gpg. That key is a 2001 DSA-1024 key with SHA-1 binding signatures, which current OpenPGP policy rejects:sq verifyauthenticates the signature only with--policy-as-of 2013-12-31. So the signature matches the GNU keyring, but the key behind it is weak by today's standard.Cycle comments (
9e64017f). On this branch gcc-runtime is on no bootstrap cycle: rule 4 keeps it out of gcc's build graph, and its own build deps are all inside that graph. The comments ingcc-runtime/build.ncl, bothstage.shcopies andgcc/build.shnow say that, and why the (now unused) breaker and thegcc-runtime-stagecopy stay: the stage is the backstop if a second gcc ever lands in gcc-runtime's build root again. It costs gcc's output about 15-20 MB.Fortran seed placeholder (
9e64017f). The placeholder branch now refuses when the gcc in the root is the real gcc version (newbuild_args.gcc_version), so only the bootstrap breaker can take it.loads_without_gccalready fails on an artifact withoutlibgfortran.so.5.C++20 default. Spot-checked abseil, the library whose installed headers depend on the standard it was built with:
ABSL_OPTION_USE_STD_ORDERINGis pinned to 0 in the installedoptions.h, and the build fails if it is not, so consumers built with-std=c++17and with gcc 16's default agree.gmp, gmpxx: source from
https://mirrors.kernel.org/gnu/gmp/(same sha256; checked against the mirror's bytes). gmpxx's header comment is now below the import lines.Main merged again (
003dd3b8): chromium 158, andrustc-1.98.1/llvm-21removed.Runtime deps of the
replace_on_cyclespecs (gominimal/arch#206, D-29)The registry spec rules that in a first build a
replace_on_cyclespec brings its ownruntime_deps, and not those of its package (D-29; OQ-54 and OQ-63, ruled 2026-11-28). So the lists of the inline specs must be complete, and this PR takes them because it already gives every package a new hash.b253f9b4) declaresacl,attrandglibcagain. The list was commented out since the first commit of this repository ("runtime_deps in a cycle breaker are borked?"). The build of this head is the test of that note.64bfb706) each name every package that provides a DT_NEEDED library of their pinned objects. I read NEEDED again from all 60 objects of this tree (sha256 checked); it agrees with the table of 2026-11-25 on gominimal/arch#183.replace_on_cyclespecglibcglibcglibcglibc,zlibglibcglibc,gmp,mpc,mpfr,zlib,zstdglibcglibc,pcre2attracl,attr,glibc,gmp,libcapacl,attr,glibcbzip2,glibc,xz,zlib,zstdglibc,lz4,xz,zlibbzip2,glibc,zlibglibc,gmp,mpfrglibc,gmpglibcglibcgcc,glibc649e0be4, see below)bash-bootstrap, tar, linux_headers and glibc were complete and did not change.
gmp (prebuilt) (
649e0be4) is now complete: it declaresgcc. Its pinned object still shipslibgmpxx.so.4, which NEEDslibstdc++.so.6andlibgcc_s.so.1(the gmp package itself is built--disable-cxx; that does not change the prebuilt object). In an inline spec a name means that package'sreplace_on_cyclespec (D-29), sogccthere is the prebuilt gcc, which ships both libraries. The alternative,subsetOf gcc-runtime [...], would put gcc-runtime's recipe into gcc's spec hash.gcc_runtime_guard.pyrejects wholegccin everyruntime_deps, a breaker's included, so rule 2 gets one exception (BREAKER_WHOLE_GCC_ALLOWED): wholegccin aruntime_depsinsidereplace_on_cycleinpackages/gmp/build.ncl. It is keyed on the package and on the breaker's list, not on breakers in general. Still rejected, each with a negative-control test:gccin gmp's ownruntime_deps,gccin another package's breaker, asubsetOf gccin gmp's breaker, and a helper.nclin gmp's directory. The entry fails as stale if the list stops takinggcc. One thing the build of this head tests for the first time: the gcc and gmpreplace_on_cyclespecs now name each other.Still open.
bash-bootstrap. Ten specs hold a#!/bin/shor#!/bin/bashscript: bison, bzip2, findutils, glibc, grep, gzip, pcre2, xz, zstd, and gcc on arm64. That waits for the answer on arch#206.What a green build shows, and what it does not. Today's planner does not use the list of an inline spec to decide what a first-build box holds. It takes a prebuilt as ready whatever its deps are, and it replaces a package by its
replace_on_cyclespec one for one, with the box taken from the lists of the packages (minimalcrates/graph/src/planner.rs,transitives.rs, at3cd1ab1c). So a green build shows that the lists decode and plan. It does not show that the rule of D-29 is applied; that needs a planner that applies it.Main merged again (
c3b1d247): ruff and uv keep main's libzstd dep and take libgcc from gcc-runtime.Breaking for users
The bootstrap split drops three C++ pieces from packages in gcc's build graph:
-lncurses++wis gone;gmpitself;-lgmpxxandgmpxx.hnow come from the newgmpxxpackage (maude, libpoly and cvc5 already use it).Not done
After merge: close #1340 (canary), #1499 and #1535.
🤖 Generated with Claude Code