You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
fix(xtask): stop nested cargo from rebuilding the TLS stack every run (bd-awchm8w7)
Every xtask subcommand that shells out to a nested cargo (stage-doc-examples,
verify, build-all, test) inherits the outer `cargo xtask` process's package
env vars — most importantly CARGO_MANIFEST_DIR=.../crates/xtask. The `ring`
build script (base of q2's rustls/reqwest TLS stack) fingerprints
CARGO_MANIFEST_DIR, so the inherited value marks it dirty and forces a full
multi-minute rebuild of that dependency closure on every nested invocation
whenever the prior build came from a plain shell or `cargo build --workspace`.
Diagnosed while investigating a "stage-doc-examples hangs" report: the hang
was this rebuild, hidden by the `--quiet` flag on the nested `cargo run`.
Fingerprint log: EnvVarChanged { name: "CARGO_MANIFEST_DIR", old_value: None,
new_value: Some(".../crates/xtask") }.
- Add util::strip_inherited_cargo_env / util::nested_command, which mark the
package-scoped CARGO_* vars (CARGO_MANIFEST_DIR, CARGO_PKG_*, OUT_DIR, …)
for removal so a nested cargo fingerprints as a fresh shell would. PATH,
CARGO_HOME, RUSTFLAGS, etc. are left untouched.
- Route stage_doc_examples, verify (run_command), build_all (run_command),
and test through it. Drop `--quiet` from the stage-doc render so a genuine
compile or lock-wait is visible instead of a silent hang.
Verified end-to-end with CARGO_LOG fingerprint logging: after a clean-shell
`cargo build --workspace`, the nested xtask builds show 0 TLS-stack rebuilds,
stable in both directions. 80/80 xtask tests pass; clean -D warnings build.
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
0 commit comments