Fix run --dep

This commit is contained in:
Oli Scherer 2024-09-16 10:26:42 +02:00
parent 987702f6b9
commit 4dabcc3ab4
2 changed files with 8 additions and 3 deletions

View File

@ -503,9 +503,13 @@ fn run(
// More flags that we will pass before `flags`
// (because `flags` may contain `--`).
let mut early_flags = Vec::<OsString>::new();
if let Some(target) = &target {
early_flags.push("--target".into());
early_flags.push(target.into());
// In `dep` mode, the target is already passed via `MIRI_TEST_TARGET`
if !dep {
if let Some(target) = &target {
early_flags.push("--target".into());
early_flags.push(target.into());
}
}
early_flags.push("--edition".into());
early_flags.push(edition.as_deref().unwrap_or("2021").into());

View File

@ -337,6 +337,7 @@ fn run_dep_mode(target: String, args: impl Iterator<Item = OsString>) -> Result<
let build_manager = BuildManager::one_off(config);
let mut cmd = test_config.config.program.build(&test_config.config.out_dir);
cmd.arg("--target").arg(test_config.config.target.as_ref().unwrap());
// Build dependencies
test_config.apply_custom(&mut cmd, &build_manager).unwrap();