Skip to content

Commit af622e7

Browse files
committed
attempt to fix miri failing to create file when under weird powershell configurations
1 parent 1c6bfbb commit af622e7

File tree

1 file changed

+8
-5
lines changed

1 file changed

+8
-5
lines changed

cargo-miri/src/phases.rs

+8-5
Original file line numberDiff line numberDiff line change
@@ -348,14 +348,17 @@ pub fn phase_rustc(mut args: impl Iterator<Item = String>, phase: RustcPhase) {
348348
// Create a stub .d file to stop Cargo from "rebuilding" the crate:
349349
// https://github.com/rust-lang/miri/issues/1724#issuecomment-787115693
350350
// As we store a JSON file instead of building the crate here, an empty file is fine.
351-
let dep_info_name = format!(
352-
"{}/{}{}.d",
353-
get_arg_flag_value("--out-dir").unwrap(),
351+
let mut dep_info_name = PathBuf::from(get_arg_flag_value("--out-dir").unwrap());
352+
dep_info_name.push(format!(
353+
"{}{}.d",
354354
get_arg_flag_value("--crate-name").unwrap(),
355355
get_arg_flag_value("extra-filename").unwrap_or_default(),
356-
);
356+
));
357357
if verbose > 0 {
358-
eprintln!("[cargo-miri rustc] writing stub dep-info to `{dep_info_name}`");
358+
eprintln!(
359+
"[cargo-miri rustc] writing stub dep-info to `{}`",
360+
dep_info_name.display()
361+
);
359362
}
360363
File::create(dep_info_name).expect("failed to create fake .d file");
361364
}

0 commit comments

Comments
 (0)