8000 tests: minimal test_deps for older standalone tests (batch 3 of 6, gradle–libcap-ng) by bryan-minimal · Pull Request #1406 · gominimal/pkgs · GitHub
[go: up one dir, main page]

Skip to content

tests: minimal test_deps for older standalone tests (batch 3 of 6, gradle–libcap-ng) - #1406

Merged
bryan-minimal merged 4 commits into
mainfrom
retest-minimal-deps-3
Nov 11, 2026
Merged

bryan-minimal merged 4 commits into
mainfrom
retest-minimal-deps-3

Conversation

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

Re-checks older standalone tests with minimal test_deps (batch 3 of 6, gradle–libcap-ng): 25 packages, 44 tests.

These tests were written with test_deps = [base]. base brings in bash, coreutils, grep, sed, gawk, diffutils, findutils, tar, gzip, xz, bzip2, file and tzdata, and through them zlib, zstd, libmagic, libstdc++ and more. That masks missing runtime libraries: a binary that needs an undeclared library still loads, because base put the library in the test closure. The smoke-test batches of 11-06/07 (#1364–#1368, #1372, #1373) used minimal deps and found several real missing runtime_deps this way.

What changed

Only test_deps. No test command was changed.

  • base is removed from every test's test_deps.
  • bash-bootstrap is added where a command runs /bin/bash or /bin/sh (its only runtime_dep is glibc).
  • The base tools a script actually calls are added explicitly: coreutils, grep, diffutils, findutils, gawk, tar, gzip. They were found by scanning each script's command positions, including multi-line m%"…"% scripts and #!/usr/bin/env shebangs.
  • Other non-base deps (toolchain, jdk, ocaml, git, and so on) are kept as they were.
  • let base = import … stays wherever base is still a build dep.

tests are not part of the spec hash, so the test_deps changes rebuild nothing. gradle is the exception: its runtime_deps gain coreutils, findutils and sed (its launcher script runs them), so it rebuilds.

Expected failures

Some of these tests are expected to fail. That is the point of the PR. A failure with the minimal closure, typically exit 127 with empty stderr (a loader failure) or a missing shared library, shows a package with an UNDECLARED runtime_dep that base was hiding. Each one gets fixed in a follow-up commit on this branch by adding the missing runtime_deps (which does rebuild that package). A failure can also come from a script calling a tool the scan missed. Those get fixed by adding that tool to test_deps, never by adding base back.

The failures were deliberately not predicted ahead of time. This PR exists so the build-bot runs every test under the minimal closure.

Tests

package test before after
gradle version base bash-bootstrap, grep
grafana subcommands_replace_the_dropped_bins base bash-bootstrap
grpc link_and_run base, toolchain, binutils, linux_headers bash-bootstrap, toolchain, binutils, linux_headers
grpc plugin_check base bash-bootstrap
grpc proto_compile base, toolchain, binutils, protobuf, python, linux_headers bash-bootstrap, toolchain, binutils, protobuf, python, linux_headers
guile eval base bash-bootstrap, coreutils
happy version_check base bash-bootstrap, grep
happy generates_a_parser base bash-bootstrap, coreutils, grep
helix smoke base bash-bootstrap, grep
httpie smoketest base bash-bootstrap, grep
httpie certifi_distrusts_emsign_ecc_g3 base bash-bootstrap, coreutils
httpie system_ca_default base, ca-certificates bash-bootstrap, ca-certificates, coreutils, grep
inetutils exec_bits base bash-bootstrap, coreutils
iputils smoke base bash-bootstrap, grep
jbang jbang_version base bash-bootstrap, grep
jbang run_script base bash-bootstrap, grep
jdk-21 java_version base bash-bootstrap, grep
jdk-21 javac_compile base bash-bootstrap, grep
jdk-21 cve_2026_111943 base bash-bootstrap, coreutils, grep
jdk-25 java_version base bash-bootstrap, grep
jdk-25 javac_compile base bash-bootstrap, grep
jdk-25 cve_2026_111943 base bash-bootstrap, coreutils, grep
jdk-27 java_version base bash-bootstrap, grep
jdk-27 javac_compile base bash-bootstrap, grep
jdk-27 cve_2026_111943 base bash-bootstrap, coreutils, grep
jemalloc compile_link base, toolchain, pkgconf bash-bootstrap, toolchain, pkgconf, coreutils, grep
jq basic base bash-bootstrap, diffutils, grep
jq filtering base bash-bootstrap, grep
jq map base bash-bootstrap, grep
jreleaser jreleaser_version base bash-bootstrap, grep
jreleaser init base bash-bootstrap, coreutils, grep
jreleaser assemble base, git bash-bootstrap, git, coreutils, grep, tar
jsongrep query_syntax base bash-bootstrap, coreutils, grep
kani smoke base bash-bootstrap, grep
kissat smoke base bash-bootstrap
kotlin kotlinc_version base bash-bootstrap, grep
kotlin compile_and_run base bash-bootstrap, grep
lazydocker smoke base bash-bootstrap
lazygit smoke base bash-bootstrap, grep
lean compiles_hello base bash-bootstrap, coreutils
lean bv_decide base bash-bootstrap, grep
leangz smoke base bash-bootstrap
libcap-ng link_and_run base, toolchain bash-bootstrap, toolchain, coreutils, grep
libcap-ng pscap_runs base bash-bootstrap

Also: a pscap test that can fail

pscap --help 2>&1 || true passed whatever happened. It now requires pscap's exact usage line (usage: pscap [-a] [-p pid] [--tree]) and exit status 1, per utils/pscap.c at 0.9.6. Bash builtins only.

🤖 Generated with Claude Code

Summary by CodeRabbit

  • Tests
    • Test setups across Gradle, Grafana, gRPC, and other packages now explicitly declare the tools and supporting packages they need.
    • Existing test commands and assertions are generally unchanged; the HTTPie system-CA check now connects to 127.0.0.1.
  • Package Updates
    • Gradle’s runtime dependencies now include coreutils, findutils, and sed.

…adle–libcap-ng)

Replace `base` in test_deps with bash-bootstrap plus the tools each script
actually calls, so the test closure no longer masks undeclared runtime libraries.
Test commands are unchanged; tests are not in the spec hash.

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 8, 2026 21:27
@coderabbitai
coderabbitai Bot commented Nov 8, 2026 •
Copy link
Copy Markdown
Contributor

Explain Change →

No actionable comments were generated in the recent review.

Walkthrough

Changes

Standalone test dependencies change across multiple package specifications. Tests replace base with declared packages. Gradle also adds utility packages to its runtime dependencies.

Package dependency declarations

Layer / File(s) Summary
Explicit standalone test dependencies
packages/{grafana,grpc,guile,happy,helix,httpie,inetutils,iputils,jbang,jdk-*,jemalloc,jq,jreleaser,jsongrep,kani,kissat,kotlin,lazydocker,lazygit,lean,leangz,libcap-ng}/build.ncl
Tests replace base with explicitly declared dependencies. The HTTPie system-CA test changes its request URL from localhost to 127.0.0.1.
Gradle runtime utilities
packages/gradle/build.ncl
Gradle adds coreutils, findutils, and sed to its runtime dependencies. Comments describe utility requirements for the startup script.

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

Possibly related PRs

  • gominimal/pkgs#1408: Both PRs replace base in standalone test dependencies with bash-bootstrap and explicit tools as part of the same batch series.
  • gominimal/pkgs#1404: Both PRs replace base in standalone test dependencies with bash-bootstrap and explicit tools as part of the same batch series.

Suggested reviewers: norrietaylor, msample

Merge Risk: Minimal · up to a8b79

The change narrows test dependencies and adds Gradle runtime utilities. No specific blocking regression is established; run the standalone tests as a normal merge check.

Pre-merge checks: Passed 4

Check name Status Explanation
Description Check Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check Passed The title clearly identifies the change: reducing test dependencies for older standalone tests. The batch and package-range details add context without making the title vague.
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.
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
Recent review info

Run configuration

Commits

Reviewing files that changed from the base of the PR and between 534714d and a8b79e9.

Files selected for processing: 1

  • packages/httpie/build.ncl

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

…hem)

Gradle's launcher (unixStartScript) dies "xargs is not available" without
findutils, then pipes the JVM opts through `xargs -n1 | sed | tr` and runs
`uname`. base had hidden this; with minimal test_deps `gradle --version`
printed no "Gradle".

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@agent-137 agent-137 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.

Review on Karl's behalf. This is a comment, not an approval. Nothing was built for it. The findings come from reading the declarations and fetching upstream sources, and each one says how it was checked. The CI rollup on this head is now SUCCESS.

CI: all green, including minimal build SUCCESS and CodeRabbit SUCCESS. The bot's details URL is just https://minimal.dev, so I can't tell whether it ran httpie:system_ca_default (see below).

Should-fix

  • packages/httpie/build.ncl:216 (test system_ca_default, deps at :149): the client dials url="https://localhost:$(cat port)/".
    • What breaks: /etc/hosts came only from base. Its output is etc/hosts; base-bootstrap is the only other package that ships one. Without it, localhost doesn't resolve. The first http call then fails on name resolution instead of on certificate verification. grep -qi 'certificate verify failed' out fails and the test exits 1. If it somehow passed, it would pass for the wrong reason.
    • Evidence: this is exactly the failure the author recorded for actions-runner in #1404 commit bec1f28: "no /etc/hosts (base provided it), so node's lookup of localhost failed with EAI_AGAIN".
    • Fix: use https://127.0.0.1:…, as in bec1f28. The embedded leaf certificate already carries IP:127.0.0.1 in its subjectAltName (it decodes to DNS:localhost and IP:127.0.0.1), and the server already binds 127.0.0.1. No new certificate is needed.
    • How I found it: grepped every test block in all six PRs for localhost. This is the only test where a client resolves the name; the other hits are SNI servername, a Host: header, or comments.
    • Not confirmed by a build: CI is green, which argues against this unless the bot didn't run this test.

Nit

  • PR body: "Only test_deps / changes no package output" is no longer true. Commit 534714d adds coreutils, findutils and sed to gradle's runtime_deps, so gradle rebuilds.

Verdict: needs changes (httpie).

bryan-minimal and others added 2 commits November 9, 2026 12:35
Without base there is no /etc/hosts, so `localhost` does not resolve and
the test would fail on name resolution instead of certificate
verification (agent-137 on #1406; same as actions-runner in bec1f28).
The leaf already carries IP:127.0.0.1 and the server binds 127.0.0.1.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
`pscap --help 2>&1 || true` passed whatever happened, including a missing
or unloadable pscap. pscap 0.9.6's usage() (utils/pscap.c) prints
"usage: pscap [-a] [-p pid] [--tree]" and exits 1 for any unknown argument,
so the test now requires that line and that status. Bash builtins only, so
test_deps stays [bash-bootstrap].

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. The diff has 25 build.ncl files, and each test drops base for bash-bootstrap plus the base tools that its script calls. Three follow-up commits on the branch go beyond test_deps: the gradle runtime_deps, the httpie localhost to 127.0.0.1 change, and the stricter pscap assertion. Each commit message explains its change. The PR body still says "No test command was changed", so update the body to name the httpie and libcap-ng command changes. Clobber none. git log on gradle, httpie and libcap-ng shows only #1386 and #1135 before this branch, and the diff reverts neither. Correctness I read every changed test script and compared the commands it calls with its new test_deps. I found no missing tool. tar -tzf in jreleaser gets gzip through the tar runtime_deps. bash-bootstrap ships usr/bin/sh for the #!/bin/sh scripts (the gradle wrapper and jemalloc-config). Every new import is used. The gradle version test now runs without findutils and sed in test_deps, so it is the regression test for the new gradle runtime_deps. bash-bootstrap next to a package with a bash runtime dep is an established pattern in 62 packages. One nit is filed: guile carries an unused coreutils. Not checked: whether each test passes under the minimal closure, because that needs a build. The PR says that this is the purpose of the build-bot run. I also did not check the pscap usage string against the libcap-ng 0.9.6 source, because the source is not in the checkout.

Comment thread packages/guile/build.ncl
{
class = 'Standalone,
test_deps = [base],
test_deps = [bash-bootstrap, coreutils],
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 eval test calls only guile and the bash builtin test. It does not need coreutils. kissat uses the same test "$(...)" = ... form and gets only bash-bootstrap. Remove coreutils here and its import on line 6. This keeps the closure minimal, which is the purpose of this PR. coreutils also brings gmp, acl and libcap into the test closure.

@bryan-minimal
bryan-minimal added this pull request to the merge queue Nov 10, 2026
Merged via the queue into main with commit 182496b Nov 11, 2026
15 checks passed
@bryan-minimal
bryan-minimal deleted the retest-minimal-deps-3 branch November 11, 2026 00:18
evanspearman pushed a commit to evanspearman/pkgs that referenced this pull request Nov 25, 2026
…VE-2026-114938) (gominimal#1556)

* jdk-21, jdk-25, jdk-27: built from source at the Java4Shell fix tags

Revives the from-source recipes of bryan/jdk-from-source-v2
(dd19d82, green on both arches 2026-11-05), each booted by its
bootstrap JVM-ladder rung (openjdk-21, openjdk-25, openjdk-26) and
compiled by the production toolchain, at the out-of-band tags that fix
CVE-2026-114938 (Java4Shell, HotSpot x86-64 AVX-512 Base64 intrinsic):
jdk-21.0.13.1-ga (+2), jdk-25.0.5.1-ga (+2), jdk-27.0.1.1-ga (+4).
Temurin had not shipped these when this was written.

Reconciled with main since v2:
- CVE-2026-111943: main's eMudhra step (../jdk/cve-2026-111943.*) and
  its test are restored in all three. OpenJDK's own cacerts at these
  tags still holds both distrusted anchors. This is the blocker
  msample's review of gominimal#1242 found.
- gominimal#1406's test_deps (bash-bootstrap, grep, coreutils) replace `base`.
- jdk-27 is at 27.0.1.1, past main's Temurin 27.0.1.0.2, not 27 GA.

Sources are the GitHub tag archives mirrored to staging-archives.

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

* jdk-21, jdk-25, jdk-27: Temurin's shape, CDS, src.zip, static libstdc++; one shared build

Measured against Temurin 21.0.13.1+2, 25.0.5.1+2 and 27.0.1.1+4 (x64 tarballs and their
build-metadata configure lines); gap list in the PR.

Matches Temurin now:
- java -version: "OpenJDK Runtime Environment Minimal-21.0.13.1+2 (build 21.0.13.1+2-LTS)",
  i.e. --with-vendor-name=Minimal, --with-vendor-version-string=Minimal-<v>+<n>,
  --with-version-opt=LTS (21, 25; none for 27), --with-source-date=version, vendor URLs ours.
- lib/src.zip ships (through the existing zip normalisation).
- CDS archives ship, the same set per line as Temurin. They're re-dumped from the sorted classlist
  with Images.gmk's flags, twice, and the build fails unless the dumps are byte-identical.
- No jmods/ on 25 and 27 (--enable-linkable-runtime, JEP 493). No consumer uses jmods or jlink.
- --with-stdc++lib=static; build.sh fails if libjvm NEEDs libstdc++.
- cacerts from ../ca-certificates (Mozilla, the upstream Temurin's store comes from too) via
  --with-cacerts-src, with ASCII alias file names (NetLock's non-ASCII name breaks GenerateCacerts
  under LC_ALL=C). The CVE-2026-111943 step still runs, fail-closed.

Deliberately different: the registry's freetype/lcms2/libpng/libjpeg/giflib/zlib instead of
bundled copies (patched with the fleet, visible to the scanners); no separate debug image; no
dtrace; no Adoptium NOTICE.

Phase 2: one shared script (../jdk/build-from-source.sh via ../jdk/from-source.ncl), each
recipe's build.sh a wrapper selected by build_args (feature, boot, version_opt). Dropped the v2
fixes that are dead at these tags: the aarch64 call_VM_leaf_base dedupe (one declaration left),
the uabs rename (hotspot no longer defines uabs), the __DATE__/__TIME__ strip (gone), and the
libpng NEON pin (bundled libpng is only compiled without --with-libpng=system). -std=gnu17 stays.

Tests: java_version (shape, LTS, "sharing", no Adoptium/Temurin), cds (-Xshare:on, user dump),
src_zip, libjvm_static_libstdcpp; cve_2026_111943 unchanged.

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

* jdk-21/25/27: one ../jdk import (pkgs imports check)

minimal-check failed on d26431a: "identifier 'jdk_src' doesn't match
folder 'jdk' in import". A recipe can bind only one identifier per folder,
so from-source.ncl now carries the shared build script as `script` and the
CVE-2026-111943 inputs as `cve`, and each recipe imports just it. The
build_deps entries are the same five Local files; all three recipes
evaluate on amd64 and arm64. test_ci_scope's helper-chain comment follows
the new chain; its 15 tests pass.

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

* jdk-21/25/27: fontconfig at run time; leave .jmod files unnormalised

CodeRabbit on gominimal#1556:
- libfontmanager dlopens libfontconfig at run time, but fontconfig was only
  a build dep. It is now a runtime dep of all three, beside freetype.
- The zip normaliser rewrote every .jmod, but java.base.jmod records the
  hash of every other module's .jmod, so `jlink --module-path .../jmods`
  would fail with "Hash of <module> differs". .jmod files are no longer
  normalised (they are deterministic already: --with-source-date=version
  passes a fixed --date to `jmod`). jdk-21, the one line that still ships
  jmods, gets a jlink_roundtrip test that links java.base + java.logging
  from them and runs the result.

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

* jdk: replace the read-only CDS archives; check the shipped cacerts count

- The build at 2eef287 failed on both arches in jdk-21: the image installs
  classes*.jsa read-only (0444), so cp over one was "Permission denied".
  The re-dump now removes the file, copies the new dump, and sets 0644,
  Temurin's mode for every classes*.jsa. (The classlist is replaced with
  mv and the zip normaliser with os.replace, so neither needs a writable
  file.)
- cacerts: the source already had to hold every root of ca-certificates.crt
  (118 = curl's 2026-11-05 extract). The shipped store is now checked too:
  keytool must list exactly as many trustedCertEntry roots. For scale,
  Temurin 25.0.5.1's cacerts holds 117 roots (its 152,820 bytes are PKCS#12
  overhead); by SHA-256 the only difference is Izenpe.com, which Mozilla still
  trusts for TLS and Adoptium omits.

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

* jdk: leave Izenpe.com out of the JDK trust store (Temurin's exact set)

Bryan, 2026-11-18: drop Izenpe.com. Mozilla trusts it for TLS only up to a
distrust-after date, which Java's cacerts cannot express; Temurin leaves it
out too, and with it gone the shipped store is Temurin 25.0.5.1's 117 roots
exactly (compared by SHA-256). JDK-only: the system ca-certificates keeps it.

The cacerts source step finds it by its label's file name, proves it by
SHA-256 with the boot JDK's keytool, and fails the build if either check
fails (moved, renamed, or a different cert). The source and shipped counts
are now the bundle minus one. The trust-store test treats its fingerprint
like the eMudhra anchors: it must be absent.

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

* jdk: keep 25/27 linkable after the build; Izenpe.com optional

jdk-25 and jdk-27 build with --enable-linkable-runtime (JEP 493). jlink
records the SHA-512 of every module file outside lib/modules
(jdk.jlink runtimelink/fs_<module>_files) and refuses to link from an
image whose copy differs, except upgrade_files_<module>.conf entries
(java.base: lib/security/cacerts, lib/tzdb.dat). The script changed four
recorded files after the build: lib/classlist (sort), lib/jrt-fs.jar and
lib/ct.sym (zip normaliser), lib/security/blocked.certs (CVE step).

- blocked.certs: the 48 CVE-2026-111943 fingerprints go into the
  Gendata rule that writes it, before jlink records it; the CVE step
  after the build finds them in place and leaves the bytes unchanged.
  java.base.jmod now carries them too, so jdk-21's jlink output has them.
- classlist: no longer sorted; SortClasslist already orders it upstream
  (21, 25 and 27 tags).
- zip normaliser: skips every file a linkable runtime recorded.
- cacerts edits stay: jlink exempts cacerts.
- A build gate re-runs jlink's own SHA-512 comparison over every module
  at the end (25/27), and a jlink_from_runtime test links java.base, and
  java.base+jdk.compiler, from the installed image.

Izenpe.com: a ca-certificates without the file has nothing to leave
out; the expected count drops by one only when it was there.

Comment cleanup: no review-history references; one comment on the jdk
import; drop the dead zip `head`.

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

* ci_scope test: assert the helper-to-helper edge itself

jdk-21/25/27 now import ca-certificates/build.ncl directly, so "jdk-21
is in scope" held even if load_graph read only build.ncl files. Assert
jdk's direct edge to ca-certificates, which exists only through
packages/jdk/cve-2026-111943.ncl, and that jdk is in the scoped set.
Fails with load_graph limited to build.ncl.

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

* jdk: say why cacerts is built in; fail the libstdc++ check on readelf

OpenJDK reads its roots from a keystore and on Linux has no keystore
type that reads /etc/ssl/certs, so jdk-21/25/27 build cacerts from
ca-certificates. Each build.ncl now says so, and names the denylists
that apply (ca-certificates' distrust.txt gate, blocked.certs).

The libstdc++ linkage check piped readelf into grep, so a readelf that
failed read as "no libstdc++". It now captures readelf's output, fails
if readelf fails or lists no NEEDED entries, then checks them, as the
libstdc++ standalone tests do.

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

---------

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.

3 participants

0