Skip to content

Commit 71b9952

Browse files
Avoid incremental benchmarks for rustdoc
1 parent 105ab92 commit 71b9952

File tree

1 file changed

+36
-28
lines changed

1 file changed

+36
-28
lines changed

collector/src/execute.rs

Lines changed: 36 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -968,39 +968,47 @@ impl Benchmark {
968968
.run_rustc()?;
969969
}
970970

971-
// An incremental build from scratch (slowest incremental case).
972-
// This is required for any subsequent incremental builds.
973-
if run_kinds.contains(&RunKind::IncrFull)
974-
|| run_kinds.contains(&RunKind::IncrUnchanged)
975-
|| run_kinds.contains(&RunKind::IncrPatched)
976-
{
977-
self.mk_cargo_process(compiler, cwd, build_kind)
978-
.incremental(true)
979-
.processor(processor, RunKind::IncrFull, "IncrFull", None)
980-
.run_rustc()?;
981-
}
982-
983-
// An incremental build with no changes (fastest incremental case).
984-
if run_kinds.contains(&RunKind::IncrUnchanged) {
985-
self.mk_cargo_process(compiler, cwd, build_kind)
986-
.incremental(true)
987-
.processor(processor, RunKind::IncrUnchanged, "IncrUnchanged", None)
988-
.run_rustc()?;
989-
}
990-
991-
if run_kinds.contains(&RunKind::IncrPatched) {
992-
for (i, patch) in self.patches.iter().enumerate() {
993-
log::debug!("applying patch {}", patch.name);
994-
patch.apply(cwd).map_err(|s| anyhow::anyhow!("{}", s))?;
971+
// Rustdoc does not support incremental compilation
972+
if build_kind != BuildKind::Doc {
973+
// An incremental build from scratch (slowest incremental case).
974+
// This is required for any subsequent incremental builds.
975+
if run_kinds.contains(&RunKind::IncrFull)
976+
|| run_kinds.contains(&RunKind::IncrUnchanged)
977+
|| run_kinds.contains(&RunKind::IncrPatched)
978+
{
979+
self.mk_cargo_process(compiler, cwd, build_kind)
980+
.incremental(true)
981+
.processor(processor, RunKind::IncrFull, "IncrFull", None)
982+
.run_rustc()?;
983+
}
995984

996-
// An incremental build with some changes (realistic
997-
// incremental case).
998-
let run_kind_str = format!("IncrPatched{}", i);
985+
// An incremental build with no changes (fastest incremental case).
986+
if run_kinds.contains(&RunKind::IncrUnchanged) {
999987
self.mk_cargo_process(compiler, cwd, build_kind)
1000988
.incremental(true)
1001-
.processor(processor, RunKind::IncrPatched, &run_kind_str, Some(&patch))
989+
.processor(processor, RunKind::IncrUnchanged, "IncrUnchanged", None)
1002990
.run_rustc()?;
1003991
}
992+
993+
if run_kinds.contains(&RunKind::IncrPatched) {
994+
for (i, patch) in self.patches.iter().enumerate() {
995+
log::debug!("applying patch {}", patch.name);
996+
patch.apply(cwd).map_err(|s| anyhow::anyhow!("{}", s))?;
997+
998+
// An incremental build with some changes (realistic
999+
// incremental case).
1000+
let run_kind_str = format!("IncrPatched{}", i);
1001+
self.mk_cargo_process(compiler, cwd, build_kind)
1002+
.incremental(true)
1003+
.processor(
1004+
processor,
1005+
RunKind::IncrPatched,
1006+
&run_kind_str,
1007+
Some(&patch),
1008+
)
1009+
.run_rustc()?;
1010+
}
1011+
}
10041012
}
10051013
}
10061014
}

0 commit comments

Comments
 (0)