diff --git a/scripts/rustc-wrapper b/scripts/rustc-wrapper index 8095f347f..2ff6be76f 100755 --- a/scripts/rustc-wrapper +++ b/scripts/rustc-wrapper @@ -1,8 +1,14 @@ -#!/bin/sh +#!/bin/bash # Cargo's rustc wrapper for this workspace (`.cargo/config.toml`): Cargo runs it as # `rustc-wrapper RUSTC ARGS...`. It hands the compile to kache, a local compiler cache, where # kache is on PATH and the build is not CI's; anywhere else it runs the compiler itself. kache is a # tool on PATH, never a dependency, and its store stays on the machine. +# +# bash, not sh: the wrapper must hand the compiler the environment Cargo gave it, and Cargo names +# some variables after a target with a hyphen in it (`CARGO_BIN_EXE_corpus-triage`, which `env!` +# reads in the validation crate's integration tests). dash, `/bin/sh` on Debian and Ubuntu, drops +# every variable whose name is not a shell identifier from the environment it passes on; bash +# passes them through. if [ -z "${CI:-}" ] && command -v kache >/dev/null 2>&1; then exec kache "$@" fi