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
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