Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 2 additions & 3 deletions src/dist/manifest.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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,
};
Expand Down Expand Up @@ -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"))
}
Expand Down
22 changes: 15 additions & 7 deletions src/dist/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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 <https://doc.rust-lang.org/nightly/rustc/platform-support.html> for available targets"
)]
HostTupleUnsupported(TargetTuple),
}

#[derive(Debug, PartialEq)]
Expand Down Expand Up @@ -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
Expand Down
6 changes: 4 additions & 2 deletions tests/suite/cli_rustup.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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 <https://doc.rust-lang.org/nightly/rustc/platform-support.html> for available targets
...
"#]])
.is_err();
.is_ok();
}

#[cfg(unix)]
Expand Down
Loading