Expand description
The RUSTC_WRAPPER of the instrumented build.
Only workspace crates are instrumented: instrumenting wasmtime and
cranelift made every wasm compile in the suite several times slower, and
their records were thrown away anyway. RUSTFLAGS cannot say “workspace
only”, so cargo runs this executable in front of every rustc. A crate whose
manifest lives under the workspace root gets -Cinstrument-coverage appended
and still goes through the wrapper the environment had before: the flag is
then part of sccache’s argv, hence of its cache key, so an instrumented
artifact is never stored under a key that lacks it. Everything else goes
through that wrapper unchanged.
A compilation with an explicit --target is left alone as well: the suite
starts wasm32 builds, and that target has no profiler runtime.
RUSTC_WORKSPACE_WRAPPER would not do: cargo nests it inside
RUSTC_WRAPPER, so sccache would sit outside it.
Structs§
- Invocation 🔒
- The program and arguments to run in place of the wrapper itself.
Constants§
- COVERAGE_
FLAG 🔒 - PREVIOUS_
VAR 🔒 - Presence switches
maininto wrapper mode; the value is the wrapper that was set before, possibly empty. - ROOT_
VAR 🔒
Functions§
- cross_
compiles 🔒 - intercept
- Runs as the wrapper when the marker is set and cargo’s call shape matches.
Nonemeans this is a normal xtask invocation, including one a test spawned under the marker it inherited;Someis only ever the failure to start rustc, because success replaces this process. - is_
rustc_ 🔒call - Cargo runs
$RUSTC_WRAPPER <rustc> <args…>, the rustc being a path or a bare name; an xtask invocation starts with a subcommand instead. - plan 🔒
argvis what cargo passed: the rustc to run, then its arguments.- split 🔒
- wrapper_
env 🔒 - The environment that makes cargo route every rustc through this executable.