Skip to content

Commit

Permalink
Merge pull request #1761 from Kobzol/pin-rustc-fake-version
Browse files Browse the repository at this point in the history
Document Cargo metadata hash
  • Loading branch information
Kobzol authored Dec 4, 2023
2 parents ac048ad + a964397 commit fd0437c
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions collector/src/bin/rustc-fake.rs
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,15 @@ fn determinism_env(cmd: &mut Command) {
// what the actual change between two artifacts is.
cmd.env("RUSTC_FORCE_INCR_COMP_ARTIFACT_HEADER", "rustc-perf");
cmd.env("RUSTC_FORCE_RUSTC_VERSION", "rustc-perf");

// There is another similar source of hashing noise. Cargo queries the version of rustc
// using `rustc -vV`, and then hashes part of the output, and passes it to `rustc` using
// `-Cmetadata`. This means that two different versions of rustc might have a different metadata
// value, and thus different hash value.
// However, for rustc-perf, this is mostly a non-issue, because for nightly releases, cargo
// currently only hashes the host (which should stay the same, for the time being), and the part
// of the rustc version after -, which should be "nightly" for all try builds and also master
// commits.
}

fn run_with_determinism_env(mut cmd: Command) {
Expand All @@ -33,6 +42,7 @@ fn main() {
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 actually_clippy = name.ends_with("clippy-fake");
Expand Down

0 comments on commit fd0437c

Please sign in to comment.