fix(bootstrap): make cargo test compile again -- honest server gates, E0716 (#5448) - #5455
Conversation
… E0716 (#5448) On master `cargo test -p t27c` stopped at compile time on two targets, and a compile error halts cargo test even with --no-fail-fast, so no bootstrap test ran at all. 1. proxy.rs gated its axum/tokio code on any(feature = "server", test). axum and tokio are optional, enabled only by the server feature, and AppState/Session in main.rs are gated on the feature alone. A plain cargo test therefore switched the code on without its crates. Every item that touches them is now gated on feature = "server" only. The two token parsers need nothing optional: they take HeaderMap/Uri from hyper (non-optional, the same http 1.x types axum re-exports), so they and their unit tests still type-check and run in a default cargo test. The same change (#4758) had also rewritten builder.build(connector).request(req) into builder.request(req), which does not exist on the hyper_util legacy Builder (E0599). That broke `cargo build --features server`, the command both Dockerfiles run. Restored. 2. tests/corpus_unresolved.rs chained .args() straight off Command::new and bound the resulting &mut to a let, so the Command was a temporary dropped at the end of the statement (E0716). Bind it first, configure it after. Closes #5448 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
📓 NotebookLM Notebook linked to this PR
This notebook contains session context, decisions, and artifacts for this work. |
|
Reviewer bee W -- verified at head The title's claim matches the diff: Evidence (fresh clone under /tmp,
Red checks: test-ratchet and fpga-conformance are also red on #5594 (parser-only). 'Documented t27c subcommands' and duplicate-bodies are red because this base is from Oct 1; the PR adds no subcommand and no body. Corpus ratchet, spec-guards, untrusted-input, coverage and Scorecard are red on master. No money or payments_v2 content. |
Closes #5448
Root causes
bootstrap/src/proxy.rsgate was dishonest. Everything was under#[cfg(any(feature = "server", test))], butaxumandtokioare optional dependencies enabled only byfeature = "server", andAppState/Sessioninmain.rsare under#[cfg(feature = "server")]. So a plaincargo testturned the code on without its crates, and thet27cbin test target failed with E0433/E0432. The same commit (proxy.rs tests are stripped before type-checking — no workflow passes --features server #4758) also rewrotebuilder.build(connector).request(req)asbuilder.request(req). That method does not exist on thehyper_utillegacyBuilder(E0599), socargo build --features server, which both Dockerfiles run, was broken too.bootstrap/tests/corpus_unresolved.rsE0716.let mut cmd = Command::new(..).args(..).args(extra);binds a&mutto a temporaryCommandthat is dropped at the end of the statement.A compile error stops
cargo testeven with--no-fail-fast, so no bootstrap test ran on master.Fix
AppStateorSessionis now gated onfeature = "server"only. No optional crate was made mandatory.HeaderMap/Urifromhyper, which is non-optional and re-exports the samehttp1.x types axum does (Cargo.lock has onehttp1.4.0). That means they and their unit tests still type-check and run in a defaultcargo test, which is what proxy.rs tests are stripped before type-checking — no workflow passes --features server #2301 / proxy.rs tests are stripped before type-checking — no workflow passes --features server #4758 wanted..build(connector)before.request()inproxy_to_container.corpus_unresolved.rs: create theCommandwith its ownletfirst, then configure it.Verification (
--release --offline -p t27c)--no-run--features servercargo test --no-fail-fast(default config): 2762 passed, 2 failed, 2 ignored across 115 targets.proxy::tests::*pass in both configs. With--features server, the bin unit tests give 1739 passed, 0 failed.The two runtime failures existed before this PR. Until now they were hidden behind the compile errors, and this PR does not fix them:
corpus_unresolved::each_backend_artefact_write_is_guarded_at_its_own_call_site: the test blocks the write by pre-creatingt27-corpus/c.rsas a directory. Since Six fixed artefact names in one shared TMPDIR: two concurrent corpus runs corrupt each other's columns, with every unres #4733 the corpus writesc-<pid>.rs, so the trap never fires and the run exits 0 instead of 2. The test is stale against Six fixed artefact names in one shared TMPDIR: two concurrent corpus runs corrupt each other's columns, with every unres #4733.icarus_lowerable::corpus_classifier_matches_lean_completeness: there are new Rust/Lean lowerability disagreements that are not in the ledger:nn_phi_ropeandnn_sacred_attention(Rust=false, Lean theorem=true).🤖 Generated with Claude Code