rust-missing-cc-linker-build-script-rc101
Solution written to ~/rust-missing-cc-linker-build-script-rc101.md.
Diagnosis (reproduced, not theorized): cargo build fails rc=101 because rustc links every binary — including build-script binaries — via the bare command cc. On a bare host cc is absent, so libc's build script never even runs, producing the misleading could not compile 'libc' (build script). Removing /usr/bin from PATH reproduced the error byte-identically.
Fix (verified end-to-end, no sudo):
1. Downloaded the static zig tarball to ~/tools/zig.
2. Created ~/tools/bin/{cc,c++,ar,ranlib} wrappers that exec zig <subcommand> "$@".
3. export PATH="$HOME/tools/bin:$PATH" CC=cc CXX=c++ AR=ar RANLIB=ranlib.
4. Rebuilt with /usr/bin still absent → rc=0, binary runs, ldd confirms a real native link; zig cc reports clang 18.1.6.
Grading fixes validated:
- Signature classifier returns ENV-BLOCKED for the linker/build-script signature, PASS on success, and FAIL for genuine error[E0432] — the error[E####] exclusion correctly overrides the signature.
- Demonstrated the chaos-disconnect guard: an rc=101 probe that never reached the network grades UNVERIFIED (marker absent), never OK.
The document includes the root-cause analysis, copy-paste install commands, an arch-aware one-shot bootstrap script, the classifier, the rc != 0 guard, and the full verification transcript.
# Evidence - Problem class: rust-missing-cc-linker-build-script-rc101 - Model: openrouter/deepseek/deepseek-v4.1-flash - Solved: 2026-09-19T14:38:40.143Z - Verification: solution produced by pi in sandbox; see signatures.json
{"description": "Rust cargo build/test on a toolchain-bare machine (no cc/gcc/clang, no sudo) fails rc=101 with `error: linker `cc` not found` / `could not compile `libc` (build script)` \u2014 an ENVIRONMENT gap, not a repo defect. Verified fix pattern (<project> QA-WARPFS-9, 2026-09-19): (1) reproduce cheaply with PATH stripped of /usr/bin \u2014 the error is byte-identical; (2) install a user-space zig toolchain (static tarball, ~/tools/bin wrappers cc/c++/ar/ranlib exec zig subcommands, export CC=cc CXX=c++) so the build can really run without sudo; (3) classifiers that grade build results must match the toolchain signature (linker `cc` not found | could not compile .*(build script)) AND exclude logs carrying genuine error[E####] diagnostics, then grade ENV-BLOCKED/UNVERIFIED instead of FAIL; (4) never grade a nonzero rc as a pass for an unrelated probe \u2014 a chaos-disconnect cell graded the rc=101 compile failure as OK fails-fast when the network cut was never exercised.", "environment": "", "language": "", "model": "openrouter/deepseek/deepseek-v4.1-flash", "problem_class": "rust-missing-cc-linker-build-script-rc101", "provider": "openrouter", "solved_at": "2026-09-19T14:38:40.143Z", "version": ""}Solution written to ~/rust-missing-cc-linker-build-script-rc101.md.
Diagnosis (reproduced, not theorized): cargo build fails rc=101 because rustc links every binary — including build-script binaries — via the bare command cc. On a bare host cc is absent, so libc's build script never even runs, producing the misleading could not compile 'libc' (build script). Removing /usr/bin from PATH reproduced the error byte-identically.
Fix (verified end-to-end, no sudo):
1. Downloaded the static zig tarball to ~/tools/zig.
2. Created ~/tools/bin/{cc,c++,ar,ranlib} wrappers that exec zig <subcommand> "$@".
3. export PATH="$HOME/tools/bin:$PATH" CC=cc CXX=c++ AR=ar RANLIB=ranlib.
4. Rebuilt with /usr/bin still absent → rc=0, binary runs, ldd confirms a real native link; zig cc reports clang 18.1.6.
Grading fixes validated:
- Signature classifier returns ENV-BLOCKED for the linker/build-script signature, PASS on success, and FAIL for genuine error[E0432] — the error[E####] exclusion correctly overrides the signature.
- Demonstrated the chaos-disconnect guard: an rc=101 probe that never reached the network grades UNVERIFIED (marker absent), never OK.
The document includes the root-cause analysis, copy-paste install commands, an arch-aware one-shot bootstrap script, the classifier, the rc != 0 guard, and the full verification transcript.
# Evidence - Problem class: rust-missing-cc-linker-build-script-rc101 - Model: openrouter/deepseek/deepseek-v4.1-flash - Solved: 2026-09-19T14:38:40.143Z - Verification: solution produced by pi in sandbox; see signatures.json
{"description": "Rust cargo build/test on a toolchain-bare machine (no cc/gcc/clang, no sudo) fails rc=101 with `error: linker `cc` not found` / `could not compile `libc` (build script)` \u2014 an ENVIRONMENT gap, not a repo defect. Verified fix pattern (<project> QA-WARPFS-9, 2026-09-19): (1) reproduce cheaply with PATH stripped of /usr/bin \u2014 the error is byte-identical; (2) install a user-space zig toolchain (static tarball, ~/tools/bin wrappers cc/c++/ar/ranlib exec zig subcommands, export CC=cc CXX=c++) so the build can really run without sudo; (3) classifiers that grade build results must match the toolchain signature (linker `cc` not found | could not compile .*(build script)) AND exclude logs carrying genuine error[E####] diagnostics, then grade ENV-BLOCKED/UNVERIFIED instead of FAIL; (4) never grade a nonzero rc as a pass for an unrelated probe \u2014 a chaos-disconnect cell graded the rc=101 compile failure as OK fails-fast when the network cut was never exercised.", "environment": "", "language": "", "model": "openrouter/deepseek/deepseek-v4.1-flash", "problem_class": "rust-missing-cc-linker-build-script-rc101", "provider": "openrouter", "solved_at": "2026-09-19T14:38:40.143Z", "version": ""}