Skip to content

Commit f80e062

Browse files
arnaudgolfouseLysxia
authored andcommitted
Do not pass the sysroot flag to rustc
This is no longer needed: simply linking against rustc_driver does the job. See rust-lang/rust#103660.
1 parent a553e0b commit f80e062

File tree

3 files changed

+1
-22
lines changed

3 files changed

+1
-22
lines changed

Cargo.lock

-1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

creusot-rustc/Cargo.toml

-1
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,6 @@ publish = false
99
[dependencies]
1010
serde_json = { version = "1.0" }
1111
creusot = { path = "../creusot", version = "0.4" }
12-
toml = "0.8"
1312
env_logger = "0.11"
1413
serde = { version = "1.0", features = ["derive"] }
1514
creusot-args = { path = "../creusot-args" }

creusot-rustc/src/main.rs

+1-20
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ use creusot_args::CREUSOT_RUSTC_ARGS;
1616
use options::CreusotArgs;
1717
use rustc_driver::run_compiler;
1818
use rustc_session::{EarlyDiagCtxt, config::ErrorOutputType};
19-
use std::{env, panic, process::Command};
19+
use std::{env, panic};
2020

2121
const BUG_REPORT_URL: &str = "https://github.com/creusot-rs/creusot/issues/new";
2222

@@ -62,9 +62,6 @@ fn setup_plugin() {
6262
let has_contracts =
6363
args.iter().any(|arg| arg == "creusot_contracts" || arg.contains("creusot_contracts="));
6464

65-
let sysroot = sysroot_path();
66-
args.push(format!("--sysroot={}", sysroot));
67-
6865
match creusot {
6966
Some(creusot) if has_contracts => {
7067
for &arg in CREUSOT_RUSTC_ARGS {
@@ -84,19 +81,3 @@ fn setup_plugin() {
8481
}
8582
}
8683
}
87-
88-
fn sysroot_path() -> String {
89-
let toolchain: toml::Value = toml::from_str(include_str!("../../rust-toolchain")).unwrap();
90-
let channel = toolchain["toolchain"]["channel"].as_str().unwrap();
91-
92-
let output = Command::new("rustup")
93-
.arg("run")
94-
.arg(channel)
95-
.arg("rustc")
96-
.arg("--print")
97-
.arg("sysroot")
98-
.output()
99-
.unwrap();
100-
101-
String::from_utf8(output.stdout).unwrap().trim().to_owned()
102-
}

0 commit comments

Comments
 (0)