diff --git a/src/dist/manifest.rs b/src/dist/manifest.rs index 93f124e6af..4423f91d30 100644 --- a/src/dist/manifest.rs +++ b/src/dist/manifest.rs @@ -23,7 +23,7 @@ use anyhow::{Context, anyhow, bail}; use serde::{Deserialize, Serialize}; use crate::{ - dist::{Profile, TargetTuple, ToolchainDesc, config::Config}, + dist::{DistError, Profile, TargetTuple, ToolchainDesc, config::Config}, errors::RustupError, toolchain::DistributableToolchain, }; @@ -513,8 +513,7 @@ impl Package { if let Some(t) = target { tpkgs .get(t) - .ok_or_else(|| anyhow!(format!("target '{t}' not found in channel. \ - Perhaps check https://doc.rust-lang.org/nightly/rustc/platform-support.html for available targets"))) + .ok_or_else(|| DistError::HostTupleUnsupported(t.clone()).into()) } else { Err(anyhow!("no target specified")) } diff --git a/src/dist/mod.rs b/src/dist/mod.rs index 0bad59dd1d..774cecc624 100644 --- a/src/dist/mod.rs +++ b/src/dist/mod.rs @@ -123,6 +123,12 @@ pub enum DistError { MissingReleaseForToolchain(String), #[error("invalid toolchain name: '{0}'")] InvalidOfficialName(String), + #[error( + "host tuple '{0}' not found in channel manifest +help: this could mean that it has been demoted and no longer has a host toolchain +help: see for available targets" + )] + HostTupleUnsupported(TargetTuple), } #[derive(Debug, PartialEq)] @@ -1074,14 +1080,16 @@ impl<'cfg, 'a> DistOptions<'cfg, 'a> { backtrack_limit = backtrack_limit.map(|n| n - 1); } - Some(DistError::MissingReleaseForToolchain(..)) => { - // no need to even print anything for missing nightlies, - // since we don't really "skip" them - } - _ => { - // All other errors break the loop - break Err(e); + Some(e @ DistError::HostTupleUnsupported(_)) => { + info!("skipping nightly with unsupported host: {e:#}") } + + // no need to even print anything for missing nightlies, + // since we don't really "skip" them + Some(DistError::MissingReleaseForToolchain(..)) => (), + + // All other errors break the loop + _ => break Err(e), }; if let Some(backtrack_limit) = backtrack_limit diff --git a/tests/suite/cli_rustup.rs b/tests/suite/cli_rustup.rs index 459a0b21d6..0dc27db6cd 100644 --- a/tests/suite/cli_rustup.rs +++ b/tests/suite/cli_rustup.rs @@ -4114,10 +4114,12 @@ async fn check_host_goes_away() { .await .with_stderr(snapbox::str![[r#" ... -error: target '[HOST_TUPLE]' not found in channel[..] +info: skipping nightly with unsupported host: host tuple '[HOST_TUPLE]' not found in channel manifest +help: this could mean that it has been demoted and no longer has a host toolchain +help: see for available targets ... "#]]) - .is_err(); + .is_ok(); } #[cfg(unix)]