From e9c4eb3cd31cd373867369e78b2695f1f5a3c299 Mon Sep 17 00:00:00 2001 From: Weihang Lo Date: Fri, 31 May 2024 09:30:41 -0400 Subject: [PATCH 1/2] chore: update src/tools/rustc-perf This is needed for fixing the missing license issue. See https://github.com/rust-lang/rust/pull/125465. --- src/tools/rustc-perf | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/tools/rustc-perf b/src/tools/rustc-perf index cc81f9654dac3..72daa50ce2350 160000 --- a/src/tools/rustc-perf +++ b/src/tools/rustc-perf @@ -1 +1 @@ -Subproject commit cc81f9654dac3fe08de286907dba747538417afd +Subproject commit 72daa50ce2350f5a9b5ae6dc3ad6babccd14ec0a From 89fb90936877767d47728632252f4bbda0c95a66 Mon Sep 17 00:00:00 2001 From: Weihang Lo Date: Mon, 3 Jun 2024 11:41:31 -0400 Subject: [PATCH 2/2] feat(opt-dist): respect existing .cargo/config.toml Respect `.cargo/config.toml` in the rustc source. This is useful when the source is from a tarball and contains vendored source settings. --- src/tools/opt-dist/src/training.rs | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/src/tools/opt-dist/src/training.rs b/src/tools/opt-dist/src/training.rs index 46040e32a0399..dc803aed166c0 100644 --- a/src/tools/opt-dist/src/training.rs +++ b/src/tools/opt-dist/src/training.rs @@ -36,7 +36,7 @@ fn init_compiler_benchmarks( // Run rustc-perf benchmarks // Benchmark using profile_local with eprintln, which essentially just means // don't actually benchmark -- just make sure we run rustc a bunch of times. - cmd(&[ + let mut cmd = cmd(&[ env.cargo_stage_0().as_str(), "run", "-p", @@ -61,7 +61,16 @@ fn init_compiler_benchmarks( .env("RUST_LOG", "collector=debug") .env("RUSTC", env.rustc_stage_0().as_str()) .env("RUSTC_BOOTSTRAP", "1") - .workdir(&env.rustc_perf_dir()) + .workdir(&env.rustc_perf_dir()); + + // Respect `.cargo/config.toml` in the rustc source. This is useful when the + // source is from a tarball and contains vendored source settings. + let dot_cargo_config_toml = env.checkout_path().join(".cargo").join("config.toml"); + if dot_cargo_config_toml.is_file() { + cmd.arg("--cargo-config").arg(dot_cargo_config_toml); + } + + cmd } /// Describes which `llvm-profdata` binary should be used for merging PGO profiles.