Skip to content

Commit

Permalink
Pass correct argument to rustc -Z ls
Browse files Browse the repository at this point in the history
Behavior was changed back in rustc 1.74.

Fixes #2290
  • Loading branch information
Alexandre Lissy committed Nov 21, 2024
1 parent b0a6355 commit 2e60de4
Showing 1 changed file with 13 additions and 1 deletion.
14 changes: 13 additions & 1 deletion src/compiler/rust.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2372,7 +2372,7 @@ impl RlibDepReader {
trace!("Discovering dependencies of {}", rlib.display());

let mut cmd = process::Command::new(&self.executable);
cmd.args(["-Z", "ls"])
cmd.args(["-Z", "ls=root"])
.arg(rlib)
.env_clear()
.envs(env_vars.to_vec())
Expand Down Expand Up @@ -3582,4 +3582,16 @@ proc_macro false

assert_eq!(h.profile, Some("foo-a1b6419f8321841f.profraw".into()));
}

#[test]
fn test_rlib_dep_reader() {
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 rlib_dep_reader = RlibDepReader::new_with_check(rustc_path, &[]);
assert!(rlib_dep_reader.is_ok());
}
}

0 comments on commit 2e60de4

Please sign in to comment.