From a756a78f7df692670748f8027ef50c570564177c Mon Sep 17 00:00:00 2001 From: Leon Matthes Date: Fri, 19 Jan 2024 17:06:47 +0100 Subject: [PATCH 1/2] Use RUSTC_WRAPPER if no other wrapper is provided Previously, the `rustc_wrapper_fallback` was only called if the tool was **not** a full path. With this patch, the `RUSTC_WRAPPER` is always used, even if the tool provided is an exact path. Providing a wrapper manually is still possible and overrides the `RUSTC_WRAPPER`. If the path to the tool includes spaces it is otherwise impossible to provide a compiler cache like sccache through the CXX or CC environment variables, as the arguments will be split up incorrectly. See also: https://github.com/corrosion-rs/corrosion/pull/474 --- src/lib.rs | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/lib.rs b/src/lib.rs index 0a5b2ae35..96a6b90c7 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -2761,7 +2761,11 @@ impl Build { // interpretation at all, just pass it on through. This'll hopefully get // us to support spaces-in-paths. if Path::new(&*tool).exists() { - return Some((PathBuf::from(&*tool), None, Vec::new())); + return Some(( + PathBuf::from(&*tool), + Self::rustc_wrapper_fallback(), + Vec::new(), + )); } // Ok now we want to handle a couple of scenarios. We'll assume from From 3ca9f307f9e5f7d9de31791155b69f4f832ec0c5 Mon Sep 17 00:00:00 2001 From: Leon Matthes Date: Fri, 26 Jan 2024 10:11:38 +0100 Subject: [PATCH 2/2] Add #[allow(dead_code)] to ArchSpec::Catalyst This should suppress new warnings generated by the nightly toolchain. --- src/lib.rs | 1 + 1 file changed, 1 insertion(+) diff --git a/src/lib.rs b/src/lib.rs index 96a6b90c7..6856d4b30 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -2382,6 +2382,7 @@ impl Build { enum ArchSpec { Device(&'static str), Simulator(&'static str), + #[allow(dead_code)] Catalyst(&'static str), }