Skip to content

Commit

Permalink
Don't run cargo-clippy if not available + Refactor + Remove Clippy …
Browse files Browse the repository at this point in the history
…from `Profile::all`
  • Loading branch information
blyxyas committed Sep 24, 2023
1 parent 4675a7b commit e74d88d
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 14 deletions.
13 changes: 11 additions & 2 deletions collector/src/bin/collector.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1197,9 +1197,18 @@ fn bench_published_artifact(
let artifact_id = ArtifactId::Tag(toolchain.id.clone());

let profiles = if collector::version_supports_doc(&toolchain.id) {
Profile::all()
vec![
Profile::Check,
Profile::Debug,
Profile::Doc,
Profile::Opt
]
} else {
Profile::all_non_doc()
vec![
Profile::Check,
Profile::Debug,
Profile::Opt,
]
};
let scenarios = if collector::version_supports_incremental(&toolchain.id) {
Scenario::all()
Expand Down
2 changes: 1 addition & 1 deletion collector/src/compile/benchmark/profile.rs
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ pub enum Profile {

impl Profile {
pub fn all() -> Vec<Self> {
vec![Profile::Check, Profile::Debug, Profile::Doc, Profile::Opt, Profile::Clippy]
vec![Profile::Check, Profile::Debug, Profile::Doc, Profile::Opt]
}

// This also leaves Clippy out
Expand Down
16 changes: 5 additions & 11 deletions collector/src/toolchain.rs
Original file line number Diff line number Diff line change
Expand Up @@ -123,7 +123,10 @@ impl SysrootDownload {
let components = ToolchainComponents::from_binaries_and_libdir(
sysroot_bin("rustc")?,
Some(sysroot_bin("rustdoc")?),
Some(sysroot_bin("clippy")?),
match sysroot_bin("cargo-clippy") {
Err(_) => None,
Ok(path) => Some(path)
},
sysroot_bin("cargo")?,
&self.directory.join(&self.rust_sha).join("lib"),
)?;
Expand Down Expand Up @@ -292,7 +295,7 @@ impl ToolchainComponents {
}
}

#[derive(Clone, Copy)]
#[derive(Clone, Copy, Default)]
pub struct ToolchainConfig<'a> {
rustdoc: Option<&'a Path>,
clippy: Option<&'a Path>,
Expand All @@ -301,15 +304,6 @@ pub struct ToolchainConfig<'a> {
}

impl<'a> ToolchainConfig<'a> {
pub fn default() -> Self {
Self {
rustdoc: None,
clippy: None,
cargo: None,
id: None
}
}

pub fn rustdoc(&mut self, rustdoc: Option<&'a Path>) -> &mut Self {
self.rustdoc = rustdoc;
self
Expand Down

0 comments on commit e74d88d

Please sign in to comment.