From 17e252bfdf4f7a2dff8e788ef7deab326682bbba Mon Sep 17 00:00:00 2001 From: David Tolnay Date: Mon, 1 Jan 2024 20:37:27 -0800 Subject: [PATCH] Include env-dep:RUSTC_BOOTSTRAP in dep-info for sccache --- build.rs | 2 +- build/probe.rs | 3 +++ 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/build.rs b/build.rs index d515e86..7e95e6b 100644 --- a/build.rs +++ b/build.rs @@ -121,7 +121,7 @@ fn compile_probe(rustc_bootstrap: bool) -> bool { .arg("--edition=2018") .arg("--crate-name=anyhow") .arg("--crate-type=lib") - .arg("--emit=metadata") + .arg("--emit=dep-info,metadata") .arg("--out-dir") .arg(out_dir) .arg(probefile); diff --git a/build/probe.rs b/build/probe.rs index 1dfc244..21e776d 100644 --- a/build/probe.rs +++ b/build/probe.rs @@ -30,3 +30,6 @@ impl Error for MyError { } const _: fn(&dyn Error) -> Option<&Backtrace> = |err| error::request_ref::(err); + +// Include in sccache cache key. +const _: Option<&str> = option_env!("RUSTC_BOOTSTRAP");