Skip to content

Commit 49980a3

Browse files
committed
Download Rustup artifacts for a given commit
1 parent da3164d commit 49980a3

File tree

1 file changed

+6
-5
lines changed

1 file changed

+6
-5
lines changed

src/rustup.rs

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -40,9 +40,8 @@ impl Context {
4040
let head_sha = self.get_head_sha_for_rustup()?;
4141
let version = self.get_next_rustup_version(&head_sha)?;
4242

43-
// Download the rustup artifacts from S3
44-
println!("Downloading artifacts from dev-static...");
45-
let dist_dir = self.download_rustup_artifacts()?;
43+
// Download the Rustup artifacts from S3
44+
let dist_dir = self.download_rustup_artifacts(&head_sha)?;
4645

4746
// Archive the artifacts
4847
println!("Archiving artifacts...");
@@ -101,7 +100,9 @@ impl Context {
101100
Ok(toml.version)
102101
}
103102

104-
fn download_rustup_artifacts(&mut self) -> Result<PathBuf, Error> {
103+
fn download_rustup_artifacts(&mut self, sha: &str) -> Result<PathBuf, Error> {
104+
println!("Downloading artifacts from dev-static...");
105+
105106
let dl = self.dl_dir().join("dist");
106107
// Remove the directory if it exists, otherwise just ignore.
107108
let _ = fs::remove_dir_all(&dl);
@@ -112,7 +113,7 @@ impl Context {
112113
.arg("cp")
113114
.arg("--recursive")
114115
.arg("--only-show-errors")
115-
.arg(&self.s3_artifacts_url("dist/"))
116+
.arg(&self.s3_artifacts_url(&format!("builds/{sha}")))
116117
.arg(format!("{}/", dl.display())))?;
117118

118119
Ok(dl)

0 commit comments

Comments
 (0)