Skip to content

Commit 9eef993

Browse files
Directly fetch try build commits
1 parent 6ef4724 commit 9eef993

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

collector/src/execute/rustc.rs

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ pub fn measure(
2222
artifact: &database::ArtifactId,
2323
aid: database::ArtifactIdNumber,
2424
) -> anyhow::Result<()> {
25-
checkout().context("checking out rust-lang/rust")?;
25+
checkout(&artifact).context("checking out rust-lang/rust")?;
2626

2727
// Run the compiler multiple times -- we'll call min(duration) on each crate
2828
// later on. This should (hopefully) reduce variance.
@@ -144,12 +144,16 @@ fn record(
144144
Ok(())
145145
}
146146

147-
fn checkout() -> anyhow::Result<()> {
147+
fn checkout(artifact: &ArtifactId) -> anyhow::Result<()> {
148148
if Path::new("rust").exists() {
149149
let status = Command::new("git")
150150
.current_dir("rust")
151151
.arg("fetch")
152152
.arg("origin")
153+
.arg(match artifact {
154+
ArtifactId::Commit(c) => c.sha.as_str(),
155+
ArtifactId::Artifact(id) => id.as_str(),
156+
})
153157
.status()
154158
.context("git fetch origin")?;
155159
assert!(status.success(), "git fetch successful");

0 commit comments

Comments
 (0)