8000 gcc 15.2.0 → 16.2.0, with gcc-runtime split out (pm#1182) by bryan-minimal · Pull Request #1545 · gominimal/pkgs · GitHub
[go: up one dir, main page]

Skip to content

gcc 15.2.0 → 16.2.0, with gcc-runtime split out (pm#1182) - #1545

Open
bryan-minimal wants to merge 38 commits into
mainfrom
gcc-16
Open

bryan-minimal wants to merge 38 commits into
mainfrom
gcc-16

Conversation

@bryan-minimal
@bryan-minimal bryan-minimal commented Nov 17, 2026 •
Copy link
Copy Markdown
Member

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

  • It prints the first event as a JSON line on stdout and exits; run it again to wait for the next one.
  • Add --timeout to stop waiting after a while, for example --timeout 30m; it then exits with status 8.
  • Events carry no details; read the pull request to see what changed.
  • It misses changes made before it starts, so read the pull request once it is running.
  • See gh event listen --help for other event types.
  • Event subscriptions are in preview and may not be enabled for your account.
    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

  1. gcc-runtime (134712d4): gcc's run-time libraries become their own package.
    • New packages. gcc-runtime holds libgcc_s, libstdc++, libgomp, libatomic and amd64 libquadmath. gcc-runtime-fortran holds libgfortran.

    • Consumers. 138+ runtime deps move from subsetOf gcc to subsetOf 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:

      • ncurses is built --without-cxx-binding;
      • binutils is built --disable-gprofng;
      • gmp is built --disable-cxx, and the new gmpxx package serves maude, libpoly and cvc5;
      • seven packages that got libstdc++ only through gmp or ncurses now declare gcc-runtime.

      gcc_runtime_guard.py enforces 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's etc/xattr.conf, and glibc's bedrock sysroot and arm64 usr/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.

  2. gcc 16.2.0 (1ab009c3):
    • The glibc 2.43 libgomp workaround goes away.
    • Fixes from the canary's build failures: abseil-cpp builds as C++17; foundationdb includes <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.
    • Source: the upstream https URL (arch#183 model §6.1). Its sha256 matches ftp.gnu.org's copy, and its sha512 matches gcc.gnu.org's sha512.sum. See "Source signature" below for the .sig check.

Later commits

  • gcc-runtime-fortran seed pass (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.
  • Packages main gained since the branch take gcc-runtime instead of subsetOf gcc, because gcc_runtime_guard.py fails 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).
  • libgcc_s for glibc's dlopen (2963cec3, e5e9e586, 40bb0b0f). glibc dlopens libgcc_s.so.1 for pthread_cancel, pthread_exit and backtrace, 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.
    • I scanned both arches' build artifacts for undefined imports of those symbols in every package whose runtime closure lacked libgcc. iperf3 and 27 more packages now declare subsetOf gcc-runtime ["libgcc"]. redis also drops its unused ["libstdcpp"].
    • python and openssl were the two left out, because gcc's build graph reached them (gcc → glibc → python → openssl). See python-bootstrap below: both now declare libgcc.
    • 40bb0b0f puts these import lines in canonical order (standaloneTest, subsetOf).

The build on e5e9e586 passed 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 on python was the only path from gcc's build graph to python and openssl: with that edge removed and libgcc added to both, gcc_runtime_guard.py passes. The new python-bootstrap package is what glibc builds with now:

    • the same CPython 3.14.10 source and sha256 as python;
    • static (no libpython.so), installed under /usr/lib/python-bootstrap, so it shares no path with python;
    • no pip, no test modules, and no module that needs an optional library; runtime deps are [glibc] only;
    • it carries python's gh-143923 patch, because the CVE-2025-15367 not_affected VEX statement covers every package with CPython's identity.

    glibc's build.sh puts it first on PATH. python and openssl now take subsetOf gcc-runtime ["libgcc"].

  • A check, so the gap cannot come back (e6e53a6b, 88bc7df1):

    • .github/scripts/libgcc_dlopen_guard.py runs on every PR. It fails when a package listed in libgcc_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.
    • The weekly libgcc-dlopen-scan workflow 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.toml exempts python-bootstrap, which runs only inside glibc's build; the guard fails if anything takes an exempt package at runtime.
    • The guard and the scan have 50 unit tests with negative controls. On 40bb0b0f the 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.so and libvulkan.so.1 all NEED libgcc_s.so.1 on both arches; none NEEDs libstdc++. The TODO is replaced by that evidence.

  • Source signature. gcc-16.2.0.tar.xz from mirrors.kernel.org has the pinned sha256, and ftp.gnu.org's gcc-16.2.0.tar.xz.sig is a good signature from key 13975A70E63C361C73AE69EF6EEB81F8981C74C7 (Richard Guenther/Biener) in gnu-keyring.gpg. That key is a 2001 DSA-1024 key with SHA-1 binding signatures, which current OpenPGP policy rejects: sq verify authenticates 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 in gcc-runtime/build.ncl, both stage.sh copies and gcc/build.sh now say that, and why the (now unused) breaker and the gcc-runtime-stage copy 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 (new build_args.gcc_version), so only the bootstrap breaker can take it. loads_without_gcc already fails on an artifact without libgfortran.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_ORDERING is pinned to 0 in the installed options.h, and the build fails if it is not, so consumers built with -std=c++17 and 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, and rustc-1.98.1/llvm-21 removed.

Runtime deps of the replace_on_cycle specs (gominimal/arch#206, D-29)

The registry spec rules that in a first build a replace_on_cycle spec brings its own runtime_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.

  • sed (prebuilt) (b253f9b4) declares acl, attr and glibc again. 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.
  • The other inline specs (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_cycle spec added list now
acl, attr, bison, bzip2, diffutils, findutils, gzip, libcap, lz4, m4, make, xz, zlib glibc glibc
binutils glibc glibc, zlib
gcc glibc glibc, gmp, mpc, mpfr, zlib, zstd
grep glibc glibc, pcre2
coreutils attr acl, attr, glibc, gmp, libcap
sed acl, attr, glibc the same
file bzip2, glibc, xz, zlib, zstd the same
zstd glibc, lz4, xz, zlib the same
pcre2 bzip2, glibc, zlib the same
gawk-bootstrap, mpc glibc, gmp, mpfr the same
mpfr glibc, gmp the same
gcc-runtime (new on this branch) glibc glibc
gmp gcc, glibc the same (649e0be4, see below)

bash-bootstrap, tar, linux_headers and glibc were complete and did not change.

gmp (prebuilt) (649e0be4) is now complete: it declares gcc. Its pinned object still ships libgmpxx.so.4, which NEEDs libstdc++.so.6 and libgcc_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's replace_on_cycle spec (D-29), so gcc there 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.py rejects whole gcc in every runtime_deps, a breaker's included, so rule 2 gets one exception (BREAKER_WHOLE_GCC_ALLOWED): whole gcc in a runtime_deps inside replace_on_cycle in packages/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: gcc in gmp's own runtime_deps, gcc in another package's breaker, a subsetOf gcc in gmp's breaker, and a helper .ncl in gmp's directory. The entry fails as stale if the list stops taking gcc. One thing the build of this head tests for the first time: the gcc and gmp replace_on_cycle specs now name each other.

Still open.

  • Script interpreters. No list names bash-bootstrap. Ten specs hold a #!/bin/sh or #!/bin/bash script: 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_cycle spec one for one, with the box taken from the lists of the packages (minimal crates/graph/src/planner.rs, transitives.rs, at 3cd1ab1c). 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:

  • ncurses: no C++ binding, so -lncurses++w is gone;
  • binutils: no gprofng;
  • gmp: no C++ interface in gmp itself; -lgmpxx and gmpxx.h now come from the new gmpxx package (maude, libpoly and cvc5 already use it).

Not done

  • No package was built twice to compare outputs byte for byte. The build on this head is the first build of python-bootstrap.

After merge: close #1340 (canary), #1499 and #1535.

🤖 Generated with Claude Code

bryan-minimal and others added 2 commits November 17, 2026 02:25
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>
@bryan-minimal
bryan-minimal requested a review from a team as a code owner November 17, 2026 18:10
@coderabbitai
coderabbitai Bot commented Nov 17, 2026 •
Copy link
Copy Markdown
Contributor

Warning

Review limit reached

  • Run on-demand review

This review includes 149 billable files and costs up to $37.25.

View limit details

Learn how review limits work.

Review configuration:

Run configuration

Commits

Reviewing files that changed from the base of the PR and between 359f319 and 11cfc32.

Files selected for processing: 249

  • .github/scripts/gcc_runtime_guard.py
  • .github/scripts/libgcc_dlopen_build_only.toml
  • .github/scripts/libgcc_dlopen_guard.py
  • .github/scripts/libgcc_dlopen_importers.toml
  • .github/scripts/libgcc_dlopen_scan.py
  • .github/scripts/test_gcc_runtime_guard.py
  • .github/scripts/test_libgcc_dlopen_guard.py
  • .github/scripts/test_libgcc_dlopen_scan.py
  • .github/workflows/gcc-runtime-guard.yml
  • .github/workflows/libgcc-dlopen-guard.yml
  • .github/workflows/libgcc-dlopen-scan.yml
  • .gitignore
  • AGENTS.md
  • packages/abseil-cpp/build.ncl
  • packages/abseil-cpp/build.sh
  • packages/acl/build.ncl
  • packages/alex/build.ncl
  • packages/apalache/build.ncl
  • packages/ast-grep/build.ncl
  • packages/attr/build.ncl
  • packages/atuin/build.ncl
  • packages/bandwhich/build.ncl
  • packages/bash-bootstrap/build.ncl
  • packages/bat/build.ncl
  • packages/bdwgc/build.ncl
  • packages/biff/build.ncl
  • packages/binaryen/build.ncl
  • packages/bindgen/build.ncl
  • packages/binutils-arm-none-eabi/build.ncl
  • packages/binutils/build.ncl
  • packages/binutils/build.sh
  • packages/biome/build.ncl
  • packages/bison/build.ncl
  • packages/boost/build.ncl
  • packages/bottom/build.ncl
  • packages/broot/build.ncl
  • packages/btop/build.ncl
  • packages/buddy/build.ncl
  • packages/bun/build.ncl
  • packages/bzip2/build.ncl
  • packages/bzip3/build.ncl
  • packages/cabal/build.ncl
  • packages/cadical/build.ncl
  • packages/cargo-fuzz/build.ncl
  • packages/cargo-llvm-cov/build.ncl
  • packages/cargo-mutants/build.ncl
  • packages/cargo-nextest/build.ncl
  • packages/cbmc/build.ncl
  • packages/cbmc/build.sh
  • packages/cbmc/gcc16-warnings.patch
  • packages/charon/build.ncl
  • packages/chromedriver-bin/build.ncl
  • packages/chromium-headless-shell-bin/build.ncl
  • packages/clipper2/build.ncl
  • packages/cloud-hypervisor/build.ncl
  • packages/cmake/build.ncl
  • packages/codex/build.ncl
  • packages/coreutils/build.ncl
  • packages/cups/build.ncl
  • packages/cvc5-ff/build.ncl
  • packages/cvc5/build.ncl
  • packages/delta/build.ncl
  • packages/deno/build.ncl
  • packages/difftastic/build.ncl
  • packages/diffutils/build.ncl
  • packages/dnsutils/build.ncl
  • packages/drift/build.ncl
  • packages/dua/build.ncl
  • packages/dust/build.ncl
  • packages/e2fsprogs/build.ncl
  • packages/elfutils/build.ncl
  • packages/emacs/build.ncl
  • packages/eza/build.ncl
  • packages/fd/build.ncl
  • packages/file/build.ncl
  • packages/findutils/build.ncl
  • packages/fish/build.ncl
  • packages/flamethrower/build.ncl
  • packages/foundationdb/build.ncl
  • packages/foundationdb/build.sh
  • packages/gawk-bootstrap/build.ncl
  • packages/gcc-arm-none-eabi/build.ncl
  • packages/gcc-arm-none-eabi/build.sh
  • packages/gcc-runtime-fortran/build.ncl
  • packages/gcc-runtime-fortran/build.sh
  • packages/gcc-runtime-fortran/stage.sh
  • packages/gcc-runtime/build.ncl
  • packages/gcc-runtime/build.sh
  • packages/gcc-runtime/stage.sh
  • packages/gcc/build.ncl
  • packages/gcc/build.sh
  • packages/gcloud/build.ncl
  • packages/gdb/build.ncl
  • packages/gettext/build.ncl
  • packages/ghc-9.6.7/build.ncl
  • packages/ghc-bootstrap/build.ncl
  • packages/ghidra/build.ncl
  • packages/ghostscript/build.ncl
  • packages/git/build.ncl
  • packages/glib/build.ncl
  • packages/glibc/build.ncl
  • packages/glibc/build.sh
  • packages/gmp/build.ncl
  • packages/gmp/build.sh
  • packages/gmpxx/build.ncl
  • packages/gmpxx/build.sh
  • packages/gn/build.ncl
  • packages/gnutls/build.ncl
  • packages/gperf/build.ncl
  • packages/graphviz/build.ncl
  • packages/grep/build.ncl
  • packages/groff/build.ncl
  • packages/grpc/build.ncl
  • packages/gtest/build.ncl
  • packages/guile/build.ncl
  • packages/gungraun-runner/build.ncl
  • packages/gurk/build.ncl
  • packages/gws/build.ncl
  • packages/gzip/build.ncl
  • packages/happy/build.ncl
  • packages/haskell-language-server/build.ncl
  • packages/helix-grammars/build.ncl
  • packages/helix/build.ncl
  • packages/hex-patch/build.ncl
  • packages/hexhog/build.ncl
  • packages/hexyl/build.ncl
  • packages/htop/build.ncl
  • packages/hyperfine/build.ncl
  • packages/icu/build.ncl
  • packages/imgcatr/build.ncl
  • packages/iperf3/build.ncl
  • packages/jaq/build.ncl
  • packages/jdk-21/build.ncl
  • packages/jemalloc/build.ncl
  • packages/jnv/build.ncl
  • packages/jsoncpp/build.ncl
  • packages/jsongrep/build.ncl
  • packages/just/build.ncl
  • packages/kani/build.ncl
  • packages/kittyview/build.ncl
  • packages/lean/build.ncl
  • packages/leangz/build.ncl
  • packages/libcap/build.ncl
  • packages/libfuse/build.ncl
  • packages/libgd/build.ncl
  • packages/libglvnd/build.ncl
  • packages/libkrun/build.ncl
  • packages/libpoly/build.ncl
  • packages/liburcu/build.ncl
  • packages/libvips/build.ncl
  • packages/libvmaf/build.ncl
  • packages/libvpx/build.ncl
  • packages/libx265/build.ncl
  • packages/lief/build.ncl
  • packages/llama.cpp/build.ncl
  • packages/llvm-bootstrap/build.ncl
  • packages/llvm/build.ncl
  • packages/llvm/versioned.ncl
  • packages/lsd/build.ncl
  • packages/luajit/build.ncl
  • packages/lz4/build.ncl
  • packages/m4/build.ncl
  • packages/make/build.ncl
  • packages/maki/build.ncl
  • packages/mariadb/build.ncl
  • packages/maude/build.ncl
  • packages/mesa/build.ncl
  • packages/mono/build.ncl
  • packages/mpc/build.ncl
  • packages/mpfr/build.ncl
  • packages/ncurses/build.ncl
  • packages/ncurses/build.sh
  • packages/nghttp2-apps/build.ncl
  • packages/ngspice/build.ncl
  • packages/nickel-lsp/build.ncl
  • packages/nickel/build.ncl
  • packages/ninja/build.ncl
  • packages/node-26.12.1/build.ncl
  • packages/node-lts/build.ncl
  • packages/node/build.ncl
  • packages/npth/build.ncl
  • packages/numpy/build.ncl
  • packages/nushell/build.ncl
  • packages/oha/build.ncl
  • packages/onetbb/build.ncl
  • packages/openblas/build.ncl
  • packages/opencv/build.ncl
  • packages/openjdk-21/build.ncl
  • packages/openssl-3.5/build.ncl
  • packages/openssl/build.ncl
  • packages/or-tools/build.ncl
  • packages/patchelf/build.ncl
  • packages/pcre2/build.ncl
  • packages/perf/build.ncl
  • packages/pnpm/build.ncl
  • packages/prek/build.ncl
  • packages/probe-rs/build.ncl
  • packages/procs/build.ncl
  • packages/protobuf/build.ncl
  • packages/python-bootstrap/0003-gh-143923-poplib-reject-control-characters.patch
  • packages/python-bootstrap/build.ncl
  • packages/python-bootstrap/build.sh
  • packages/python/build.ncl
  • packages/quint/build.ncl
  • packages/railway/build.ncl
  • packages/re2/build.ncl
  • packages/redis/build.ncl
  • packages/ripgrep/build.ncl
  • packages/ruby-3.3/build.ncl
  • packages/ruby-3.4/build.ncl
  • packages/ruby/build.ncl
  • packages/ruff/build.ncl
  • packages/rust-nightly-charon/build.ncl
  • packages/rust/build.ncl
  • packages/rustc-1.99.1/build.ncl
  • packages/sccache/build.ncl
  • packages/sd/build.ncl
  • packages/sed/build.ncl
  • packages/stack/build.ncl
  • packages/starship/build.ncl
  • packages/stlink/build.ncl
  • packages/stress-ng/build.ncl
  • packages/tcl/build.ncl
  • packages/tealdeer/build.ncl
  • packages/teamtype/build.ncl
  • packages/tokei/build.ncl
  • packages/tree-sitter/build.ncl
  • packages/tuicr/build.ncl
  • packages/typst/build.ncl
  • packages/upx/build.ncl
  • packages/ut/build.ncl
  • packages/uv/build.ncl
  • packages/valgrind/build.ncl
  • packages/verus-latest/build.ncl
  • packages/wasm-bindgen-cli/build.ncl
  • packages/weathr/build.ncl
  • packages/xh/build.ncl
  • packages/xz/build.ncl
  • packages/yazi/build.ncl
  • packages/z3-4.16.0/build.ncl
  • packages/z3/build.ncl
  • packages/zellij/build.ncl
  • packages/zeromq/build.ncl
  • packages/zig/build.ncl
  • packages/zizmor/build.ncl
  • packages/zlib/build.ncl
  • packages/zola/build.ncl
  • packages/zoxide/build.ncl
  • packages/zstd/build.ncl
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

bryan-minimal and others added 3 commits November 18, 2026 08:47
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>
@bryan-minimal
Copy link
Copy Markdown
Member Author

/build

bryan-minimal and others added 3 commits November 19, 2026 16:58
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>
bryan-minimal and others added 8 commits November 21, 2026 09:17
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>
… on main as #1626/#1613)

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>
@bryan-minimal
Copy link
Copy Markdown
Member Author

libgcc_s via glibc's dlopen: audit and fix (e5e9e58)

Why. glibc dlopens libgcc_s.so.1 to unwind on pthread_cancel and pthread_exit, and aborts without it. backtrace() dlopens it as well, but only returns no frames when it is missing. A dlopen is not DT_NEEDED, so missing-runtime_deps cannot see it.

On main, ncurses and gmp carried subsetOf gcc ["libgcc", "libstdcpp"], and that hid the gap for most of the fleet. This branch removes both (rule 4), which is how iperf3's tests came to fail (2963cec).

Method.

  1. Ran mip dump --packages on this branch for amd64 and arm64.
  2. Computed each package's transitive runtime closure. A package counts as covered when the closure includes gcc-runtime or gcc whole, or a subset that includes libgcc.
  3. For every uncovered package, streamed this branch's built artifact from the cache and parsed every ELF's .dynsym for undefined imports of pthread_cancel, pthread_exit, thrd_exit and backtrace. Coverage: amd64 368/370 packages (3,687 ELFs), arm64 364/366 (3,961 ELFs). Control: iperf3's libiperf.so was flagged (pthread_cancel).
  4. After the edits, the tree evaluates on both arches (mip dump, plus the local nickel eval of every edited file). gcc_runtime_guard.py passes. Every flagged package is now covered, apart from the exceptions below.

Fixed: libgcc added to runtime_deps (27 packages).

  • Hidden on main by ncurses/gmp:
    • redis (pthread_cancel, backtrace). Its unused ["libstdcpp"] is replaced by ["libgcc"]; no redis ELF NEEDs libstdc++.
    • stress-ng (pthread_cancel/pthread_exit). libgcc is added next to libatomic.
    • valgrind: vgdb (pthread_cancel).
    • pthread_exit: bzip3, guile, alex, happy, cabal, stack, ghc-bootstrap, haskell-language-server, ghc-9.6.7 (the GHC RTS), and bun.
    • backtrace only: htop and e2fsprogs.
  • Already missing on main:
    • pthread_cancel: libfuse, cups, bdwgc.
    • pthread_exit: git, glib, tcl, liburcu, npth, openssl-3.5, jdk-21, openjdk-21 (libsplashscreen).
    • backtrace: dnsutils.
  • hunk and plannotator are covered through git.

Not fixed at this layer (rule 4: gcc's build graph reaches them).

  • python (pthread_exit, backtrace): gcc -> glibc -> python.
  • openssl (pthread_exit, only on the thread-pool exit path): gcc -> glibc -> python -> openssl.

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.

  • otel-collector: the static Go binary contains the string "libgcc_s.so.1" but not glibc's unwinder; most likely a false positive.
  • android-sdk and edgedelta: no cache artifact on either arch, so not inspected.

None of the existing standalone tests for these packages exercise thread cancellation or exit, and I added no new tests in this pass.

@bryan-minimal
Copy link
Copy Markdown
Member Author

Note on the two rule-4 exceptions in the libgcc_s change (e5e9e58):

python and openssl can't take gcc-runtime because python is a build dependency of glibc, so both are in gcc's build graph. I checked how reachable the glibc dlopen is from each.

  • python 3.14: pthread_exit is only reachable through PyThread_exit_thread. 3.14 deprecates it, and Include/pythread.h says it "is no longer called by Python itself. It is retained only for compatibility with existing C extension code". _thread.exit() raises SystemExit (Modules/_threadmodule.c thread_PyThread_exit_thread), and bpo-44434 removed the last internal call for exactly this glibc abort. The backtrace import only loses frames; it doesn't abort. So the gap is limited to third-party C extensions that call the deprecated function.
  • openssl: only the internal thread-pool exit path calls pthread_exit, which is rare.
  • Programs that load either library still get libgcc_s wherever their own closure provides it.

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.

bryan-minimal and others added 6 commits November 24, 2026 10:37
# 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>
@bryan-minimal
Copy link
Copy Markdown
Member Author

Thanks for the review. Everything is pushed in 88bc7df1, and the PR description has a "Review follow-ups" section with the evidence for each item.

Medium

  1. python and openssl. I took neither option you offered. A carve-out in rule 4 would re-create the second gcc build that the rule exists to prevent, and glibc shipping libgcc_s would put a second copy of the same path into boxes. glibc's build dependency on python turned out to be the only path from gcc's graph to python and openssl: with that edge removed, the guard passes with libgcc on both. So glibc now builds with a new python-bootstrap: the same CPython 3.14.10 source, static, under its own prefix, no pip, and runtime deps [glibc] only. python and openssl take subsetOf gcc-runtime ["libgcc"].
  2. The check. libgcc_dlopen_guard.py runs on every PR and fails when a listed importer has no libgcc in its runtime closure. The list has 82 packages, generated by scanning 10,313 ELFs in both arches' built artifacts, and a weekly workflow re-scans and fails when the list is stale. On 40bb0b0f it fails exactly for python and openssl. python-bootstrap is exempt as build-only, and the guard fails if anything takes it at runtime.
  3. chromium-headless-shell-bin. readelf on 158.0.8127.88, both arches: all five ELFs NEED libgcc_s.so.1, and none NEEDs libstdc++. The TODO is replaced by that evidence.
  4. gcc source signature. It is a good signature from Richard Biener's key in the GNU keyring, and the tarball has the pinned sha256. The key is DSA-1024 with SHA-1 bindings, so sq authenticates it only under a pre-2014 algorithm policy. The description says so plainly.

Low

  • C++20. abseil's options.h pins ABSL_OPTION_USE_STD_ORDERING 0, and the build fails without it.
  • Cycle comments. Rewritten. gcc-runtime is now on no cycle at all; the comments say why the breaker and the stage stay.
  • Fortran placeholder. It refuses when the root's gcc is the real version.
  • gmp. Now an https source. The gmpxx comment is below the import lines.
  • Dropped C++ pieces. Listed under "Breaking for users".
  • Reproducibility. A byte-identical double build is still not done, and I've listed it as open.

This push rebuilds the world again (python-bootstrap changes glibc's inputs), so it should still merge on its own.

🤖 Generated with Claude Code

@norrietaylor norrietaylor left a comment
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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"
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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")
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Comment thread AGENTS.md Outdated

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
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Comment thread packages/python-bootstrap/build.ncl Outdated
# 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
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Comment thread packages/btop/build.ncl Outdated
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).
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed in f8ce4bf. The comments in btop, mariadb, numpy, gcloud and gnutls, and in the 14 others you listed, now say only what the files NEED. c82b3e6 does the same for the libgcc_dlopen_guard.py docstring.

Comment thread .github/scripts/gcc_runtime_guard.py Outdated
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\"""")
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed in c3c0b5a: the checkout step sets persist-credentials: false.

Comment thread .github/scripts/gcc_runtime_guard.py Outdated
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"
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Comment thread .github/scripts/libgcc_dlopen_guard.py Outdated
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).
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed in c82b3e6: the comment says 80.

evanspearman pushed a commit to evanspearman/pkgs that referenced this pull request Nov 25, 2026
'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>
bryan-minimal and others added 6 commits November 27, 2026 12:13
…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>
@bryan-minimal
Copy link
Copy Markdown
Member Author

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.

@bryan-minimal
Copy link
Copy Markdown
Member Author

jdk-25 and jdk-27 need no subsetOf gcc-runtime ["libgcc"]. Only jdk-21 does.

  • NEEDED: build-from-source.sh configures with --with-stdc++lib=static. In make/autoconf/lib-std.m4 (jdk21u, jdk25u, jdk27u) that flag sets STATIC_STDCXX_FLAGS="-static-libstdc++ -static-libgcc". So no launcher, libjli or libjvm NEEDs libgcc_s.so.1, and C++ unwinding uses the static libgcc_eh. If that were wrong, minimal-check's missing-runtime_deps would flag it on this build.
  • dlopen: I grepped all native sources (src/hotspot/** and src/*/native, src/*/*/native) at the tags we pin: jdk-25.0.5.1-ga and jdk-27.0.1.1-ga. Neither has a call to pthread_exit, pthread_cancel, thrd_exit or backtrace, and no file includes execinfo.h.
  • Why jdk-21 differs: jdk-21.0.13.1-ga has one such call. libsplashscreen/splashscreen_sys.c:404 calls pthread_exit in HandleIOError, and the XSetIOErrorHandler(HandleIOError) that would register it is commented out, so the call is dead code. The import is still in the binary, and it matches the scan's only jdk-21 evidence (usr/lib/jvm/lib/libsplashscreen.so). That code is gone in 25 and later.

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>
@norrietaylor norrietaylor left a comment
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Comment thread .github/scripts/libgcc_dlopen_guard.py Outdated
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))
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Comment thread packages/stlink/build.ncl Outdated
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).
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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").

Comment thread .github/scripts/libgcc_dlopen_guard.py Outdated

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")
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

bryan-minimal and others added 2 commits November 30, 2026 09:50
# 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>
bryan-minimal and others added 5 commits December 1, 2026 14:43
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>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants

0