diff --git a/src/config.rs b/src/config.rs index fb75b6a9ae..b4c574fdc7 100644 --- a/src/config.rs +++ b/src/config.rs @@ -8,7 +8,7 @@ use anyhow::{Context, Result, anyhow, bail}; use serde::Deserialize; use thiserror::Error as ThisError; use tokio_stream::StreamExt; -use tracing::{error, trace}; +use tracing::{error, info, trace}; use crate::dist::AutoInstallMode; use crate::{ @@ -344,7 +344,12 @@ impl<'a> Cfg<'a> { s.default_toolchain = toolchain.map(|t| t.to_string()); Ok(()) })?; - (self.notify_handler)(Notification::SetDefaultToolchain(toolchain)); + + match toolchain { + Some(t) => info!("default toolchain set to {t}"), + None => info!("default toolchain unset"), + } + Ok(()) } @@ -376,7 +381,7 @@ impl<'a> Cfg<'a> { s.auto_install = Some(mode); Ok(()) })?; - (self.notify_handler)(Notification::SetAutoInstall(mode.as_str())); + info!("setting auto install mode to {}", mode.as_str()); Ok(()) } diff --git a/src/dist/component/package.rs b/src/dist/component/package.rs index eb17588464..ec79eae2c9 100644 --- a/src/dist/component/package.rs +++ b/src/dist/component/package.rs @@ -10,7 +10,7 @@ use std::path::{Path, PathBuf}; use anyhow::{Context, Result, anyhow, bail}; use tar::EntryType; -use tracing::warn; +use tracing::{error, warn}; use crate::diskio::{CompletedIo, Executor, FileBuffer, IO_CHUNK_SIZE, Item, Kind, get_executor}; use crate::dist::component::components::*; @@ -290,10 +290,8 @@ fn unpack_without_first_dir( let entries = archive.entries()?; let effective_max_ram = match effective_limits::memory_limit() { Ok(ram) => Some(ram as usize), - Err(e) => { - if let Some(h) = cx.notify_handler { - h(Notification::Error(e.to_string())) - } + Err(error) => { + error!("can't determine memory limit: {error}"); None } }; diff --git a/src/dist/download.rs b/src/dist/download.rs index 3106fbcfbb..e3918ae9ed 100644 --- a/src/dist/download.rs +++ b/src/dist/download.rs @@ -4,6 +4,8 @@ use std::path::{Path, PathBuf}; use anyhow::{Context, Result, anyhow}; use sha2::{Digest, Sha256}; +use tracing::debug; +use tracing::warn; use url::Url; use crate::dist::temp; @@ -50,7 +52,7 @@ impl<'a> DownloadCfg<'a> { let cached_result = file_hash(&target_file, self.notify_handler)?; if hash == cached_result { (self.notify_handler)(Notification::FileAlreadyDownloaded); - (self.notify_handler)(Notification::ChecksumValid(url.as_ref())); + debug!(url = url.as_ref(), "checksum passed"); return Ok(File { path: target_file }); } else { (self.notify_handler)(Notification::CachedFileChecksumFailed); @@ -105,8 +107,7 @@ impl<'a> DownloadCfg<'a> { .into()) } } else { - (self.notify_handler)(Notification::ChecksumValid(url.as_ref())); - + debug!(url = url.as_ref(), "checksum passed"); utils::rename("downloaded", &partial_file_path, &target_file, self.process)?; Ok(File { path: target_file }) } @@ -160,10 +161,13 @@ impl<'a> DownloadCfg<'a> { return Ok(None); } } else { - (self.notify_handler)(Notification::CantReadUpdateHash(hash_file)); + warn!( + "can't read update hash {}, can't skip update", + hash_file.display() + ); } } else { - (self.notify_handler)(Notification::NoUpdateHash(hash_file)); + debug!(file = %hash_file.display(), "no update hash file found"); } } @@ -190,7 +194,7 @@ impl<'a> DownloadCfg<'a> { } .into()); } else { - (self.notify_handler)(Notification::ChecksumValid(url_str)); + debug!(url = url_str, "checksum passed"); } Ok(Some((file, partial_hash))) diff --git a/src/dist/manifestation.rs b/src/dist/manifestation.rs index 1319e70eb4..14aaacbf18 100644 --- a/src/dist/manifestation.rs +++ b/src/dist/manifestation.rs @@ -10,7 +10,7 @@ use anyhow::{Context, Result, anyhow, bail}; use futures_util::stream::StreamExt; use std::sync::Arc; use tokio::sync::Semaphore; -use tracing::info; +use tracing::{info, warn}; use url::Url; use crate::dist::component::{ @@ -122,13 +122,7 @@ impl Manifestation { // Create the lists of components needed for installation let config = self.read_config()?; - let mut update = Update::build_update( - self, - new_manifest, - &changes, - &config, - &download_cfg.notify_handler, - )?; + let mut update = Update::build_update(self, new_manifest, &changes, &config)?; if update.nothing_changes() { return Ok(UpdateStatus::Unchanged); @@ -143,9 +137,17 @@ impl Manifestation { e.downcast::() { for component in &components { - (download_cfg.notify_handler)(Notification::ForcingUnavailableComponent( - &component.name(new_manifest), - )); + match &component.target { + Some(t) if t != &self.target_triple => warn!( + "skipping unavailable component {} for target {}", + component.short_name(new_manifest), + t + ), + _ => warn!( + "skipping unavailable component {}", + component.short_name(new_manifest) + ), + } } update.drop_components_to_install(&components); } @@ -224,24 +226,33 @@ impl Manifestation { // Uninstall components for component in &update.components_to_uninstall { - let notification = if implicit_modify { - Notification::RemovingOldComponent - } else { - Notification::RemovingComponent - }; - (download_cfg.notify_handler)(notification( - &component.short_name(new_manifest), - &self.target_triple, - component.target.as_ref(), - )); + match (implicit_modify, &component.target) { + (true, Some(t)) if t != &self.target_triple => { + info!( + "removing previous version of component {} for target {}", + component.short_name(new_manifest), + t + ); + } + (false, Some(t)) if t != &self.target_triple => { + info!( + "removing component {} for target {}", + component.short_name(new_manifest), + t + ); + } + (true, _) => { + info!( + "removing previous version of component {}", + component.short_name(new_manifest), + ); + } + (false, _) => { + info!("removing component {}", component.short_name(new_manifest)); + } + } - tx = self.uninstall_component( - component, - new_manifest, - tx, - &download_cfg.notify_handler, - download_cfg.process, - )?; + tx = self.uninstall_component(component, new_manifest, tx, download_cfg.process)?; } // Install components @@ -254,11 +265,17 @@ impl Manifestation { let short_pkg_name = component.short_name_in_manifest(); let short_name = component.short_name(new_manifest); - (download_cfg.notify_handler)(Notification::InstallingComponent( - &short_name, - &self.target_triple, - component.target.as_ref(), - )); + match &component.target { + Some(t) if t != &self.target_triple => { + info!("installing component {short_name}"); + } + _ => { + info!( + "installing component {short_name} for target {}", + self.target_triple + ) + } + } let cx = PackageContext { tmp_cx, @@ -319,7 +336,6 @@ impl Manifestation { &self, manifest: &Manifest, tmp_cx: &temp::Context, - notify_handler: &dyn Fn(Notification<'_>), process: &Process, ) -> Result<()> { let prefix = self.installation.prefix(); @@ -337,7 +353,7 @@ impl Manifestation { tx.remove_file("dist config", rel_config_path)?; for component in config.components { - tx = self.uninstall_component(&component, manifest, tx, notify_handler, process)?; + tx = self.uninstall_component(&component, manifest, tx, process)?; } tx.commit(); @@ -349,7 +365,6 @@ impl Manifestation { component: &Component, manifest: &Manifest, mut tx: Transaction<'a>, - notify_handler: &dyn Fn(Notification<'_>), process: &Process, ) -> Result> { // For historical reasons, the rust-installer component @@ -363,9 +378,10 @@ impl Manifestation { } else if let Some(c) = self.installation.find(short_name)? { tx = c.uninstall(tx, process)?; } else { - notify_handler(Notification::MissingInstalledComponent( - &component.short_name(manifest), - )); + warn!( + "component {} not found during uninstall", + component.short_name(manifest), + ); } Ok(tx) @@ -463,12 +479,7 @@ impl Manifestation { let (installer_file, installer_hash) = dl.unwrap(); let prefix = self.installation.prefix(); - - notify_handler(Notification::InstallingComponent( - "rust", - &self.target_triple, - Some(&self.target_triple), - )); + info!("installing component rust"); // Begin transaction let mut tx = Transaction::new(prefix, tmp_cx, process); @@ -539,7 +550,6 @@ impl Update { new_manifest: &Manifest, changes: &Changes, config: &Option, - notify_handler: &dyn Fn(Notification<'_>), ) -> Result { // The package to install. let rust_package = new_manifest.get_package("rust")?; @@ -601,9 +611,17 @@ impl Update { if !starting_list.contains(component) { result.components_to_install.push(component.clone()); } else if changes.explicit_add_components.contains(component) { - notify_handler(Notification::ComponentAlreadyInstalled( - &component.description(new_manifest), - )); + match &component.target { + Some(t) if t != &manifestation.target_triple => info!( + "component {} for target {} is up to date", + component.short_name(new_manifest), + t, + ), + _ => info!( + "component {} is up to date", + component.short_name(new_manifest) + ), + } } } } else { diff --git a/src/dist/manifestation/tests.rs b/src/dist/manifestation/tests.rs index 83689fd5ed..bf2090e2a5 100644 --- a/src/dist/manifestation/tests.rs +++ b/src/dist/manifestation/tests.rs @@ -540,7 +540,7 @@ impl TestContext { let manifestation = Manifestation::open(self.prefix.clone(), trip)?; let manifest = manifestation.load_manifest()?.unwrap(); - manifestation.uninstall(&manifest, &self.tmp_cx, &|_| (), &self.tp.process)?; + manifestation.uninstall(&manifest, &self.tmp_cx, &self.tp.process)?; Ok(()) } diff --git a/src/dist/mod.rs b/src/dist/mod.rs index 57bc1b91f0..1d1998a59b 100644 --- a/src/dist/mod.rs +++ b/src/dist/mod.rs @@ -11,12 +11,11 @@ use itertools::Itertools; use regex::Regex; use serde::{Deserialize, Serialize}; use thiserror::Error as ThisError; -use tracing::{info, warn}; +use tracing::{debug, info, warn}; use crate::{ config::{Cfg, dist_root_server}, errors::RustupError, - notifications::Notification, process::Process, toolchain::ToolchainName, utils, @@ -912,7 +911,10 @@ pub(crate) async fn update_from_dist( if let Some(hash) = opts.update_hash { // fresh_install means the toolchain isn't present, but hash_exists means there is a stray hash file if fresh_install && Path::exists(hash) { - (opts.dl_cfg.notify_handler)(Notification::StrayHash(hash)); + warn!( + "removing stray hash file in order to continue: {}", + hash.display() + ); std::fs::remove_file(hash)?; } } @@ -990,11 +992,18 @@ pub(crate) async fn update_from_dist( let cause = e.downcast_ref::(); match cause { Some(DistError::ToolchainComponentsMissing(components, manifest, ..)) => { - (opts.dl_cfg.notify_handler)(Notification::SkippingNightlyMissingComponent( - &toolchain, - current_manifest.as_ref().unwrap_or(manifest), - components, - )); + let plural = if components.len() > 1 { "s" } else { "" }; + let manifest = current_manifest.as_ref().unwrap_or(manifest); + let components = components + .iter() + .map( + |component| match component.target.as_ref() == Some(&toolchain.target) { + true => component.short_name(manifest), + false => component.name(manifest), + }, + ) + .join(", "); + info!("skipping nightly with missing component{plural}: {components}"); if first_err.is_none() { first_err = Some(e); @@ -1072,7 +1081,7 @@ async fn try_update_from_dist_( let manifestation = Manifestation::open(prefix.clone(), toolchain.target.clone())?; // TODO: Add a notification about which manifest version is going to be used - (download.notify_handler)(Notification::DownloadingManifest(&toolchain_str)); + info!("syncing channel updates for {toolchain_str}"); match dl_v2_manifest( download, // Even if manifest has not changed, we must continue to install requested components. @@ -1088,10 +1097,10 @@ async fn try_update_from_dist_( .await { Ok(Some((m, hash))) => { - (download.notify_handler)(Notification::DownloadedManifest( - &m.date, - m.get_rust_version().ok(), - )); + match m.get_rust_version() { + Ok(version) => info!("latest update on {} for version {version}", m.date), + Err(_) => info!("latest update on {}", m.date), + } let profile_components = match profile { Some(profile) => m.get_profile_components(profile, &toolchain.target)?, @@ -1173,7 +1182,7 @@ async fn try_update_from_dist_( Some(RustupError::ChecksumFailed { .. }) => return Ok(None), Some(RustupError::DownloadNotExists { .. }) => { // Proceed to try v1 as a fallback - (download.notify_handler)(Notification::DownloadingLegacyManifest) + debug!("manifest not found; trying legacy manifest"); } _ => return Err(err), } diff --git a/src/download/mod.rs b/src/download/mod.rs index 41912390b6..8bdb470099 100644 --- a/src/download/mod.rs +++ b/src/download/mod.rs @@ -15,6 +15,12 @@ use anyhow::Context; use anyhow::anyhow; use sha2::Sha256; use thiserror::Error; +#[cfg(any( + feature = "curl-backend", + feature = "reqwest-rustls-tls", + feature = "reqwest-native-tls" +))] +use tracing::debug; #[cfg(any(feature = "reqwest-rustls-tls", feature = "reqwest-native-tls"))] use tracing::info; use tracing::warn; @@ -96,8 +102,7 @@ async fn download_file_( use sha2::Digest; use std::cell::RefCell; - notify_handler(Notification::DownloadingFile(url)); - + debug!(url = %url, "downloading file"); let hasher = RefCell::new(hasher); // This callback will write the download to disk and optionally @@ -119,9 +124,7 @@ async fn download_file_( Event::DownloadDataReceived(data) => { notify_handler(Notification::DownloadDataReceived(data, Some(url.as_str()))); } - Event::ResumingPartialDownload => { - notify_handler(Notification::ResumingPartialDownload); - } + Event::ResumingPartialDownload => debug!("resuming partial download"), } Ok(()) @@ -209,12 +212,12 @@ async fn download_file_( Err(_) => 180, }); - notify_handler(match backend { + match backend { #[cfg(feature = "curl-backend")] - Backend::Curl => Notification::UsingCurl, + Backend::Curl => debug!("downloading with curl"), #[cfg(any(feature = "reqwest-rustls-tls", feature = "reqwest-native-tls"))] - Backend::Reqwest(_) => Notification::UsingReqwest, - }); + Backend::Reqwest(_) => debug!("downloading with reqwest"), + }; let res = backend .download_to_path(url, path, resume_from_partial, Some(callback), timeout) diff --git a/src/errors.rs b/src/errors.rs index df95c75b55..06aa59a71b 100644 --- a/src/errors.rs +++ b/src/errors.rs @@ -205,7 +205,7 @@ fn component_unavailable_msg(cs: &[Component], manifest: &Manifest, toolchain: & if toolchain.starts_with("nightly") { let _ = write!( buf, - "Sometimes not all components are available in any given nightly. " + "(sometimes not all components are available in any given nightly)" ); } } @@ -235,7 +235,7 @@ fn component_unavailable_msg(cs: &[Component], manifest: &Manifest, toolchain: & if toolchain.starts_with("nightly") { let _ = write!( buf, - "Sometimes not all components are available in any given nightly. " + "(sometimes not all components are available in any given nightly)" ); } } diff --git a/src/notifications.rs b/src/notifications.rs index f011414efb..903c19a142 100644 --- a/src/notifications.rs +++ b/src/notifications.rs @@ -1,36 +1,18 @@ use std::fmt::{self, Display}; use std::path::{Path, PathBuf}; -use url::Url; - use crate::dist::TargetTriple; -use crate::dist::manifest::{Component, Manifest}; use crate::settings::MetadataVersion; use crate::utils::units; use crate::{dist::ToolchainDesc, toolchain::ToolchainName, utils::notify::NotificationLevel}; #[derive(Debug)] pub(crate) enum Notification<'a> { - ComponentAlreadyInstalled(&'a str), - CantReadUpdateHash(&'a Path), - NoUpdateHash(&'a Path), - ChecksumValid(&'a str), FileAlreadyDownloaded, CachedFileChecksumFailed, - MissingInstalledComponent(&'a str), /// The URL of the download is passed as the last argument, to allow us to track concurrent downloads. DownloadingComponent(&'a str, &'a TargetTriple, Option<&'a TargetTriple>, &'a str), - InstallingComponent(&'a str, &'a TargetTriple, Option<&'a TargetTriple>), - RemovingComponent(&'a str, &'a TargetTriple, Option<&'a TargetTriple>), - RemovingOldComponent(&'a str, &'a TargetTriple, Option<&'a TargetTriple>), - DownloadingManifest(&'a str), - DownloadedManifest(&'a str, Option<&'a str>), - DownloadingLegacyManifest, - SkippingNightlyMissingComponent(&'a ToolchainDesc, &'a Manifest, &'a [Component]), - ForcingUnavailableComponent(&'a str), - StrayHash(&'a Path), RetryingDownload(&'a str), - DownloadingFile(&'a Url), /// Received the Content-Length of the to-be downloaded data with /// the respective URL of the download (for tracking concurrent downloads). DownloadContentLengthReceived(u64, Option<&'a str>), @@ -40,17 +22,10 @@ pub(crate) enum Notification<'a> { DownloadFinished(Option<&'a str>), /// Download has failed. DownloadFailed(&'a str), - ResumingPartialDownload, /// This would make more sense as a crate::notifications::Notification /// member, but the notification callback is already narrowed to /// utils::notifications by the time tar unpacking is called. SetDefaultBufferSize(usize), - Error(String), - #[cfg(feature = "curl-backend")] - UsingCurl, - UsingReqwest, - SetAutoInstall(&'a str), - SetDefaultToolchain(Option<&'a ToolchainName>), SetOverrideToolchain(&'a Path, &'a str), SetProfile(&'a str), SetSelfUpdate(&'a str), @@ -78,35 +53,14 @@ impl Notification<'_> { pub(crate) fn level(&self) -> NotificationLevel { use self::Notification::*; match self { - ChecksumValid(_) - | NoUpdateHash(_) - | FileAlreadyDownloaded - | DownloadingLegacyManifest => NotificationLevel::Debug, - DownloadingComponent(_, _, _, _) - | InstallingComponent(_, _, _) - | RemovingComponent(_, _, _) - | RemovingOldComponent(_, _, _) - | ComponentAlreadyInstalled(_) - | DownloadingManifest(_) - | SkippingNightlyMissingComponent(_, _, _) - | RetryingDownload(_) - | DownloadedManifest(_, _) => NotificationLevel::Info, - CantReadUpdateHash(_) - | MissingInstalledComponent(_) - | CachedFileChecksumFailed - | ForcingUnavailableComponent(_) - | StrayHash(_) => NotificationLevel::Warn, + FileAlreadyDownloaded => NotificationLevel::Debug, + DownloadingComponent(_, _, _, _) | RetryingDownload(_) => NotificationLevel::Info, + CachedFileChecksumFailed => NotificationLevel::Warn, SetDefaultBufferSize(_) => NotificationLevel::Trace, - DownloadingFile(_) - | DownloadContentLengthReceived(_, _) + DownloadContentLengthReceived(_, _) | DownloadDataReceived(_, _) | DownloadFinished(_) - | DownloadFailed(_) - | ResumingPartialDownload - | UsingReqwest => NotificationLevel::Debug, - #[cfg(feature = "curl-backend")] - UsingCurl => NotificationLevel::Debug, - Error(_) => NotificationLevel::Error, + | DownloadFailed(_) => NotificationLevel::Debug, ToolchainDirectory(_) | LookingForToolchain(_) | InstallingToolchain(_) @@ -114,9 +68,7 @@ impl Notification<'_> { | ReadMetadataVersion(_) | InstalledToolchain(_) | UpdateHashMatches => NotificationLevel::Debug, - SetAutoInstall(_) - | SetDefaultToolchain(_) - | SetOverrideToolchain(_, _) + SetOverrideToolchain(_, _) | SetProfile(_) | SetSelfUpdate(_) | UsingExistingToolchain(_) @@ -133,19 +85,8 @@ impl Display for Notification<'_> { fn fmt(&self, f: &mut fmt::Formatter<'_>) -> std::result::Result<(), fmt::Error> { use self::Notification::*; match self { - ComponentAlreadyInstalled(c) => write!(f, "component {c} is up to date"), - CantReadUpdateHash(path) => write!( - f, - "can't read update hash file: '{}', can't skip update...", - path.display() - ), - NoUpdateHash(path) => write!(f, "no update hash at: '{}'", path.display()), - ChecksumValid(url) => write!(f, "checksum passed for {url}"), FileAlreadyDownloaded => write!(f, "reusing previously downloaded file"), CachedFileChecksumFailed => write!(f, "bad checksum for cached download"), - MissingInstalledComponent(c) => { - write!(f, "during uninstall component {c} was not found") - } DownloadingComponent(c, h, t, _) => { if Some(h) == t.as_ref() || t.is_none() { write!(f, "downloading component '{c}'") @@ -153,83 +94,16 @@ impl Display for Notification<'_> { write!(f, "downloading component '{}' for '{}'", c, t.unwrap()) } } - InstallingComponent(c, h, t) => { - if Some(h) == t.as_ref() || t.is_none() { - write!(f, "installing component '{c}'") - } else { - write!(f, "installing component '{}' for '{}'", c, t.unwrap()) - } - } - RemovingComponent(c, h, t) => { - if Some(h) == t.as_ref() || t.is_none() { - write!(f, "removing component '{c}'") - } else { - write!(f, "removing component '{}' for '{}'", c, t.unwrap()) - } - } - RemovingOldComponent(c, h, t) => { - if Some(h) == t.as_ref() || t.is_none() { - write!(f, "removing previous version of component '{c}'") - } else { - write!( - f, - "removing previous version of component '{}' for '{}'", - c, - t.unwrap() - ) - } - } - DownloadingManifest(t) => write!(f, "syncing channel updates for '{t}'"), - DownloadedManifest(date, Some(version)) => { - write!(f, "latest update on {date}, rust version {version}") - } - DownloadedManifest(date, None) => { - write!(f, "latest update on {date}, no rust version") - } - DownloadingLegacyManifest => write!(f, "manifest not found. trying legacy manifest"), - StrayHash(path) => write!( - f, - "removing stray hash found at '{}' in order to continue", - path.display() - ), - SkippingNightlyMissingComponent(toolchain, manifest, components) => write!( - f, - "skipping nightly which is missing installed component{} '{}'", - if components.len() > 1 { "s" } else { "" }, - components - .iter() - .map(|component| { - if component.target.as_ref() != Some(&toolchain.target) { - component.name(manifest) - } else { - component.short_name(manifest) - } - }) - .collect::>() - .join("', '") - ), - ForcingUnavailableComponent(component) => { - write!(f, "Force-skipping unavailable component '{component}'") - } RetryingDownload(url) => write!(f, "retrying download for '{url}'"), - Error(e) => write!(f, "error: '{e}'"), SetDefaultBufferSize(size) => write!( f, "using up to {} of RAM to unpack components", units::Size::new(*size) ), - DownloadingFile(url) => write!(f, "downloading file from: '{url}'"), DownloadContentLengthReceived(len, _) => write!(f, "download size is: '{len}'"), DownloadDataReceived(data, _) => write!(f, "received some data of size {}", data.len()), DownloadFinished(_) => write!(f, "download finished"), DownloadFailed(_) => write!(f, "download failed"), - ResumingPartialDownload => write!(f, "resuming partial download"), - #[cfg(feature = "curl-backend")] - UsingCurl => write!(f, "downloading with curl"), - UsingReqwest => write!(f, "downloading with reqwest"), - SetAutoInstall(auto) => write!(f, "auto install set to '{auto}'"), - SetDefaultToolchain(None) => write!(f, "default toolchain unset"), - SetDefaultToolchain(Some(name)) => write!(f, "default toolchain set to '{name}'"), SetOverrideToolchain(path, name) => write!( f, "override toolchain for '{}' set to '{}'", diff --git a/tests/suite/cli_exact.rs b/tests/suite/cli_exact.rs index 020b931927..f9af3c16a3 100644 --- a/tests/suite/cli_exact.rs +++ b/tests/suite/cli_exact.rs @@ -20,11 +20,11 @@ async fn update_once() { "#]]) .with_stderr(snapbox::str![[r#" -info: syncing channel updates for 'nightly-[HOST_TRIPLE]' -info: latest update on 2015-01-02, rust version 1.3.0 (hash-nightly-2) +info: syncing channel updates for nightly-[HOST_TRIPLE] +info: latest update on 2015-01-02 for version 1.3.0 (hash-nightly-2) info: downloading component[..] ... -info: default toolchain set to 'nightly-[HOST_TRIPLE]' +info: default toolchain set to nightly-[HOST_TRIPLE] "#]]); cx.config @@ -67,8 +67,8 @@ rustup - Update available : [CURRENT_VERSION] -> [TEST_VERSION] "#]]) .with_stderr(snapbox::str![[r#" -info: syncing channel updates for 'nightly-[HOST_TRIPLE]' -info: latest update on 2015-01-02, rust version 1.3.0 (hash-nightly-2) +info: syncing channel updates for nightly-[HOST_TRIPLE] +info: latest update on 2015-01-02 for version 1.3.0 (hash-nightly-2) info: downloading component[..] ... "#]]); @@ -110,8 +110,8 @@ async fn update_once_and_self_update() { "#]]) .with_stderr(snapbox::str![[r#" -info: syncing channel updates for 'nightly-[HOST_TRIPLE]' -info: latest update on 2015-01-02, rust version 1.3.0 (hash-nightly-2) +info: syncing channel updates for nightly-[HOST_TRIPLE] +info: latest update on 2015-01-02 for version 1.3.0 (hash-nightly-2) info: downloading component[..] ... info: checking for self-update (current version: [CURRENT_VERSION]) @@ -153,7 +153,7 @@ async fn update_again() { "#]]) .with_stderr(snapbox::str![[r#" -info: syncing channel updates for 'nightly-[HOST_TRIPLE]' +info: syncing channel updates for nightly-[HOST_TRIPLE] "#]]); cx.config @@ -167,7 +167,7 @@ info: syncing channel updates for 'nightly-[HOST_TRIPLE]' "#]]) .with_stderr(snapbox::str![[r#" -info: syncing channel updates for 'nightly-[HOST_TRIPLE]' +info: syncing channel updates for nightly-[HOST_TRIPLE] "#]]); } @@ -321,11 +321,11 @@ async fn default() { "#]]) .with_stderr(snapbox::str![[r#" -info: syncing channel updates for 'nightly-[HOST_TRIPLE]' -info: latest update on 2015-01-02, rust version 1.3.0 (hash-nightly-2) +info: syncing channel updates for nightly-[HOST_TRIPLE] +info: latest update on 2015-01-02 for version 1.3.0 (hash-nightly-2) info: downloading component[..] ... -info: default toolchain set to 'nightly-[HOST_TRIPLE]' +info: default toolchain set to nightly-[HOST_TRIPLE] "#]]); cx.config @@ -584,7 +584,7 @@ async fn update_no_manifest() { .is_err() .with_stdout(snapbox::str![[""]]) .with_stderr(snapbox::str![[r#" -info: syncing channel updates for 'nightly-2016-01-01-[HOST_TRIPLE]' +info: syncing channel updates for nightly-2016-01-01-[HOST_TRIPLE] error: no release found for 'nightly-2016-01-01' "#]]); @@ -867,10 +867,10 @@ async fn install_unreleased_component() { "#]]) .with_stderr(snapbox::str![[r#" -info: syncing channel updates for 'nightly-[HOST_TRIPLE]' -info: latest update on 2019-09-13, rust version 1.37.0 (hash-nightly-2) -info: skipping nightly which is missing installed component 'rust-std-[MULTI_ARCH_I]' -info: syncing channel updates for 'nightly-2019-09-12-[HOST_TRIPLE]' +info: syncing channel updates for nightly-[HOST_TRIPLE] +info: latest update on 2019-09-13 for version 1.37.0 (hash-nightly-2) +info: skipping nightly with missing component: rust-std-[MULTI_ARCH_I] +info: syncing channel updates for nightly-2019-09-12-[HOST_TRIPLE] "#]]); @@ -887,13 +887,13 @@ info: syncing channel updates for 'nightly-2019-09-12-[HOST_TRIPLE]' "#]]) .with_stderr(snapbox::str![[r#" -info: syncing channel updates for 'nightly-[HOST_TRIPLE]' -info: latest update on 2019-09-14, rust version 1.37.0 (hash-nightly-3) -info: skipping nightly which is missing installed component 'rls' -info: syncing channel updates for 'nightly-2019-09-13-[HOST_TRIPLE]' -info: latest update on 2019-09-13, rust version 1.37.0 (hash-nightly-2) -info: skipping nightly which is missing installed component 'rust-std-[MULTI_ARCH_I]' -info: syncing channel updates for 'nightly-2019-09-12-[HOST_TRIPLE]' +info: syncing channel updates for nightly-[HOST_TRIPLE] +info: latest update on 2019-09-14 for version 1.37.0 (hash-nightly-3) +info: skipping nightly with missing component: rls +info: syncing channel updates for nightly-2019-09-13-[HOST_TRIPLE] +info: latest update on 2019-09-13 for version 1.37.0 (hash-nightly-2) +info: skipping nightly with missing component: rust-std-[MULTI_ARCH_I] +info: syncing channel updates for nightly-2019-09-12-[HOST_TRIPLE] "#]]); } diff --git a/tests/suite/cli_inst_interactive.rs b/tests/suite/cli_inst_interactive.rs index 7a82ac187e..6b1e31bfd2 100644 --- a/tests/suite/cli_inst_interactive.rs +++ b/tests/suite/cli_inst_interactive.rs @@ -478,7 +478,7 @@ async fn install_forces_and_skips_rls() { .is_ok() .with_stderr(snapbox::str![[r#" ... -warn: Force-skipping unavailable component 'rls-[HOST_TRIPLE]' +warn: skipping unavailable component rls ... "#]]); } diff --git a/tests/suite/cli_rustup.rs b/tests/suite/cli_rustup.rs index 407585a1d1..7b1b0787dc 100644 --- a/tests/suite/cli_rustup.rs +++ b/tests/suite/cli_rustup.rs @@ -33,8 +33,8 @@ async fn rustup_stable() { "#]]) .with_stderr(snapbox::str![[r#" -info: syncing channel updates for 'stable-[HOST_TRIPLE]' -info: latest update on 2015-01-02, rust version 1.1.0 (hash-stable-1.1.0) +info: syncing channel updates for stable-[HOST_TRIPLE] +info: latest update on 2015-01-02 for version 1.1.0 (hash-stable-1.1.0) info: downloading component[..] ... info: cleaning up downloads & tmp directories @@ -97,7 +97,7 @@ async fn rustup_stable_no_change() { "#]]) .with_stderr(snapbox::str![[r#" -info: syncing channel updates for 'stable-[HOST_TRIPLE]' +info: syncing channel updates for stable-[HOST_TRIPLE] info: cleaning up downloads & tmp directories "#]]) @@ -129,16 +129,16 @@ async fn rustup_all_channels() { "#]]) .with_stderr(snapbox::str![[r#" -info: syncing channel updates for 'stable-[HOST_TRIPLE]' -info: latest update on 2015-01-02, rust version 1.1.0 (hash-stable-1.1.0) +info: syncing channel updates for stable-[HOST_TRIPLE] +info: latest update on 2015-01-02 for version 1.1.0 (hash-stable-1.1.0) info: downloading component[..] ... -info: syncing channel updates for 'beta-[HOST_TRIPLE]' -info: latest update on 2015-01-02, rust version 1.2.0 (hash-beta-1.2.0) +info: syncing channel updates for beta-[HOST_TRIPLE] +info: latest update on 2015-01-02 for version 1.2.0 (hash-beta-1.2.0) info: downloading component[..] ... -info: syncing channel updates for 'nightly-[HOST_TRIPLE]' -info: latest update on 2015-01-02, rust version 1.3.0 (hash-nightly-2) +info: syncing channel updates for nightly-[HOST_TRIPLE] +info: latest update on 2015-01-02 for version 1.3.0 (hash-nightly-2) info: downloading component[..] ... info: cleaning up downloads & tmp directories @@ -206,13 +206,13 @@ async fn rustup_some_channels_up_to_date() { "#]]) .with_stderr(snapbox::str![[r#" -info: syncing channel updates for 'stable-[HOST_TRIPLE]' -info: latest update on 2015-01-02, rust version 1.1.0 (hash-stable-1.1.0) +info: syncing channel updates for stable-[HOST_TRIPLE] +info: latest update on 2015-01-02 for version 1.1.0 (hash-stable-1.1.0) info: downloading component[..] ... -info: syncing channel updates for 'beta-[HOST_TRIPLE]' -info: syncing channel updates for 'nightly-[HOST_TRIPLE]' -info: latest update on 2015-01-02, rust version 1.3.0 (hash-nightly-2) +info: syncing channel updates for beta-[HOST_TRIPLE] +info: syncing channel updates for nightly-[HOST_TRIPLE] +info: latest update on 2015-01-02 for version 1.3.0 (hash-nightly-2) info: downloading component[..] ... info: cleaning up downloads & tmp directories @@ -282,11 +282,11 @@ async fn default() { "#]]) .with_stderr(snapbox::str![[r#" -info: syncing channel updates for 'nightly-[HOST_TRIPLE]' -info: latest update on 2015-01-02, rust version 1.3.0 (hash-nightly-2) +info: syncing channel updates for nightly-[HOST_TRIPLE] +info: latest update on 2015-01-02 for version 1.3.0 (hash-nightly-2) info: downloading component[..] ... -info: default toolchain set to 'nightly-[HOST_TRIPLE]' +info: default toolchain set to nightly-[HOST_TRIPLE] "#]]) .is_ok(); @@ -323,7 +323,7 @@ async fn default_override() { .await .with_stderr(snapbox::str![[r#" info: using existing install for 'stable-[HOST_TRIPLE]' -info: default toolchain set to 'stable-[HOST_TRIPLE]' +info: default toolchain set to stable-[HOST_TRIPLE] info: note that the toolchain 'nightly-[HOST_TRIPLE]' is currently in use (directory override for '[..]') "#]]) @@ -1706,8 +1706,8 @@ channel = "nightly" .await .extend_redactions([("[TOOLCHAIN_FILE]", &toolchain_file)]) .with_stderr(snapbox::str![[r#" -info: syncing channel updates for 'nightly-[HOST_TRIPLE]' -info: latest update on 2015-01-02, rust version 1.3.0 (hash-nightly-2) +info: syncing channel updates for nightly-[HOST_TRIPLE] +info: latest update on 2015-01-02 for version 1.3.0 (hash-nightly-2) info: downloading component[..] ... info: the active toolchain `nightly-[HOST_TRIPLE]` has been installed @@ -2770,7 +2770,7 @@ components = [ "rust-bongo" ] .await .with_stderr(snapbox::str![[r#" ... -warn: Force-skipping unavailable component 'rust-bongo-[HOST_TRIPLE]' +warn: skipping unavailable component rust-bongo ... "#]]) .is_ok(); @@ -3616,7 +3616,7 @@ async fn dont_warn_on_partial_build() { .await .with_stderr(snapbox::str![[r#" ... -info: syncing channel updates for 'nightly-[HOST_TRIPLE]' +info: syncing channel updates for nightly-[HOST_TRIPLE] ... "#]]) .is_ok() @@ -3717,11 +3717,11 @@ async fn custom_toolchain_with_components_toolchains_profile_does_not_err() { ]) .await .with_stderr(snapbox::str![[r#" -info: syncing channel updates for 'nightly-[HOST_TRIPLE]' -info: latest update on 2015-01-02, rust version 1.3.0 (hash-nightly-2) +info: syncing channel updates for nightly-[HOST_TRIPLE] +info: latest update on 2015-01-02 for version 1.3.0 (hash-nightly-2) info: downloading component[..] ... -info: default toolchain set to 'nightly-[HOST_TRIPLE]' +info: default toolchain set to nightly-[HOST_TRIPLE] "#]]) .is_ok(); diff --git a/tests/suite/cli_self_upd.rs b/tests/suite/cli_self_upd.rs index 53ff97415a..54818d8f64 100644 --- a/tests/suite/cli_self_upd.rs +++ b/tests/suite/cli_self_upd.rs @@ -70,11 +70,11 @@ async fn install_bins_to_cargo_home() { "#]]) .with_stderr(snapbox::str![[r#" ... -info: syncing channel updates for 'stable-[HOST_TRIPLE]' -info: latest update on 2015-01-02, rust version 1.1.0 (hash-stable-1.1.0) +info: syncing channel updates for stable-[HOST_TRIPLE] +info: latest update on 2015-01-02 for version 1.1.0 (hash-stable-1.1.0) info: downloading component[..] ... -info: default toolchain set to 'stable-[HOST_TRIPLE]' +info: default toolchain set to stable-[HOST_TRIPLE] "#]]) .is_ok(); @@ -115,11 +115,11 @@ async fn proxies_are_relative_symlinks() { "#]]) .with_stderr(snapbox::str![[r#" ... -info: syncing channel updates for 'stable-[HOST_TRIPLE]' -info: latest update on 2015-01-02, rust version 1.1.0 (hash-stable-1.1.0) +info: syncing channel updates for stable-[HOST_TRIPLE] +info: latest update on 2015-01-02 for version 1.1.0 (hash-stable-1.1.0) info: downloading component[..] ... -info: default toolchain set to 'stable-[HOST_TRIPLE]' +info: default toolchain set to stable-[HOST_TRIPLE] ... "#]]) .is_ok(); @@ -692,7 +692,7 @@ async fn rustup_self_update_exact() { "#]]) .with_stderr(snapbox::str![[r#" -info: syncing channel updates for 'stable-[HOST_TRIPLE]' +info: syncing channel updates for stable-[HOST_TRIPLE] info: checking for self-update (current version: [CURRENT_VERSION]) info: downloading self-update (new version: [TEST_VERSION]) info: cleaning up downloads & tmp directories @@ -899,7 +899,7 @@ async fn reinstall_specifying_different_toolchain() { .await .with_stderr(snapbox::str![[r#" ... -info: default toolchain set to 'nightly-[HOST_TRIPLE]' +info: default toolchain set to nightly-[HOST_TRIPLE] ... "#]]) .is_ok(); diff --git a/tests/suite/cli_v1.rs b/tests/suite/cli_v1.rs index 40fae3c9b1..194e6b73c3 100644 --- a/tests/suite/cli_v1.rs +++ b/tests/suite/cli_v1.rs @@ -278,7 +278,7 @@ async fn remove_override_toolchain_err_handling() { "#]]) .with_stderr(snapbox::str![[r#" -info: syncing channel updates for 'beta-[HOST_TRIPLE]' +info: syncing channel updates for beta-[HOST_TRIPLE] ... "#]]) .is_ok(); diff --git a/tests/suite/cli_v2.rs b/tests/suite/cli_v2.rs index fb2ab7bdc2..4538ccdad9 100644 --- a/tests/suite/cli_v2.rs +++ b/tests/suite/cli_v2.rs @@ -485,8 +485,8 @@ async fn remove_override_toolchain_err_handling() { "#]]) .with_stderr(snapbox::str![[r#" -info: syncing channel updates for 'beta-[HOST_TRIPLE]' -info: latest update on 2015-01-02, rust version 1.2.0 (hash-beta-1.2.0) +info: syncing channel updates for beta-[HOST_TRIPLE] +info: latest update on 2015-01-02 for version 1.2.0 (hash-beta-1.2.0) info: downloading component[..] ... "#]]) @@ -518,8 +518,8 @@ async fn file_override_toolchain_err_handling() { "#]]) .with_stderr(snapbox::str![[r#" -info: syncing channel updates for 'beta-[HOST_TRIPLE]' -info: latest update on 2015-01-02, rust version 1.2.0 (hash-beta-1.2.0) +info: syncing channel updates for beta-[HOST_TRIPLE] +info: latest update on 2015-01-02 for version 1.2.0 (hash-beta-1.2.0) info: downloading component[..] ... "#]]) @@ -1630,7 +1630,7 @@ async fn add_target_again() { .expect(["rustup", "target", "add", CROSS_ARCH1]) .await .with_stderr(snapbox::str![[r#" -info: component 'rust-std' for target '[CROSS_ARCH_I]' is up to date +info: component rust-std for target [CROSS_ARCH_I] is up to date "#]]) .is_ok(); @@ -1914,7 +1914,7 @@ async fn warn_about_and_remove_stray_hash() { .await .with_stderr(snapbox::str![[r#" ... -warn: removing stray hash found at '[..]/update-hashes/nightly-[HOST_TRIPLE]' in order to continue +warn: removing stray hash file in order to continue: [..]/update-hashes/nightly-[HOST_TRIPLE] ... "#]]) .is_ok(); @@ -1972,7 +1972,7 @@ async fn add_missing_component() { .with_stderr(snapbox::str![[r#" ... error: component 'rls' for target '[HOST_TRIPLE]' is unavailable for download for channel 'nightly' -Sometimes not all components are available in any given nightly. +(sometimes not all components are available in any given nightly) ... "#]]) .is_err(); @@ -2419,7 +2419,7 @@ error: component 'rls' for target '[HOST_TRIPLE]' is unavailable for download fo .await .with_stderr(snapbox::str![[r#" ... -warn: Force-skipping unavailable component 'rls-[HOST_TRIPLE]' +warn: skipping unavailable component rls ... "#]]) .is_ok(); @@ -2458,9 +2458,9 @@ async fn run_with_install_flag_against_unavailable_component() { "#]]) .with_stderr(snapbox::str![[r#" -info: syncing channel updates for 'nightly-[HOST_TRIPLE]' -info: latest update on 2015-01-02, rust version 1.3.0 (hash-nightly-2) -warn: Force-skipping unavailable component 'rust-std-[HOST_TRIPLE]' +info: syncing channel updates for nightly-[HOST_TRIPLE] +info: latest update on 2015-01-02 for version 1.3.0 (hash-nightly-2) +warn: skipping unavailable component rust-std info: downloading component[..] ... "#]]) @@ -2563,7 +2563,7 @@ async fn regression_2601() { .expect(["rustup", "component", "add", "rust-src"]) .await .with_stderr(snapbox::str![[r#" -info: component 'rust-src' is up to date +info: component rust-src is up to date "#]]) .is_ok();