Control: retitle -1 sccache: FTBFS: test failed due to false assert that 
CARGO_HOME is always present
Control: forwarded -1 https://github.com/mozilla/sccache/issues/2303

This is caused by some flawed logic in the test, asserting $CARGO_HOME is 
always present and rustc is at $CARGO_HOME/bin/rustc. I have opened an issue 
upstream and prepared a workaround patch:

Description: Use unqualified rustc if CARGO_HOME lacks a rustc or doesn't exist
 which is an artifact of rustup installed Rust toolchain, we don't have that
 for Debian shipped rustc.
Bug: https://github.com/mozilla/sccache/issues/2303
Last-Update: 2024-12-25
--- a/src/compiler/rust.rs
+++ b/src/compiler/rust.rs
@@ -3167,11 +3167,12 @@
     #[test]
     fn test_rlib_dep_reader_call() {
         let cargo_home = std::env::var("CARGO_HOME");
-        assert!(cargo_home.is_ok());

-        let mut rustc_path = PathBuf::from(cargo_home.unwrap());
-        rustc_path.push("bin");
-        rustc_path.push("rustc");
+        let rustc_path = cargo_home.ok()
+            .map(PathBuf::from)
+            .map(|mut path| { path.push("bin"); path.push("rustc"); path })
+            .map(|path| if path.exists() { path } else { "rustc".into() })
+            .unwrap();
         let rlib_dep_reader = RlibDepReader::new_with_check(rustc_path, &[]);
         assert!(rlib_dep_reader.is_ok());
     }

-- 
Sdrager,
Blair Noctis

Attachment: OpenPGP_signature.asc
Description: OpenPGP digital signature

Reply via email to