Skip to content

Commit 3f206ce

Browse files
committed
forward the bootstrap runner to run-make
The runner was already forwarded to `compiletest`, this just passes it on to `run-make` and uses it in the `run` functions.
1 parent aa5832b commit 3f206ce

File tree

3 files changed

+29
-5
lines changed

3 files changed

+29
-5
lines changed

src/tools/compiletest/src/runtest/run_make.rs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -221,6 +221,10 @@ impl TestCx<'_> {
221221
cmd.env("REMOTE_TEST_CLIENT", remote_test_client);
222222
}
223223

224+
if let Some(runner) = &self.config.runner {
225+
cmd.env("RUNNER", runner);
226+
}
227+
224228
// We don't want RUSTFLAGS set from the outside to interfere with
225229
// compiler flags set in the test cases:
226230
cmd.env_remove("RUSTFLAGS");

src/tools/run-make-support/src/run.rs

Lines changed: 23 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
use std::ffi::OsStr;
1+
use std::ffi::{OsStr, OsString};
22
use std::path::PathBuf;
33
use std::{env, panic};
44

@@ -21,6 +21,20 @@ fn run_common(name: &str, args: Option<&[&str]>) -> Command {
2121
// will have to be changed (and the support files will have to be uploaded).
2222
cmd.arg("0");
2323
cmd.arg(bin_path);
24+
cmd
25+
} else if let Ok(runner) = std::env::var("RUNNER") {
26+
let mut args = split_maybe_args(&runner);
27+
28+
let prog = args.remove(0);
29+
let mut cmd = Command::new(prog);
30+
31+
for arg in args {
32+
cmd.arg(arg);
33+
}
34+
35+
cmd.arg("--");
36+
cmd.arg(bin_path);
37+
2438
cmd
2539
} else {
2640
Command::new(bin_path)
@@ -92,3 +106,11 @@ pub fn cmd<S: AsRef<OsStr>>(program: S) -> Command {
92106
command.env("LC_ALL", "C"); // force english locale
93107
command
94108
}
109+
110+
fn split_maybe_args(s: &str) -> Vec<OsString> {
111+
s.split(' ')
112+
.filter_map(|s| {
113+
if s.chars().all(|c| c.is_whitespace()) { None } else { Some(OsString::from(s)) }
114+
})
115+
.collect()
116+
}

tests/run-make/c-link-to-rust-va-list-fn/rmake.rs

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,12 +3,10 @@
33
// prevent the creation of a functional binary.
44
// See https://github.com/rust-lang/rust/pull/49878
55

6-
//@ ignore-cross-compile
7-
8-
use run_make_support::{cc, extra_c_flags, run, rustc, static_lib_name};
6+
use run_make_support::{cc, extra_c_flags, run, rustc, static_lib_name, target};
97

108
fn main() {
11-
rustc().input("checkrust.rs").run();
9+
rustc().input("checkrust.rs").target(target()).run();
1210
cc().input("test.c")
1311
.input(static_lib_name("checkrust"))
1412
.out_exe("test")

0 commit comments

Comments
 (0)