Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 0 additions & 1 deletion creusot-rustc/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@ publish = false
[dependencies]
serde_json = { version = "1.0" }
creusot = { path = "../creusot", version = "0.4" }
toml = "0.8"
env_logger = "0.11"
serde = { version = "1.0", features = ["derive"] }
creusot-args = { path = "../creusot-args" }
Expand Down
21 changes: 1 addition & 20 deletions creusot-rustc/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ use creusot_args::CREUSOT_RUSTC_ARGS;
use options::CreusotArgs;
use rustc_driver::run_compiler;
use rustc_session::{EarlyDiagCtxt, config::ErrorOutputType};
use std::{env, panic, process::Command};
use std::{env, panic};

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

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

let sysroot = sysroot_path();
args.push(format!("--sysroot={}", sysroot));

match creusot {
Some(creusot) if has_contracts => {
for &arg in CREUSOT_RUSTC_ARGS {
Expand All @@ -84,19 +81,3 @@ fn setup_plugin() {
}
}
}

fn sysroot_path() -> String {
let toolchain: toml::Value = toml::from_str(include_str!("../../rust-toolchain")).unwrap();
let channel = toolchain["toolchain"]["channel"].as_str().unwrap();

let output = Command::new("rustup")
.arg("run")
.arg(channel)
.arg("rustc")
.arg("--print")
.arg("sysroot")
.output()
.unwrap();

String::from_utf8(output.stdout).unwrap().trim().to_owned()
}