Skip to content

Add support for selecting workspace package #2078

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Apr 25, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions collector/src/compile/benchmark/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,10 @@ pub struct BenchmarkConfig {
excluded_scenarios: HashSet<Scenario>,

artifact: ArtifactType,

/// Which package from a workspace should be compiled
#[serde(default)]
package: Option<String>,
}

impl BenchmarkConfig {
Expand Down Expand Up @@ -224,6 +228,7 @@ impl Benchmark {
touch_file: self.config.touch_file.clone(),
jobserver: None,
target,
workspace_package: self.config.package.clone(),
}
}

Expand Down
5 changes: 5 additions & 0 deletions collector/src/compile/execute/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -131,6 +131,7 @@ pub struct CargoProcess<'a> {
pub touch_file: Option<String>,
pub jobserver: Option<jobserver::Client>,
pub target: Target,
pub workspace_package: Option<String>,
}
/// Returns an optional list of Performance CPU cores, if the system has P and E cores.
/// This list *should* be in a format suitable for the `taskset` command.
Expand Down Expand Up @@ -258,6 +259,10 @@ impl<'a> CargoProcess<'a> {

fn get_pkgid(&self, cwd: &Path) -> anyhow::Result<String> {
let mut pkgid_cmd = self.base_command(cwd, "pkgid");
if let Some(package) = &self.workspace_package {
pkgid_cmd.arg("-p").arg(package);
}

let out = command_output(&mut pkgid_cmd)
.with_context(|| format!("failed to obtain pkgid in '{:?}'", cwd))?
.stdout;
Expand Down
Loading