Skip to content

Commit d50ce15

Browse files
committed
download-rustc: Give a better error message if artifacts can't be downloaded
Before: ``` downloading https://ci-artifacts.rust-lang.org/rustc-builds/bf5cad8e775fb326465e5c1b98693e5d259da156/rust-std-nightly-x86_64-unknown-linux-gnu.tar.xz curl: (22) The requested URL returned error: 404 ``` After: ``` downloading https://ci-artifacts.rust-lang.org/rustc-builds/bf5cad8e775fb326465e5c1b98693e5d259da156/rust-std-nightly-x86_64-unknown-linux-gnu.tar.xz curl: (22) The requested URL returned error: 404 error: failed to download pre-built rustc from CI note: old builds get deleted after a certain time help: if trying to compile an old commit of rustc, disable `download-rustc` in config.toml: [rust] download-rustc = false ```
1 parent 572c0d5 commit d50ce15

File tree

1 file changed

+12
-1
lines changed

1 file changed

+12
-1
lines changed

src/bootstrap/download.rs

+12-1
Original file line numberDiff line numberDiff line change
@@ -541,7 +541,18 @@ impl Config {
541541
None
542542
};
543543

544-
self.download_file(&format!("{base_url}/{url}"), &tarball, "");
544+
let mut help_on_error = "";
545+
if destination == "ci-rustc" {
546+
help_on_error = "error: failed to download pre-built rustc from CI
547+
548+
note: old builds get deleted after a certain time
549+
help: if trying to compile an old commit of rustc, disable `download-rustc` in config.toml:
550+
551+
[rust]
552+
download-rustc = false
553+
";
554+
}
555+
self.download_file(&format!("{base_url}/{url}"), &tarball, help_on_error);
545556
if let Some(sha256) = checksum {
546557
if !self.verify(&tarball, sha256) {
547558
panic!("failed to verify {}", tarball.display());

0 commit comments

Comments
 (0)