Skip to content

Commit e6aabe8

Browse files
committed
Auto merge of #12743 - paulmenage:fix-rustc-print-target, r=weihanglo
Use full target spec for `cargo rustc --print --target` `cargo::ops::cargo_compile::print()` was using the shortname for the `--target` flag to rustc, but should be using the full target spec; otherwise a JSON-specified target (e.g. `--target /path/to/some-custom-target.json`) will cause a rustc error such as `error: Error loading target specification: Could not find specification for target "some-custom-target". Run rustc --print target-list for a list of built-in targets`
2 parents 25dc3bd + cb1b2ac commit e6aabe8

File tree

1 file changed

+1
-1
lines changed
  • src/cargo/ops/cargo_compile

1 file changed

+1
-1
lines changed

src/cargo/ops/cargo_compile/mod.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -184,7 +184,7 @@ pub fn print<'a>(
184184
process.args(args);
185185
}
186186
if let CompileKind::Target(t) = kind {
187-
process.arg("--target").arg(t.short_name());
187+
process.arg("--target").arg(t.rustc_target());
188188
}
189189
process.arg("--print").arg(print_opt_value);
190190
process.exec()?;

0 commit comments

Comments
 (0)