Skip to content

Commit

Permalink
Rollup merge of #71002 - Freax13:fix-target, r=ollie27
Browse files Browse the repository at this point in the history
fix target & runtool args order

- `TargetTripple::to_string` converts "path triples" to `<target>-<hash>`, but in this case we need the path. Afaict there is no method to get the real triple other than manually matching
- the order of the runtools arguments is inconsistent with the way tests usually pass arguments ie using `runner` key in `.cargo/config`
  • Loading branch information
Dylan-DPC authored Apr 14, 2020
2 parents e2f2423 + 54b5d30 commit 119e32b
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions src/librustdoc/test.rs
Original file line number Diff line number Diff line change
Expand Up @@ -263,7 +263,12 @@ fn run_test(
if no_run && !compile_fail {
compiler.arg("--emit=metadata");
}
compiler.arg("--target").arg(target.to_string());
compiler.arg("--target").arg(match target {
TargetTriple::TargetTriple(s) => s,
TargetTriple::TargetPath(path) => {
path.to_str().expect("target path must be valid unicode").to_string()
}
});

compiler.arg("-");
compiler.stdin(Stdio::piped());
Expand Down Expand Up @@ -312,8 +317,8 @@ fn run_test(

if let Some(tool) = runtool {
cmd = Command::new(tool);
cmd.arg(output_file);
cmd.args(runtool_args);
cmd.arg(output_file);
} else {
cmd = Command::new(output_file);
}
Expand Down

0 comments on commit 119e32b

Please sign in to comment.