Skip to content

fix(bootstrap): make cargo test compile again -- honest server gates, E0716 (#5448) - #5455

Merged
gHashTag merged 1 commit into
masterfrom
fix/bootstrap-tests-compile-5448
Oct 2, 2026
Merged

gHashTag merged 1 commit into
masterfrom
fix/bootstrap-tests-compile-5448

Conversation

@gHashTag

@gHashTag gHashTag commented Oct 1, 2026

Copy link
Copy Markdown
Owner

Closes #5448

Root causes

  1. bootstrap/src/proxy.rs gate was dishonest. Everything was under #[cfg(any(feature = "server", test))], but axum and tokio are optional dependencies enabled only by feature = "server", and AppState/Session in main.rs are under #[cfg(feature = "server")]. So a plain cargo test turned the code on without its crates, and the t27c bin test target failed with E0433/E0432. The same commit (proxy.rs tests are stripped before type-checking — no workflow passes --features server #4758) also rewrote builder.build(connector).request(req) as builder.request(req). That method does not exist on the hyper_util legacy Builder (E0599), so cargo build --features server, which both Dockerfiles run, was broken too.
  2. bootstrap/tests/corpus_unresolved.rs E0716. let mut cmd = Command::new(..).args(..).args(extra); binds a &mut to a temporary Command that is dropped at the end of the statement.

A compile error stops cargo test even with --no-fail-fast, so no bootstrap test ran on master.

Fix

Verification (--release --offline -p t27c)

config --no-run
default compiles, 115 test executables
--features server compiles, 115 test executables

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

🤖 Generated with Claude Code

… 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>
@github-actions

github-actions Bot commented Oct 1, 2026

Copy link
Copy Markdown
Contributor

PR Dashboard

Generated at: 2026-10-01 17:47:22 UTC

Summary

Status Count
Total Open PRs 50
PRs with Failing Checks 47
PRs with All Checks Green 3
READY 3
FAILING 47
PENDING 0
NO CHECKS YET 0

Seal Status

  • ⚠️ STALE -- sha256(compiler.rs)=b7d5cc5c4cf1 != manifest seal=87e5cbd3ad94.
    The committed NMSE numbers were certified against an older compiler.rs.
    Run scripts/reseal-check.sh locally for the two-step reseal command (advisory; not a merge gate).

@github-actions

github-actions Bot commented Oct 1, 2026

Copy link
Copy Markdown
Contributor

📓 NotebookLM Notebook linked to this PR

This notebook contains session context, decisions, and artifacts for this work.

This was referenced Oct 1, 2026
This was referenced Oct 2, 2026
@gHashTag gHashTag added the bee-reviewed A reviewer bee reviewed and verified this PR at its current head; the only merge signal (#5525) label Oct 2, 2026
@gHashTag

gHashTag commented Oct 2, 2026

Copy link
Copy Markdown
Owner Author

Reviewer bee W -- verified at head 9424451d08.

The title's claim matches the diff: cargo test compiles again. In proxy.rs, the gates are narrowed to #[cfg(feature = "server")], HeaderMap/Uri come from hyper under any(server, test), and Client::builder(..).build(connector) + client.request(req) are restored. In corpus_unresolved.rs, the E0716 temporary-borrow chain is split into let mut cmd. Master still carries all three faults.

Evidence (fresh clone under /tmp, --offline --release -j 4):

  • cargo test --no-run (default features): every test target compiles.
  • cargo build --features server: Finished, no errors.
  • cargo test --bin t27c proxy::: 2 passed.
  • cargo test --test corpus_unresolved: 6 passed, 1 failed: each_backend_artefact_write_is_guarded_at_its_own_call_site. That is NOT caused by this PR. The test plants a directory named c.rs under TMPDIR/t27-corpus, but master's service.rs now writes c-<pid>.rs (tmp.join(format!("c-{}.rs", std::process::id()))), so the EISDIR trap never fires. The test went stale while it could not compile; this PR only makes that visible. It needs a follow-up issue: the test should plant c-* names, or the corpus should expose the artefact path.

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bee-reviewed A reviewer bee reviewed and verified this PR at its current head; the only merge signal (#5525)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

bootstrap tests don't compile on master: t27c bin test target (axum under cfg(test)) and tests/corpus_unresolved.rs (E0716)

1 participant