]> git.lizzy.rs Git - rust.git/commitdiff
compiletest can just propagate MIRI_SYSROOT from the outside
authorRalf Jung <post@ralfj.de>
Sun, 7 Apr 2019 08:55:34 +0000 (10:55 +0200)
committerRalf Jung <post@ralfj.de>
Sun, 7 Apr 2019 08:58:06 +0000 (10:58 +0200)
tests/compiletest.rs

index 38a9d31d6e89155023cd9473c0aecbd9e21a7eb5..0ee8ca130ae0bb8464ed5a555f00266240609a29 100644 (file)
@@ -87,22 +87,6 @@ fn miri_pass(path: &str, target: &str, opt: bool) {
     compiletest::run_tests(&config);
 }
 
-/// Ensures that the `MIRI_SYSROOT` env var is set.
-fn set_sysroot() {
-    if std::env::var("MIRI_SYSROOT").is_ok() {
-        // Nothing to do.
-        return;
-    }
-    let sysroot = std::process::Command::new("rustc")
-        .arg("--print")
-        .arg("sysroot")
-        .output()
-        .expect("rustc not found")
-        .stdout;
-    let sysroot = String::from_utf8(sysroot).expect("sysroot is not utf8");
-    std::env::set_var("MIRI_SYSROOT", sysroot.trim());
-}
-
 fn get_host() -> String {
     let rustc = rustc_test_suite().unwrap_or(PathBuf::from("rustc"));
     let rustc_version = std::process::Command::new(rustc)
@@ -129,8 +113,6 @@ fn compile_fail_miri(opt: bool) {
 }
 
 fn test_runner(_tests: &[&()]) {
-    set_sysroot();
-
     run_pass_miri(false);
     run_pass_miri(true);