Skip to content

Commit

Permalink
restore the RUSTC/RUSTDOC env after rustc-fake cmd substitution
Browse files Browse the repository at this point in the history
  • Loading branch information
csmoe committed Apr 26, 2023
1 parent 0496037 commit 77ed6e4
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 5 deletions.
12 changes: 12 additions & 0 deletions collector/compile-benchmarks/cargo-0.60.0/1-feature.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
diff --git a/Cargo.toml b/Cargo.toml
index 12ee1eec..9a92219e 100644
--- a/Cargo.toml
+++ b/Cargo.toml
@@ -205,6 +205,7 @@ version = "0.4.26"
default-features = false

[features]
+default = [ "vendored-openssl" ]
deny-warnings = []
pretty-env-logger = ["pretty_env_logger"]
vendored-openssl = ["openssl/vendored"]
7 changes: 4 additions & 3 deletions collector/src/bin/rustc-fake.rs
Original file line number Diff line number Diff line change
Expand Up @@ -32,16 +32,17 @@ fn main() {
let mut args_os = env::args_os();
let name = args_os.next().unwrap().into_string().unwrap();

let mut args = args_os.collect::<Vec<_>>();
let rustc = env::var_os("RUSTC_REAL").unwrap();
let actually_rustdoc = name.ends_with("rustdoc-fake");
let tool = if actually_rustdoc {
let rustdoc = env::var_os("RUSTDOC_REAL").unwrap();
rustdoc
} else {
rustc
// rustc
args_os.next().unwrap()
};

let mut args = args_os.collect::<Vec<_>>();

if let Some(count) = env::var("RUSTC_THREAD_COUNT")
.ok()
.and_then(|v| v.parse::<u32>().ok())
Expand Down
4 changes: 2 additions & 2 deletions collector/src/execute/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -148,8 +148,8 @@ impl<'a> CargoProcess<'a> {
cmd
// Not all cargo invocations (e.g. `cargo clean`) need all of these
// env vars set, but it doesn't hurt to have them.
.env("RUSTC", &*FAKE_RUSTC)
.env("RUSTC_REAL", &self.compiler.rustc)
.env("RUSTC_WRAPPER", &*FAKE_RUSTC)
.env("RUSTC", &self.compiler.rustc)
// We separately pass -Cincremental to the leaf crate --
// CARGO_INCREMENTAL is cached separately for both the leaf crate
// and any in-tree dependencies, and we don't want that; it wastes
Expand Down

0 comments on commit 77ed6e4

Please sign in to comment.