Repository navigation
tests: minimal test_deps for older standalone tests (batch 3 of 6, gradle–libcap-ng) - #1406
Conversation
…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>
|
No actionable comments were generated in the recent review. Walkthrough
Merge Risk:
|
…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
left a comment
There was a problem hiding this comment.
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(testsystem_ca_default, deps at :149): the client dialsurl="https://localhost:$(cat port)/".- What breaks:
/etc/hostscame only frombase. Its output isetc/hosts;base-bootstrapis the only other package that ships one. Without it,localhostdoesn't resolve. The firsthttpcall then fails on name resolution instead of on certificate verification.grep -qi 'certificate verify failed' outfails 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
localhostfailed with EAI_AGAIN". - Fix: use
https://127.0.0.1:…, as in bec1f28. The embedded leaf certificate already carriesIP:127.0.0.1in its subjectAltName (it decodes toDNS:localhostandIP: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 SNIservername, aHost:header, or comments. - Not confirmed by a build: CI is green, which argues against this unless the bot didn't run this test.
- What breaks:
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).
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
left a comment
There was a problem hiding this comment.
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.
| { | ||
| class = 'Standalone, | ||
| test_deps = [base], | ||
| test_deps = [bash-bootstrap, coreutils], |
There was a problem hiding this comment.
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.
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].basebrings 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.baseis removed from every test'stest_deps.bash-bootstrapis added where a command runs/bin/bashor/bin/sh(its only runtime_dep is glibc).coreutils,grep,diffutils,findutils,gawk,tar,gzip. They were found by scanning each script's command positions, including multi-linem%"…"%scripts and#!/usr/bin/envshebangs.toolchain,jdk,ocaml,git, and so on) are kept as they were.let base = import …stays whereverbaseis still a build dep.testsare 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
basewas hiding. Each one gets fixed in a follow-up commit on this branch by adding the missingruntime_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 totest_deps, never by addingbaseback.The failures were deliberately not predicted ahead of time. This PR exists so the build-bot runs every test under the minimal closure.
Tests
basebash-bootstrap, grepbasebash-bootstrapbase, toolchain, binutils, linux_headersbash-bootstrap, toolchain, binutils, linux_headersbasebash-bootstrapbase, toolchain, binutils, protobuf, python, linux_headersbash-bootstrap, toolchain, binutils, protobuf, python, linux_headersbasebash-bootstrap, coreutilsbasebash-bootstrap, grepbasebash-bootstrap, coreutils, grepbasebash-bootstrap, grepbasebash-bootstrap, grepbasebash-bootstrap, coreutilsbase, ca-certificatesbash-bootstrap, ca-certificates, coreutils, grepbasebash-bootstrap, coreutilsbasebash-bootstrap, grepbasebash-bootstrap, grepbasebash-bootstrap, grepbasebash-bootstrap, grepbasebash-bootstrap, grepbasebash-bootstrap, coreutils, grepbasebash-bootstrap, grepbasebash-bootstrap, grepbasebash-bootstrap, coreutils, grepbasebash-bootstrap, grepbasebash-bootstrap, grepbasebash-bootstrap, coreutils, grepbase, toolchain, pkgconfbash-bootstrap, toolchain, pkgconf, coreutils, grepbasebash-bootstrap, diffutils, grepbasebash-bootstrap, grepbasebash-bootstrap, grepbasebash-bootstrap, grepbasebash-bootstrap, coreutils, grepbase, gitbash-bootstrap, git, coreutils, grep, tarbasebash-bootstrap, coreutils, grepbasebash-bootstrap, grepbasebash-bootstrapbasebash-bootstrap, grepbasebash-bootstrap, grepbasebash-bootstrapbasebash-bootstrap, grepbasebash-bootstrap, coreutilsbasebash-bootstrap, grepbasebash-bootstrapbase, toolchainbash-bootstrap, toolchain, coreutils, grepbasebash-bootstrapAlso: a pscap test that can fail
pscap --help 2>&1 || truepassed whatever happened. It now requires pscap's exact usage line (usage: pscap [-a] [-p pid] [--tree]) and exit status 1, perutils/pscap.cat 0.9.6. Bash builtins only.🤖 Generated with Claude Code
Summary by CodeRabbit
127.0.0.1.