Skip to content

Commit 9e1cd0f

Browse files
committed
Add a few missing Doc variants
- Add 'Doc' to CLI help - Make Doc a default BuildKind when --builds is not passed
1 parent 40ea2ef commit 9e1cd0f

File tree

3 files changed

+20
-8
lines changed

3 files changed

+20
-8
lines changed

collector/src/bin/rustc-perf-collector/execute.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -238,7 +238,7 @@ impl<'a> CargoProcess<'a> {
238238
.env("RUSTC", &*FAKE_RUSTC)
239239
.env("RUSTDOC", &*FAKE_RUSTDOC)
240240
.env("RUSTC_REAL", &self.compiler.rustc)
241-
.env("RUSTDOC_REAL", dbg!(&self.compiler.rustdoc))
241+
.env("RUSTDOC_REAL", &self.compiler.rustdoc)
242242
.env(
243243
"CARGO_INCREMENTAL",
244244
&format!("{}", self.incremental as usize),
@@ -247,7 +247,7 @@ impl<'a> CargoProcess<'a> {
247247
.arg(subcommand)
248248
.arg("--manifest-path")
249249
.arg(&self.manifest_path);
250-
dbg!(cmd)
250+
cmd
251251
}
252252

253253
fn get_pkgid(&self, cwd: &Path) -> String {

collector/src/bin/rustc-perf-collector/main.rs

Lines changed: 17 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -55,6 +55,17 @@ pub enum BuildKind {
5555
Opt,
5656
}
5757

58+
impl BuildKind {
59+
fn all() -> Vec<Self> {
60+
vec![
61+
BuildKind::Check,
62+
BuildKind::Debug,
63+
BuildKind::Doc,
64+
BuildKind::Opt,
65+
]
66+
}
67+
}
68+
5869
#[derive(Clone, Copy, Debug, Eq, Hash, PartialEq)]
5970
pub enum RunKind {
6071
Full,
@@ -104,7 +115,7 @@ pub fn build_kinds_from_arg(arg: &Option<&str>) -> Result<Vec<BuildKind>, KindEr
104115
if let Some(arg) = arg {
105116
kinds_from_arg(STRINGS_AND_BUILD_KINDS, arg)
106117
} else {
107-
Ok(vec![BuildKind::Check, BuildKind::Debug, BuildKind::Opt])
118+
Ok(BuildKind::all())
108119
}
109120
}
110121

@@ -176,7 +187,7 @@ fn process_commits(
176187
rt,
177188
conn,
178189
&ArtifactId::Commit(commit),
179-
&[BuildKind::Check, BuildKind::Debug, BuildKind::Opt],
190+
&BuildKind::all(),
180191
&RunKind::all(),
181192
Compiler::from_sysroot(&sysroot),
182193
&benchmarks,
@@ -402,7 +413,7 @@ fn main_result() -> anyhow::Result<i32> {
402413
(@arg CARGO: --cargo +required +takes_value "The path to the local Cargo to use")
403414
(@arg BUILDS: --builds +takes_value
404415
"One or more (comma-separated) of: 'Check', 'Debug',\n\
405-
'Opt', 'All'")
416+
'Doc', 'Opt', 'All'")
406417
(@arg RUNS: --runs +takes_value
407418
"One or more (comma-separated) of: 'Full',\n\
408419
'IncrFull', 'IncrUnchanged', 'IncrPatched', 'All'")
@@ -466,14 +477,14 @@ fn main_result() -> anyhow::Result<i32> {
466477
let commit = sub_m.value_of("COMMIT").unwrap();
467478
let commit = get_commit_or_fake_it(&commit)?;
468479
let sysroot = Sysroot::install(commit.sha.to_string(), "x86_64-unknown-linux-gnu")?;
469-
let build_kinds = &[BuildKind::Check, BuildKind::Debug, BuildKind::Opt];
480+
let build_kinds = BuildKind::all();
470481
let run_kinds = RunKind::all();
471482
let conn = rt.block_on(pool.expect("--db passed").connection());
472483
bench_commit(
473484
&mut rt,
474485
conn,
475486
&ArtifactId::Commit(commit),
476-
build_kinds,
487+
&build_kinds,
477488
&run_kinds,
478489
Compiler::from_sysroot(&sysroot),
479490
&benchmarks,
@@ -557,7 +568,7 @@ fn main_result() -> anyhow::Result<i32> {
557568
&mut rt,
558569
conn,
559570
&ArtifactId::Artifact(id.to_string()),
560-
&[BuildKind::Check, BuildKind::Debug, BuildKind::Opt],
571+
&BuildKind::all(),
561572
&run_kinds,
562573
Compiler {
563574
rustc: Path::new(rustc.trim()),

database/src/pool/sqlite.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -298,6 +298,7 @@ impl Connection for SqliteConnection {
298298
"check" => Profile::Check,
299299
"opt" => Profile::Opt,
300300
"debug" => Profile::Debug,
301+
"doc" => Profile::Doc,
301302
o => unreachable!("{}: not a profile", o),
302303
},
303304
row.get::<_, String>(3)?.as_str().parse().unwrap(),

0 commit comments

Comments
 (0)