Skip to content

The container harness ran nothing, and exited 0 doing it - #13

Merged
martin-k-m merged 4 commits into
mainfrom
fix/linux-check-runs-nothing
Sep 5, 2026
Merged

The container harness ran nothing, and exited 0 doing it#13
martin-k-m merged 4 commits into
mainfrom
fix/linux-check-runs-nothing

Conversation

@martin-k-m

Copy link
Copy Markdown
Owner

What was wrong

scripts/linux-check.sh inlined the script the container was to run into the docker run command line inside single quotes. One of its own comments reads:

    # The host target directory is another platform's and can be gigabytes.

The apostrophe in platform's closed the quoting. Substituting a docker that prints its argv shows what was actually asked for:

argv[15]='rust:1'
argv[16]='bash'
argv[17]='-c'
argv[18]='\n    # The host target directory is another platforms'
argv[19]='and'
argv[20]='can'
argv[21]='be'
argv[22]='gigabytes.'

The container ran bash -c on a single comment. bash executes a comment successfully and silently, so the exit status was 0. The tar, the rustup component add and exec cargo "$@" were never in the string — and neither were the caller's own arguments, which -- "$@" should have delivered.

scripts/linux-check.sh test --workspace returned success in under a second, having built and tested nothing.

Why it is the worst shape of defect in docs/BUGS.md

Every other silent failure in that file is Arc reporting success while not doing its job. This is the harness doing it, which is strictly worse, because the harness is what the other twelve were caught by. The Linux tracer cannot be built on macOS or Windows, so this script is the only gate the two Linux backends pass through on a developer machine. Every claim of a container run made through it is void.

I have not established how long it stood, and I am not going to guess a date I have not verified.

The fix is structural, not an escape

The container script is now scripts/linux-check-inner.sh, named on the command line as a path. No quoting of the outer command can truncate a file. Escaping the apostrophe would have fixed this instance and left the next comment free to do it again.

scripts/linux-verify.sh was already a file, for the full fixed pipeline, and is described as "run inside the container by linux-check.sh" — which it never was. The inline copy was a leftover of a half-finished extraction.

The inner script also sets user.email, user.name and init.defaultBranch, which several tests need and CI sets; the inline version never did, so the first genuinely-executed run would have failed on that instead.

Seen red first

All four cases in crates/arc-cli/tests/harness.rs failed against the old script, printing the argv above. They put a docker that records its arguments first on PATH, so they need neither Docker nor Linux and run on every platform. They assert that the caller's arguments arrive, that what is named is a script file rather than a comment, that no fragment of a comment appears as an argument, and that every script named exists and passes bash -n.

Gates run

Host (macOS): cargo fmt --all, cargo clippy --workspace --all-targets --all-features -- -D warnings clean, harness suite 4 passed.

Container, for the first time genuinely: bash scripts/linux-check.sh test --workspace --no-fail-fast in rust:1 on Docker Desktop (arm64, 12 CPUs). It now builds and runs the whole workspace, which takes minutes and prints hundreds of lines. 150 passed, 2 failed.

The two failures are on main's code and are not caused by anything here — they are concurrency tests, and both are of the shape docs/BUGS.md #12 already records for a contended container:

test concurrent_traced_runs_do_not_corrupt_dependency_metadata ... FAILED
test concurrent_traced_runs_stay_independent ... FAILED

Both fail on assert!(c.wait().unwrap().success()) and neither says anything more, because that assertion discards the child's status and output. That is the first thing the working harness found, and I am reporting it rather than folding it into this branch.

🤖 Generated with Claude Code

scripts/linux-check.sh inlined the script the container was to run into the
docker command line inside single quotes. One of its own comments contains
"another platform's". The apostrophe closed the quoting, so what docker was
handed was:

    argv[17]='-c'
    argv[18]='\n    # The host target directory is another platforms'
    argv[19]='and'
    argv[20]='can'
    argv[21]='be'
    argv[22]='gigabytes.'

bash runs a comment successfully and silently, and `-- "$@"` -- the caller's
own arguments -- was among the words that fell out of the string. The harness
returned 0 in under a second having built and tested nothing.

The Linux tracer cannot be built on macOS or Windows, so this script is the
only gate the two Linux backends pass through on a developer machine. Every
claim of a container run made through it is void.

The fix is structural. The container script is now scripts/linux-check-inner.sh,
named on the command line as a path, so no quoting of the outer command can
truncate it; escaping the apostrophe would have fixed this instance and left
the next comment free to do it again. scripts/linux-verify.sh, already a file
for the full fixed pipeline, was the pattern -- the inline copy was a leftover
of a half-finished extraction. The inner script also sets the three git config
values several tests need and the inline version never had.

Seen red first: all four cases in crates/arc-cli/tests/harness.rs failed
against the old script, printing the argv above. They put a `docker` that
records its arguments on PATH, so they need neither Docker nor Linux and run
on every platform.

Recorded as docs/BUGS.md #13, because a harness reporting success while doing
nothing is the same silent-failure shape the rest of that file is about, and
the worst instance of it: it is what the others were caught by.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
martin-k-m and others added 3 commits September 5, 2026 00:11
macOS ships bash 3.2, where an empty array expanded under `set -u` is an unbound
variable rather than nothing at all. "${TTY[@]}" therefore killed the script
before it reached docker, and all four new harness tests failed on the macOS
runner with `TTY[@]: unbound variable` while Linux and the container were green.

Reproduced on this machine with /bin/bash 3.2.57 before the change and fixed
with ${TTY[@]+"${TTY[@]}"}; the four tests pass after it, and the fake docker
now receives `bash /src/scripts/linux-check-inner.sh test --workspace`.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Both sides add to the unreleased section; keep both entries.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Both sides add an entry: 13 for the harness that ran nothing, 14 for the
concurrent database lock. Keep both, and make the opening count say fourteen
with 10 and 13 as the test defects and 11, 12 and 14 as the unexplained ones.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
@martin-k-m
martin-k-m merged commit 0bb5497 into main Sep 5, 2026
6 checks passed
@martin-k-m
martin-k-m deleted the fix/linux-check-runs-nothing branch September 5, 2026 06:00
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