Skip to content

Commit d365542

Browse files
committed
feat(dist): refine suggestions regarding manifest checksum mismatches
1 parent 3660792 commit d365542

File tree

2 files changed

+14
-8
lines changed

2 files changed

+14
-8
lines changed

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,
@@ -1169,9 +1169,18 @@ pub(crate) async fn dl_v2_manifest(
11691169
Ok(Some((manifest, manifest_hash)))
11701170
}
11711171
Err(any) => {
1172-
if let Some(RustupError::ChecksumFailed { .. }) = any.downcast_ref::<RustupError>() {
1173-
// Checksum failed - issue warning to try again later
1174-
info!("update not yet available, sorry! try again later")
1172+
if let Some(err @ RustupError::ChecksumFailed { .. }) =
1173+
any.downcast_ref::<RustupError>()
1174+
{
1175+
// Manifest checksum mismatched.
1176+
// This might indicate a transient state during an update
1177+
// on the official release server
1178+
// (see <https://github.com/rust-lang/rustup/issues/3390>)
1179+
// or a misconfiguration of a third-party release server
1180+
// (see <https://github.com/rust-lang/rustup/issues/3885>).
1181+
warn!("{err}");
1182+
info!("if you are on the official release server, this is most likely due to an update happening right now, please try again later");
1183+
info!("if you are on a third-party release server, this might indicate a problem with the server's configuration");
11751184
}
11761185
Err(any)
11771186
}

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)