diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index 32c71eea51..93328e2624 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -1513,9 +1513,12 @@ jobs: - name: Install rustup stable run: rustup toolchain install stable --profile minimal - name: Install Protoc - uses: arduino/setup-protoc@v1 + uses: arduino/setup-protoc@v3 + env: + # renovate: datasource=github-releases depName=protocolbuffers/protobuf versioning=semver + PROTOBUF_VERSION: "34.1" with: - version: "3.x" + version: ${{ env.PROTOBUF_VERSION }} repo-token: ${{ secrets.GITHUB_TOKEN }} - name: Install OpenSSL if: ${{ contains(matrix.os, 'windows') }} diff --git a/ci/actions-templates/all-features-template.yaml b/ci/actions-templates/all-features-template.yaml index 215c39f19b..4798220da4 100644 --- a/ci/actions-templates/all-features-template.yaml +++ b/ci/actions-templates/all-features-template.yaml @@ -25,9 +25,12 @@ jobs: # skip-all - name: Install rustup stable run: rustup toolchain install stable --profile minimal - name: Install Protoc - uses: arduino/setup-protoc@v1 + uses: arduino/setup-protoc@v3 + env: + # renovate: datasource=github-releases depName=protocolbuffers/protobuf versioning=semver + PROTOBUF_VERSION: "34.1" with: - version: "3.x" + version: ${{ env.PROTOBUF_VERSION }} repo-token: ${{ secrets.GITHUB_TOKEN }} - name: Install OpenSSL if: ${{ contains(matrix.os, 'windows') }} diff --git a/src/dist/manifestation.rs b/src/dist/manifestation.rs index 0d73d39689..1995572ec8 100644 --- a/src/dist/manifestation.rs +++ b/src/dist/manifestation.rs @@ -4,29 +4,37 @@ #[cfg(test)] mod tests; -use std::collections::VecDeque; -use std::path::Path; -use std::pin::Pin; -use std::sync::Arc; -use std::task::{Context, Poll, ready}; -use std::vec; +use std::{ + collections::VecDeque, + path::Path, + pin::Pin, + sync::Arc, + task::{Context, Poll, ready}, + vec, +}; use anyhow::{Context as _, Result, anyhow, bail}; -use futures_util::Stream; -use futures_util::stream::{FuturesUnordered, StreamExt}; +use futures_util::{ + Stream, + stream::{FuturesUnordered, StreamExt}, +}; use tokio::task::{JoinHandle, spawn_blocking}; use tracing::{debug, info, warn}; -use crate::diskio::{Executor, IO_CHUNK_SIZE, get_executor, unpack_ram}; -use crate::dist::component::{Components, DirectoryPackage, Transaction}; -use crate::dist::config::Config; -use crate::dist::download::{DownloadCfg, DownloadStatus, File}; -use crate::dist::manifest::{Component, CompressionKind, HashedBinary, Manifest}; -use crate::dist::prefix::InstallPrefix; -use crate::dist::temp; -use crate::dist::{DEFAULT_DIST_SERVER, Profile, TargetTriple}; -use crate::errors::RustupError; -use crate::utils; +use crate::{ + diskio::{Executor, IO_CHUNK_SIZE, get_executor, unpack_ram}, + dist::{ + DEFAULT_DIST_SERVER, Profile, TargetTriple, ToolchainDesc, + component::{Components, DirectoryPackage, Transaction}, + config::Config, + download::{DownloadCfg, DownloadStatus, File}, + manifest::{Component, CompressionKind, HashedBinary, Manifest}, + prefix::InstallPrefix, + temp, + }, + errors::RustupError, + utils, +}; pub(crate) const DIST_MANIFEST: &str = "multirust-channel-manifest.toml"; pub(crate) const CONFIG_FILE: &str = "multirust-config.toml"; @@ -112,7 +120,7 @@ impl Manifestation { changes: Changes, force_update: bool, download_cfg: &DownloadCfg<'_>, - toolchain_str: String, + toolchain: &ToolchainDesc, implicit_modify: bool, ) -> Result { // Some vars we're going to need a few times @@ -129,7 +137,7 @@ impl Manifestation { } // Validate that the requested components are available - if let Err(e) = update.unavailable_components(&new_manifest, &toolchain_str) { + if let Err(e) = update.unavailable_components(&new_manifest, toolchain) { if !force_update { return Err(e); } @@ -694,7 +702,11 @@ impl Update { self.components_to_uninstall.is_empty() && self.components_to_install.is_empty() } - fn unavailable_components(&self, new_manifest: &Manifest, toolchain_str: &str) -> Result<()> { + fn unavailable_components( + &self, + new_manifest: &Manifest, + toolchain: &ToolchainDesc, + ) -> Result<()> { let mut unavailable_components: Vec = self .components_to_install .iter() @@ -715,7 +727,7 @@ impl Update { bail!(RustupError::RequestedComponentsUnavailable { components: unavailable_components, manifest: new_manifest.clone(), - toolchain: toolchain_str.to_owned(), + toolchain: toolchain.to_string(), }); } diff --git a/src/dist/manifestation/tests.rs b/src/dist/manifestation/tests.rs index e595295dd6..29e87b7cbf 100644 --- a/src/dist/manifestation/tests.rs +++ b/src/dist/manifestation/tests.rs @@ -509,14 +509,7 @@ impl TestContext { }; manifestation - .update( - manifest, - changes, - force, - &dl_cfg, - self.toolchain.manifest_name(), - true, - ) + .update(manifest, changes, force, &dl_cfg, &self.toolchain, true) .await } @@ -660,7 +653,7 @@ async fn unavailable_component() { manifest, toolchain, }) => { - assert_eq!(toolchain, "nightly"); + assert_eq!(toolchain, "nightly-x86_64-apple-darwin"); let descriptions = components .iter() .map(|c| manifest.description(c)) @@ -705,7 +698,7 @@ async fn unavailable_component_from_profile() { manifest, toolchain, }) => { - assert_eq!(toolchain, "nightly"); + assert_eq!(toolchain, "nightly-x86_64-apple-darwin"); let descriptions = components .iter() .map(|c| manifest.description(c)) @@ -759,7 +752,7 @@ async fn removed_component() { manifest, toolchain, }) => { - assert_eq!(toolchain, "nightly"); + assert_eq!(toolchain, "nightly-x86_64-apple-darwin"); let descriptions = components .iter() .map(|c| manifest.description(c)) @@ -823,7 +816,7 @@ async fn unavailable_components_is_target() { manifest, toolchain, }) => { - assert_eq!(toolchain, "nightly"); + assert_eq!(toolchain, "nightly-x86_64-apple-darwin"); let descriptions = components .iter() .map(|c| manifest.description(c)) @@ -888,7 +881,7 @@ async fn unavailable_components_with_same_target() { manifest, toolchain, }) => { - assert_eq!(toolchain, "nightly"); + assert_eq!(toolchain, "nightly-x86_64-apple-darwin"); let descriptions = components .iter() .map(|c| manifest.description(c)) diff --git a/src/dist/mod.rs b/src/dist/mod.rs index 0bda9963fe..d3d822bf6a 100644 --- a/src/dist/mod.rs +++ b/src/dist/mod.rs @@ -1199,14 +1199,7 @@ async fn try_update_from_dist_( fetched.clone_from(&m.date); return match manifestation - .update( - m, - changes, - force_update, - download, - toolchain.manifest_name(), - true, - ) + .update(m, changes, force_update, download, toolchain, true) .await { Ok(status) => match status { diff --git a/src/toolchain/distributable.rs b/src/toolchain/distributable.rs index 74f36b5f28..e05cff3faa 100644 --- a/src/toolchain/distributable.rs +++ b/src/toolchain/distributable.rs @@ -121,14 +121,7 @@ impl<'a> DistributableToolchain<'a> { let download_cfg = DownloadCfg::new(self.toolchain.cfg); manifestation - .update( - manifest, - changes, - false, - &download_cfg, - self.desc.manifest_name(), - false, - ) + .update(manifest, changes, false, &download_cfg, &self.desc, false) .await?; Ok(()) @@ -432,14 +425,7 @@ impl<'a> DistributableToolchain<'a> { let download_cfg = DownloadCfg::new(self.toolchain.cfg); manifestation - .update( - manifest, - changes, - false, - &download_cfg, - self.desc.manifest_name(), - false, - ) + .update(manifest, changes, false, &download_cfg, &self.desc, false) .await?; Ok(()) diff --git a/tests/suite/cli_v2.rs b/tests/suite/cli_v2.rs index 5081a9b830..bff61ff1a0 100644 --- a/tests/suite/cli_v2.rs +++ b/tests/suite/cli_v2.rs @@ -1952,7 +1952,7 @@ async fn update_unavailable_std() { .await .with_stderr(snapbox::str![[r#" ... -error: component 'rust-std' for target '[HOST_TRIPLE]' is unavailable for download for channel 'nightly' +error: component 'rust-std' for target '[HOST_TRIPLE]' is unavailable for download for channel 'nightly-[HOST_TRIPLE]' ... "#]]) .is_err(); @@ -1971,7 +1971,7 @@ async fn add_missing_component() { .await .with_stderr(snapbox::str![[r#" ... -error: component 'rls' for target '[HOST_TRIPLE]' is unavailable for download for channel 'nightly' +error: component 'rls' for target '[HOST_TRIPLE]' is unavailable for download for channel 'nightly-[HOST_TRIPLE]' note: sometimes not all components are available in any given nightly ... "#]]) @@ -1994,10 +1994,10 @@ async fn add_toolchain_with_missing_component() { .await .with_stderr(snapbox::str![[r#" ... -error: component 'rust-std' for target '[HOST_TRIPLE]' is unavailable for download for channel 'nightly' +error: component 'rust-std' for target '[HOST_TRIPLE]' is unavailable for download for channel 'nightly-[HOST_TRIPLE]' note: sometimes not all components are available in any given nightly help: if you don't need these components, you could try a minimal installation with: -help: rustup toolchain add nightly --profile minimal +help: rustup toolchain add nightly-[HOST_TRIPLE] --profile minimal help: if you require these components, please install and use the latest successfully built version, help: which you can find at help: after determining the correct date, install it with a command such as: @@ -2020,10 +2020,10 @@ async fn add_toolchain_with_missing_components() { .await .with_stderr(snapbox::str![[r#" ... -error: some components are unavailable for download for channel 'nightly': 'cargo' for target '[HOST_TRIPLE]', 'rust-std' for target '[HOST_TRIPLE]' +error: some components are unavailable for download for channel 'nightly-[HOST_TRIPLE]': 'cargo' for target '[HOST_TRIPLE]', 'rust-std' for target '[HOST_TRIPLE]' note: sometimes not all components are available in any given nightly help: if you don't need these components, you could try a minimal installation with: -help: rustup toolchain add nightly --profile minimal +help: rustup toolchain add nightly-[HOST_TRIPLE] --profile minimal help: if you require these components, please install and use the latest successfully built version, help: which you can find at help: after determining the correct date, install it with a command such as: @@ -2068,7 +2068,7 @@ async fn update_removed_component_toolchain() { .await .with_stderr(snapbox::str![[r#" ... -error: component 'rls' for target '[HOST_TRIPLE]' is unavailable for download for channel 'stable' +error: component 'rls' for target '[HOST_TRIPLE]' is unavailable for download for channel 'stable-[HOST_TRIPLE]' One or many components listed above might have been permanently removed from newer versions of the official Rust distribution due to deprecation. ... @@ -2112,7 +2112,7 @@ async fn update_unavailable_force() { .await .with_stderr(snapbox::str![[r#" ... -error: component 'rls' for target '[HOST_TRIPLE]' is unavailable for download for channel 'nightly' +error: component 'rls' for target '[HOST_TRIPLE]' is unavailable for download for channel 'nightly-[HOST_TRIPLE]' ... "#]]) .is_err(); @@ -2429,7 +2429,7 @@ async fn test_complete_profile_skips_missing_when_forced() { .await .with_stderr(snapbox::str![[r#" ... -error: component 'rls' for target '[HOST_TRIPLE]' is unavailable for download for channel 'nightly' +error: component 'rls' for target '[HOST_TRIPLE]' is unavailable for download for channel 'nightly-[HOST_TRIPLE]' ... "#]]) .is_err(); @@ -2522,7 +2522,7 @@ async fn install_allow_downgrade() { .await .with_stderr(snapbox::str![[r#" ... -error: component 'rls' for target '[HOST_TRIPLE]' is unavailable for download for channel 'nightly' +error: component 'rls' for target '[HOST_TRIPLE]' is unavailable for download for channel 'nightly-[HOST_TRIPLE]' ... "#]]) .is_err();