8000 jvm ladder: take only the glibc-bedrock-2.42 sysroot, not its whole tarball by bryan-minimal · Pull Request #937 · gominimal/pkgs · GitHub
[go: up one dir, main page]

Skip to content

jvm ladder: take only the glibc-bedrock-2.42 sysroot, not its whole tarball - #937

Closed
bryan-minimal wants to merge 1 commit into
mainfrom
jvm-ladder-sysroot-subset
Closed

bryan-minimal wants to merge 1 commit into
mainfrom
jvm-ladder-sysroot-subset

Conversation

@bryan-minimal
@bryan-minimal bryan-minimal commented Oct 19, 2026 •
Copy link
Copy Markdown
Member

What broke

#895 (python gh-157579 backport) failed in the merge queue at ae38bb63, on amd64. Main is still green.

classpath-0.93: make failed
cd ../.. && /bin/sh ./scripts/check_jni_methods.sh
sort: /usr/lib/libc.so.6: version `GLIBC_2.43' not found (required by sort)

That is build-bot run a4ad3a81, file 93.jsonl. jikes-1.22 hit the same sort error in 27.jsonl during config.status, but there it was not fatal.

Root cause

  • The sealed glibc-bedrock-2.42 artifact from amd64: consume the bootstrap chain as sealed tarballs, like arm64 (interim; stops ladder rebuilds) #825 (sha256/d0850b65…) is the rung's raw OUTPUT_DIR. Besides the sysroot at /usr/lib/glibc-bedrock-2.42, it ships a complete glibc 2.42 at /usr/lib (libc.so.6, ld-linux-x86-64.so.2, libm.so.6, …) and at /usr/include.
  • A prebuilt = true package is extracted whole into the sandbox, and its outputs globs are not applied (minimal crates/op/src/specs.rs, materialize_prebuilt). A subsetOf dep does apply them (SubsetBuild).
  • The production glibc 2.44 ships the same paths. The sandbox root is hardlinked first-writer- 8000 wins in spec-hash order: deps sit in a BTreeSet<SandboxMapped> sorted by cache path <hash[0..2]>/<hash[2..]> (crates/sandbox/src/config.rs). A collision only produces a warn!.
  • At jvm: bootstrap OpenJDK from source (jikes/jamvm/classpath root, icedtea, openjdk-9..25) #775, production glibc hashed 15dae0… and glibc-bedrock-2.42 hashed 3ae053…, so production glibc won. python: backport gh-157579 (CVE-2026-12345, tempfile cleanup race) to 3.14.8 #895 changes glibc's hash to b8676f… (python is a build dep of glibc), which sorts after 3ae053…. The 2.42 libc then took /usr/lib, and every production tool built against 2.44 (sort from coreutils) fails to load. Hashes are from MINIMAL_SCIENCE_MODE=1 mip dump --packages --arch amd64 at c67b1aa5 and at ae38bb63.

The bug was latent from #775 on. Any change to production glibc's hash flips it with probability of roughly 3/4: python, openssl, glibc itself, or anything else in glibc's build closure.

Fix

All 28 JVM rungs (jikes-1.22, classpath-0.93/0.99/devel, jamvm-1.5.1/2.0.0, ant-bootstrap, ecj-bootstrap, ecj4-bootstrap, icedtea-7/8, openjdk-9..25) now take

subsetOf (import "../glibc-bedrock-2.42/build.ncl") ["sysroot_lib", "sysroot_include"]

instead of the whole package, for both build and runtime deps. Their build.sh files only ever read ${SR}/lib and ${SR}/include. gcc-15.2.0-glibc already takes the sysroot this way. After this change, mip dump on amd64 shows no package depending on the whole glibc-bedrock-2.42. It evaluates cleanly on arm64 too, where the rungs are empty arms.

The whole ladder rehashes, so this PR rebuilds all 28 rungs.

Testing notes

🤖 Generated with Claude Code

Summary by CodeRabbit

  • Build Improvements
    • Java and related package builds now use only the glibc sysroot libraries and headers they need, rather than the full glibc build output.

…arball

The sealed glibc-bedrock-2.42 artifact (#825) is a prebuilt, and a prebuilt
lands in the sandbox as its whole extracted tarball: its `outputs` globs are
not applied. That tarball carries a complete glibc 2.42 at /usr/lib
(libc.so.6, ld-linux-x86-64.so.2, libm.so.6, ...) and /usr/include, next to
the sysroot at /usr/lib/glibc-bedrock-2.42.

The production glibc 2.44 ships the same paths. The sandbox assembles the
root first-writer-wins in spec-hash order, so the winner at /usr/lib/libc.so.6
depends on which hash sorts lower. At #775 production glibc's hash (15dae0..)
sorted ahead of glibc-bedrock's (3ae053..), so it won. #895 (a python patch)
changes glibc's hash, because python is a build dep of glibc, to b8676f..,
which sorts after. The 2.42 libc then took /usr/lib, and every production tool
in classpath-0.93's sandbox that needs GLIBC_2.43 failed:

  sort: /usr/lib/libc.so.6: version `GLIBC_2.43' not found (required by sort)

jikes-1.22 hit the same error during config.status, but there it was not fatal.

A subset dep does apply the output globs. All 28 JVM rungs now take
subsetOf glibc-bedrock-2.42 ["sysroot_lib", "sysroot_include"]. Their
build.sh files only ever read ${SR}/lib and ${SR}/include. The same subset
is used for build and runtime deps. gcc-15.2.0-glibc already takes the
sysroot this way.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@bryan-minimal
bryan-minimal requested a review from a team as a code owner October 19, 2026 21:47
@coderabbitai
coderabbitai Bot commented Oct 19, 2026 •
Copy link
Copy Markdown
Contributor

Review in Change Stack →

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration
  • Configuration used: Repository: gominimal/pkgs/.coderabbit.yaml
  • Review profile: CHILL
  • Plan: Essentials
  • Run ID: fdc01356-9446-4d81-bcb9-e1c05eb9c0c4
📥 Commits

Reviewing files that changed from the base of the PR and between cd611d8 and 4407c36.

📒 Files selected for processing: 28
  • packages/ant-bootstrap-1.8.4/build.ncl
  • packages/classpath-0.93/build.ncl
  • packages/classpath-0.99/build.ncl
  • packages/classpath-devel/build.ncl
  • packages/ecj-bootstrap-3.2.2/build.ncl
  • packages/ecj4-bootstrap-4.2.1/build.ncl
  • packages/icedtea-7/build.ncl
  • packages/icedtea-8/build.ncl
  • packages/jamvm-1.5.1/build.ncl
  • packages/jamvm-2.0.0/build.ncl
  • packages/jikes-1.22/build.ncl
  • packages/openjdk-10/build.ncl
  • packages/openjdk-11/build.ncl
  • packages/openjdk-12/build.ncl
  • packages/openjdk-13/build.ncl
  • packages/openjdk-14/build.ncl
  • packages/openjdk-15/build.ncl
  • packages/openjdk-16/build.ncl
  • packages/openjdk-17/build.ncl
  • packages/openjdk-18/build.ncl
  • packages/openjdk-19/build.ncl
  • packages/openjdk-20/build.ncl
  • packages/openjdk-21/build.ncl
  • packages/openjdk-22/build.ncl
  • packages/openjdk-23/build.ncl
  • packages/openjdk-24/build.ncl
  • packages/openjdk-25/build.ncl
  • packages/openjdk-9/build.ncl

Included review availability: This review used your included allowance. 2 included reviews remain after this review. Your included PR review attempts over the past 7 days set your current allowance at 5 reviews per hour.

📝 Walkthrough

Package build specifications now use subsetOf to limit their glibc-bedrock dependency to sysroot_lib and sysroot_include.

Changes: glibc-bedrock dependency selection

Layer / File(s) Summary
Select glibc-bedrock sysroot outputs
packages/ant-bootstrap-1.8.4/build.ncl, packages/classpath-*/build.ncl, packages/ecj*-bootstrap-*/build.ncl, packages/icedtea-*/build.ncl, packages/jamvm-*/build.ncl, packages/jikes-1.22/build.ncl, packages/openjdk-*/build.ncl
These package build specifications import subsetOf and restrict glibc-bedrock to sysroot_lib and sysroot_include.

Priority: ⬆️ High

Estimated code review effort: 2 (Simple) | ~12 minutes

Change: Bug fix

Suggested reviewers: 0chroma

Merge Risk: ⚪ Minimal · up to 4407c

This change limits the JVM bootstrap packages to the glibc sysroot library and include outputs instead of the whole prebuilt tarball. That should stop glibc library collisions inside build sandboxes. No merge-blocking risk was found. The author notes that rebasing the dependent change #895 is the real test of the fix.

Pre-merge checks: Passed 5
Check name Status Explanation
Description Check Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check Passed The title clearly and concisely describes the main change: restricting JVM dependencies to the glibc-bedrock 2.42 sysroot instead of the full tarball.
Docstring Coverage Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check. Docstring coverage is scoped to functions touched by this diff. Analyzed 0 functions across 0…
Linked Issues check Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check Passed Check skipped because no linked issues were found for this pull request.
Full details: Docstring Coverage

Explanation

No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check. Docstring coverage is scoped to functions touched by this diff. Analyzed 0 functions across 0 files. (28 skipped: 28 unsupported.)

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Commit to this branch
  • Create a new PR
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Comment @coderabbitai help to get the list of available commands.

@bryan-minimal
Copy link
Copy Markdown
Member Author

Closing in favour of #940. This approach can't build: minimal doesn't support subsetOf in build_deps (crates/op/src/specs.rs:88 → todo!("input: Subset(…)"), which is the 7s infra_error: internal on this PR; rustc-1.91.1/build.ncl already notes the limitation).

#940 fixes the same collision at the source. It repacks the sealed glibc-bedrock-2.42 prebuilt to contain only usr/lib/glibc-bedrock-2.42/**, so it no longer ships a top-level /usr/lib/libc.so.6 that can win the sandbox's first-writer-wins race. Its minimal build is green and rebuilt all 28 JVM rungs, including classpath-0.93.

bryan-minimal added a commit that referenced this pull request Oct 20, 2026
classpath-0.93 failed on pkgs#895 (a python-only change) with
`sort: /usr/lib/libc.so.6: version GLIBC_2.43 not found`. The rungs
depend on the whole glibc-bedrock-2.42, and its sealed amd64 tarball
carries a full glibc 2.42 at /usr/lib (listed: usr/lib/libc.so.6,
ld-linux-x86-64.so.2, 4087 entries), whatever its output globs say. That
collides with production glibc 2.44 path for path (~1400 files); the
sandbox keeps whichever lands first ("Not linking ... already exists"),
which shifts with fetch timing, so an unrelated python change flipped
classpath's /usr/lib/libc.so.6 to 2.42 and every production tool in the
sandbox stopped loading.

The new glibc-bedrock-2.42-sysroot collection carries only
usr/lib/glibc-bedrock-2.42/{lib,include}, all the rungs use (SR=), and
the 28 rungs import it in place of glibc-bedrock-2.42. A collection
because `subsetOf` is only supported in runtime_deps: in build_deps it
panics minimal's executor (op/src/specs.rs:88, todo!), which is what
stopped #937.

Verified on the lab (amd64, mip): main + #895's python + this builds
jikes-1.22 and classpath-0.93 (rc=0), with no glibc path conflict in
classpath's sandbox; without it, the same tree reproduces the failure.
Rebuilds the amd64 JVM ladder once.

Co-Authored-By: Claude Opus 5.5 <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.

1 participant

0