Skip to content

openjdk-21/25/26, ghc-9.6.7 -> gen-15; drop the glibc-bedrock-2.42-sysroot package - #1322

Closed
bryan-minimal wants to merge 82 commits into
mainfrom
bryan/gen15-plain-loader
Closed

bryan-minimal wants to merge 82 commits into
mainfrom
bryan/gen15-plain-loader

Conversation

@bryan-minimal

@bryan-minimal bryan-minimal commented Nov 4, 2026 •

Copy link
Copy Markdown
Member

On top of #1242. Closes the loader half of gominimal/bootstrap#8.

gen-15 of gominimal/bootstrap builds the amd64 openjdk-21, openjdk-25, openjdk-26 and ghc-9.6.7 against the system glibc with the gcc seed, the way every other package is built: PT_INTERP /usr/lib/ld-linux-x86-64.so.2, no RUNPATH beyond their own $ORIGIN entries, and ghc-cc a two-line gcc wrapper that adds that loader. Both machines of each arch agreed on every object (generations/gen-15/manifest.json).

  • The four pins move to gen-15 on both arches. arm64's JDK objects are the gen-13 bytes under gen-15 names; arm64's ghc-9.6.7 was rebuilt from the now-shared script and is byte-identical apart from its BUILDINFO text. Their amd64 runtime dep is glibc.
  • ghc drops the sysroot from its amd64 build deps. Its check that nothing shipped names the sysroot stays, as a tripwire.
  • glibc-bedrock-2.42-sysroot has no importers left and is deleted. glibc-bedrock-2.42 itself stays: binutils-2.46-glibc and gcc-15.2.0-glibc still import it.

Cost (re-measured 2026-11-12 against main 1ab13ae, mip dump --packages, amd64): 10 packages, namely openjdk-21, openjdk-25, openjdk-26, ghc-9.6.7, ghc, cabal, stack, haskell-language-server, tamarin-prover and dev-language-servers. jdk-21/25/27 do NOT rebuild: on main they are Temurin binaries (#1137), and nothing imports openjdk-21/25/26 any more. Not included: the stage0-patchelf amd64 sha pin on the bootstrap side (bootstrap#8), which moves the gcc seed and so every amd64 hash; it waits for the next full amd64 rebuild.

Update 2026-11-12: #1242 landed as one squashed commit, so this branch's stacked history conflicted with it. aa24b05 merges main and makes the tree exactly main plus this PR's own commit (1151b19). ghc-9.6.7 keeps main's arm64 llvm runtime dep (ld.lld) and its ghc_version test, and loses only the sysroot. Nothing in packages/ references glibc-bedrock-2.42-sysroot any more.

🤖 Generated with Claude Code

bryan-minimal and others added 30 commits September 28, 2026 10:51
…on amd64)

Clean re-cut of bryan/ghc-ladder onto main d0b0026: only the ladder package
directories, none of the stale pre-#667 chain that branch carried.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
microhs-0.16 -> ghc-4.08.2 -> ghc-5.04.3 -> ghc-6.6.1 -> ghc-6.10.4 -> ghc-7.0.4 -> ghc-7.6.3.
MicroHs ships its compiled form as portable C, so gcc alone yields a Haskell compiler; GHC 4.08.2's
compiler runs on it (first-party overlay: desugared modules, shims, patches, tests), compiles itself
to C, and each later GHC is booted by the one before. ghc-7.6.3 is now built from source by 7.0.4
(registerised) and keeps the install layout 7.8.4 consumes; the .hc bundle Source is gone.

All rungs use the bedrock gcc/binutils/glibc through a sysroot gcc wrapper; every Source is in
gs://minimal-staging-archives. Rehearsed on a lab VM: the lineage and the unchanged 7.8.4..9.6.7
rungs on top of it all build and pass their gates. arm64 sides remain stubs.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…64 only like the other rungs

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
x86_64 rungs keep the bedrock sysroot wrapper; aarch64 rungs compile with the
toolchain gcc. microhs..7.0.4 gain aarch64 configure/driver patches, the
hand-passed triple for pre-2010 config.guess, and libffi 3.5.2 where the
bundled one has no aarch64 port.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Platform tables and checkArch, libffi, gold via --with-ld.gold, unregisterised
builds through 8.10.7, the boot compiler's RTS headers first, lld for the
registerised 9.2.8 link, and genapply built against the target's registers.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
ghc-bootstrap leaves the closure; hadrian bootstraps from
hadrian-bootstrap-sources-9.6.4.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
MicroHs invokes cc; the aarch64 toolchain ships gcc only.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The happy-generated parsers and Lex collect garbage constantly in the
default 50M-cell heap. 600M cells gives byte-identical .hc about 3x faster.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
dagbuild.py starts a module once its imports have compiled, largest remaining
work first, instead of the overlay's retry rounds (std and lang ran one module
at a time; gen1 serialized Parser and ParseIface behind a round barrier). The
per-module commands are unchanged.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…364)

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…bare build root

In the sandbox the build root is /build, so grepping for it matched GHC's
foldr/build rewrite rule in sources, interfaces and docs. 4.08.2, 5.04.3,
6.6.1 and 6.10.4 now look for their own tree and bin paths.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The overlay was packed on macOS, so every member carried a
com.apple.provenance pax header and GNU tar warned once per file. v2 holds the
same tree (contents, modes, links), packed deterministically with GNU tar.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…L-separated

In the sandbox the build root is /build, so selecting files by a bare build-root
grep matched far more than the tree's paths, including 5.04.3's
"ghc/InstallShield/Setup Files/...", which xargs split at the spaces. Select by
the tree, bin and boot paths with grep -F, and pass names with -Z / xargs -0.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
6.6.1 deletes compiler/stage1, so compiler/ghc-inplace -> stage1/ghc-inplace
dangled and the sandbox rejected the output (link outside the output dir).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…he sandbox's rules

- 6.10.4 (aarch64): libffi 3.5.2 builds in a per-subdir build/ tree, so
  build/*/ expanded to several dirs and the sandbox's bash cd rejected them
  (Debian's dash took the first). Name the host dir; fail if cd fails.
- 9.6.7 (aarch64): the ghc-9.2.8 boot's settings link with ld.lld; add llvm to
  the arm build closure (the lab had lld from apt).
- ghc (aarch64): the same for its 9.6.7 boot, configured with
  --disable-ld-override so the shipped settings do not need lld, and checked.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
buildbot keeps only the last ~4 KiB of stderr, and the bootstrapping.conf
failure's message matched none of the grep patterns.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The bootstrapping Cabal needs hsc2hs for hpc and looks it up on PATH;
the sandbox has none. Use the 6.6.1 rung's in-tree hsc2hs-inplace.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…r libffi's libtool

aarch64: libffi 3.5.2 builds in build/<host>/, but rts/Makefile adds
-I../libffi/build/include; copy ffi.h and ffitarget.h there too.
x86_64: libffi 3.0.8's libtool sanity-checks a C++ preprocessor; bare
g++ -E lacks the sysroot and the sandbox has no /lib/cpp. Use the gcc
wrapper with -x c++.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
These configures probe bfd.h, libiberty and libbfd unconditionally.
The sandbox closure has binutils' bfd.h, which then breaks the debug
rts (bfd.h insists on config.h first), and the lib probes would add
-lbfd -liberty to every link. Pin the three results to no. 7.10.3+
probe only under --enable-bfd-debug.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
build.sh's error grep misses the compiler's message for ghctags, and the
sandbox returns only ~4 KiB of stderr. Wrap build.sh on x86_64 only and
print the 22 lines before make's first "] Error". aarch64's spec is
unchanged, so its built rungs stay cached.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…install

hadrian install runs the bindist's configure without our flags, and it
picked ld.lld from the build closure. Export enable_ld_override=no (the
environment form of --disable-ld-override) so both configures see it.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…roduction binutils

Same fix as the jvm ladder (pkgs#775): with the amd64 bedrock roots
sealed and production glibc 2.44 in /usr/lib, the bedrock gcc (no
RUNPATH) cannot start. On x86_64 each rung starts every bedrock program
through the sysroot's ld.so with --library-path (per process; the
drivers find the wrapped cc1/collect2 via -B), and assembles and links
with production binutils 2.47 instead of the sealed 2.46.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The bedrock sysroot's libm.so is a linker script naming
/usr/lib/libm.so.6, which in the sandbox is production glibc 2.44's.
-lm therefore bound 2.44 symbol versions (mhs: GLIBC_2.43 not found at
run time against the 2.42 sysroot). Rewrite it into fixlib next to
libc.so.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
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 20 commits October 30, 2026 20:14
…t ladder), not the tarball's boot/ocamlc

A new prebuilt package ocaml-5.5.2 on both arches; ocaml/build.sh deletes the
shipped bytecode and copies the gen-9 compiler's ocamlc.byte and ocamllex.byte
into boot/ before the stock world.opt.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
…reaker from one generation

75 pins in 39 packages now name gominimal/bootstrap gen-11 objects
(generations/gen-11/manifest.json): 57 flipped to a new sha, 18 relisted
under the gen-11 url with the sha unchanged.

- 25 userland cycle breakers (acl attr bash-bootstrap bison bzip2 coreutils
  diffutils file findutils gawk-bootstrap gmp grep gzip libcap lz4 m4 make
  mpc mpfr pcre2 sed tar xz zlib zstd), both arches: replace_on_cycle
  Sources move off the bedrock prebuilts in staging-archives.
- 4 toolchain roots (linux_headers binutils gcc glibc), both arches, plus
  the amd64-only binutils-2.46-glibc gcc-15.2.0-glibc glibc-bedrock-2.42
  aliases: amd64 and arm64 binutils/glibc/headers relist, arm64 gcc flips.
- 7 ladder tops (ghc-9.6.7 go-1.24.9 ocaml-5.5.2 openjdk-21/25/26
  rustc-1.98.1): amd64 relists, arm64 flips.

Pin comments collapse to one line naming the generation; header comments
in the ladder tops and their consumers (ghc go ocaml rust) name gen-11
instead of the generation each was first pinned at.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
…eed's loader lives there

The amd64 seed gcc's interpreter and RUNPATH name /usr/lib/glibc-bedrock-2.42/lib. In a cycle
pass that pairs the seed with a from-source glibc (nginx), nothing else supplies that tree and
gcc cannot exec: "C compiler gcc is not found". The glibc seed ships the tree as its
bedrock_sysroot_lib output; the gcc seed now depends on exactly that subset, so nothing at
top-level /usr/lib collides.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
…oot package

In the cycle pass `glibc` resolves to whichever glibc that pass holds, and the from-source one
has no bedrock_sysroot_lib output, so the subset could name nothing. The glibc-bedrock-2.42-sysroot
package is the pinned tree itself, with no cycle through gcc, as go-1.24.9 and the JDKs use it.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
113 of 117 objects are the same bytes as gen-11, so most pins change url only; go-1.24.9 (amd64)
moves to a new sha (its BUILDINFO text changed).

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…f-contained gcc seed retires

Every gominimal/bootstrap pin moves from gen-12 to gen-13. gen-13's amd64
gcc-15.2.0-glibc seed is installed with PT_INTERP /usr/lib/ld-linux-x86-64.so.2
and no RUNPATH (bootstrap a6bef0c), so it no longer needs
/usr/lib/glibc-bedrock-2.42/lib at run time.

Removed:
- gcc (prebuilt): the glibc-bedrock-2.42-sysroot runtime dep, its comment
  and import.
- glibc (prebuilt): the bedrock_sysroot_lib output and its comment; outputs
  are all_outputs again.
- go-1.24.9: runtime_deps are [glibc] on both arches. The amd64 go is built
  with cgo off and has no interpreter.

Kept: glibc-bedrock-2.42-sysroot on amd64 for openjdk-21/25/26, ghc-9.6.7
and ghc. Their published amd64 binaries are byte-identical to the earlier
generations and were linked with --dynamic-linker set to the bedrock loader
and an rpath into the sysroot, and ghc-9.6.7's ghc-cc compiles against that
sysroot. The JDK recipes now say so in a comment.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…ervers#292); every package built

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
…sroot package

gen-15 of gominimal/bootstrap builds the amd64 openjdk-21/25/26 and ghc-9.6.7 against the
system glibc with the gcc seed: PT_INTERP /usr/lib/ld-linux-x86-64.so.2, no RUNPATH beyond
their own $ORIGIN entries, and ghc-cc a plain gcc wrapper that adds that loader. The four pins
move to gen-15 on both arches (arm64's objects are the gen-13 bytes under their gen-15 names,
ghc-9.6.7's rebuilt from the shared script and identical apart from BUILDINFO) and their amd64
runtime dep becomes glibc. ghc drops the sysroot from its amd64 build deps; its check that
nothing shipped names the sysroot stays. Nothing imports glibc-bedrock-2.42-sysroot any more,
so the package goes.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
@coderabbitai

coderabbitai Bot commented Nov 4, 2026 •

Copy link
Copy Markdown
Contributor

Warning

Review limit reached

  • Run on-demand review

This review includes 7 billable files and costs up to $1.75.

  • Ask an admin to make reviews automatic

Open in CodeRabbit

Reviews can continue after your included limit without a manual trigger. An admin must approve usage-based billing.

Or wait 32 minutes for your next included review.

Check out review usage here.

View limit details

Limit details: You’ve used the included review currently available. Your 70 included PR review attempts over the past 7 days set your current allowance at 1 review per hour.

Learn how review limits work.

Review configuration:

Run configuration

Commits

Reviewing files that changed from the base of the PR and between 1ab13ae and aa24b05.

Files selected for processing: 7

  • packages/ghc-9.6.7/build.ncl
  • packages/ghc/build.ncl
  • packages/ghc/build.sh
  • packages/glibc-bedrock-2.42-sysroot/build.ncl
  • packages/openjdk-21/build.ncl
  • packages/openjdk-25/build.ncl
  • packages/openjdk-26/build.ncl
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Base automatically changed from bryan/gen11-flip to main November 11, 2026 06:00
#1242 landed as one squashed commit, so this branch's stacked gen-11..gen-13
history conflicted with it. The tree is now main plus this PR's own
commit (1151b19). ghc-9.6.7 keeps main's arm64 llvm runtime dep and
ghc_version test, and drops only the sysroot.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@bryan-minimal

Copy link
Copy Markdown
Member Author

Superseded by #1462

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.

1 participant