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 9fac9c7
Showing 1 changed file with 14 additions and 1 deletion.
15 changes: 14 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 @@ -3108,6 +3108,19 @@ proc_macro false
assert_eq!(res[2], "lucet_runtime_macros");
}

#[cfg(feature = "dist-client")]
#[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());
}

fn mock_dep_info(creator: &Arc<Mutex<MockCommandCreator>>, dep_srcs: &[&str]) {
// Mock the `rustc --emit=dep-info` process by writing
// a dep-info file.
Expand Down

0 comments on commit 9fac9c7

Please sign in to comment.