Skip to content

Commit 000f1f3

Browse files
committed
feat(dist): refine suggestions regarding manifest checksum mismatches
1 parent b856164 commit 000f1f3

2 files changed

Lines changed: 14 additions & 8 deletions

File tree

src/dist/mod.rs

Lines changed: 13 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ use once_cell::sync::Lazy;
1010
use regex::Regex;
1111
use serde::{Deserialize, Serialize};
1212
use thiserror::Error as ThisError;
13-
use tracing::info;
13+
use tracing::{info, warn};
1414

1515
use crate::{
1616
config::Cfg, currentprocess::Process, errors::RustupError, toolchain::ToolchainName,
@@ -1171,9 +1171,18 @@ pub(crate) async fn dl_v2_manifest(
11711171
Ok(Some((manifest, manifest_hash)))
11721172
}
11731173
Err(any) => {
1174-
if let Some(RustupError::ChecksumFailed { .. }) = any.downcast_ref::<RustupError>() {
1175-
// Checksum failed - issue warning to try again later
1176-
info!("update not yet available, sorry! try again later")
1174+
if let Some(err @ RustupError::ChecksumFailed { .. }) =
1175+
any.downcast_ref::<RustupError>()
1176+
{
1177+
// Manifest checksum mismatched.
1178+
// This might indicate a transient state during an update
1179+
// on the official release server
1180+
// (see <https://github.com/rust-lang/rustup/issues/3390>)
1181+
// or a misconfiguration of a third-party release server
1182+
// (see <https://github.com/rust-lang/rustup/issues/3885>).
1183+
warn!("{err}");
1184+
info!("if you are on the official release server, this is most likely due to an update happening right now, please try again later");
1185+
info!("if you are on a third-party release server, this might indicate a problem with the server's configuration");
11771186
}
11781187
Err(any)
11791188
}

tests/suite/cli_v2.rs

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -358,10 +358,7 @@ async fn bad_sha_on_manifest() {
358358
rustup::utils::raw::write_file(&sha_file, &sha_str).unwrap();
359359
// We fail because the sha is bad, but we should emit the special message to that effect.
360360
cx.config
361-
.expect_err(
362-
&["rustup", "default", "nightly"],
363-
"update not yet available",
364-
)
361+
.expect_err(&["rustup", "default", "nightly"], "please try again later")
365362
.await;
366363
}
367364

0 commit comments

Comments
 (0)