Skip to content

Commit 96b71fb

Browse files
Assert only final rustc
1 parent be31ac4 commit 96b71fb

File tree

2 files changed

+10
-0
lines changed

2 files changed

+10
-0
lines changed

collector/src/execute.rs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -310,6 +310,10 @@ impl<'a> CargoProcess<'a> {
310310
// we want to wrap rustc.
311311
if let Some((ref mut processor, ..)) = self.processor_etc {
312312
let profiler = processor.profiler(self.build_kind).name();
313+
// If we're using a processor, we expect that only the crate
314+
// we're interested in benchmarking will be built, not any
315+
// dependencies.
316+
cmd.env("EXPECT_ONLY_WRAPPED_RUSTC", "1");
313317
cmd.arg("--wrap-rustc-with");
314318
cmd.arg(profiler);
315319
cmd.args(&self.rustc_args);

collector/src/rustc-fake.rs

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -215,6 +215,12 @@ fn main() {
215215
}
216216
}
217217
} else {
218+
if env::var_os("EXPECT_ONLY_WRAPPED_RUSTC").is_some() {
219+
eprintln!("{:?} {:?}", tool, args);
220+
eprintln!("exiting -- non-wrapped rustc");
221+
std::process::exit(1);
222+
}
223+
218224
let mut cmd = Command::new(&tool);
219225
cmd.args(&args);
220226
exec(&mut cmd);

0 commit comments

Comments
 (0)