diff --git a/build.rs b/build.rs index c56f9df520..9b177c2972 100644 --- a/build.rs +++ b/build.rs @@ -3,20 +3,32 @@ use std::env; use platforms::Platform; fn from_build() -> Result { - let triple = - env::var("RUSTUP_OVERRIDE_BUILD_TRIPLE").unwrap_or_else(|_| env::var("TARGET").unwrap()); - if Platform::ALL.iter().any(|p| p.target_triple == triple) { - Ok(triple) + let tuple = { + if let Ok(tuple) = env::var("RUSTUP_OVERRIDE_BUILD_TUPLE") { + tuple + } else if let Ok(tuple) = env::var("RUSTUP_OVERRIDE_BUILD_TRIPLE") { + tuple + } else if let Ok(tuple) = env::var("TARGET") { + tuple + } else { + panic!( + "Unable to get target tuple from environment; Be sure that TARGET env var is set, or its overrides" + ) + } + }; + if Platform::ALL.iter().any(|p| p.target_triple == tuple) { + Ok(tuple) } else { - Err(triple) + Err(tuple) } } fn main() { + println!("cargo::rerun-if-env-changed=RUSTUP_OVERRIDE_BUILD_TUPLE"); println!("cargo::rerun-if-env-changed=RUSTUP_OVERRIDE_BUILD_TRIPLE"); println!("cargo::rerun-if-env-changed=TARGET"); match from_build() { - Ok(triple) => eprintln!("Computed build based on target tuple: {triple:#?}"), + Ok(tuple) => eprintln!("Computed build based on target tuple: {tuple:#?}"), Err(s) => { eprintln!("Unable to parse target '{s}' as a known target tuple"); eprintln!( diff --git a/doc/user-guide/src/concepts/components.md b/doc/user-guide/src/concepts/components.md index ea56b844c6..2d9b74beeb 100644 --- a/doc/user-guide/src/concepts/components.md +++ b/doc/user-guide/src/concepts/components.md @@ -24,7 +24,7 @@ To make it easier to choose which components are installed, `rustup` has the concept of "profiles" which provide named groupings of different components. See the [Profiles] chapter for more detail. -Most components have a target-triple suffix, such as +Most components have a target-tuple suffix, such as `rustc-x86_64-apple-darwin`, to signify the platform the component is for. The set of available components may vary with different releases and diff --git a/doc/user-guide/src/concepts/toolchains.md b/doc/user-guide/src/concepts/toolchains.md index 2d4d0a3bfc..336d6a5ae8 100644 --- a/doc/user-guide/src/concepts/toolchains.md +++ b/doc/user-guide/src/concepts/toolchains.md @@ -19,7 +19,7 @@ Standard release channel toolchain names have the following form: = | = beta[.] = YYYY-MM-DD - = + = ``` 'channel' is a named release channel, a major and minor version number such as diff --git a/doc/user-guide/src/installation/other.md b/doc/user-guide/src/installation/other.md index 0dcb9cd47d..2bd4df5b91 100644 --- a/doc/user-guide/src/installation/other.md +++ b/doc/user-guide/src/installation/other.md @@ -102,7 +102,7 @@ which is a `brew`-managed `rust` toolchain installation. ## Manual installation You can manually download `rustup-init` for a given target from -`https://static.rust-lang.org/rustup/dist/{target-triple}/rustup-init[.exe]`[^msys2] [^msvc]. +`https://static.rust-lang.org/rustup/dist/{target-tuple}/rustup-init[.exe]`[^msys2] [^msvc].
Direct links @@ -185,7 +185,7 @@ You can manually download `rustup-init` for a given target from
To get a previous version, use -`https://static.rust-lang.org/rustup/archive/{rustup-version}/{target-triple}/rustup-init[.exe]`. +`https://static.rust-lang.org/rustup/archive/{rustup-version}/{target-tuple}/rustup-init[.exe]`. SHA-256 checksums are also available by appending `.sha256` to the link. diff --git a/doc/user-guide/src/installation/windows.md b/doc/user-guide/src/installation/windows.md index 97499c049d..570914e23f 100644 --- a/doc/user-guide/src/installation/windows.md +++ b/doc/user-guide/src/installation/windows.md @@ -19,8 +19,8 @@ By default `rustup` on Windows configures Rust to target the MSVC ABI, that is a target tuple of either `i686-pc-windows-msvc`, `x86_64-pc-windows-msvc`, or `aarch64-pc-windows-msvc` depending on the CPU architecture of the host Windows OS. The toolchains that `rustup` chooses to install, unless told otherwise through the [toolchain -specification], will be compiled to run on that target tuple host and will -target that triple by default. +specification], will be compiled to run on that host target, and will +target that tuple by default. You can change this behavior with `rustup set default-host` or during installation. diff --git a/rustup-init.sh b/rustup-init.sh index 1538145f77..4e81ea1a98 100755 --- a/rustup-init.sh +++ b/rustup-init.sh @@ -47,7 +47,7 @@ Options: -y Disable confirmation prompt --default-host - Choose a default host triple + Choose a default host tuple --default-toolchain Choose a default toolchain to install. Use 'none' to not install any toolchains at all --profile diff --git a/src/cli/common.rs b/src/cli/common.rs index f36cf3287a..f7288f9329 100644 --- a/src/cli/common.rs +++ b/src/cli/common.rs @@ -16,7 +16,7 @@ use tracing_subscriber::{EnvFilter, Registry, reload::Handle}; use crate::{ config::Cfg, - dist::{DistOptions, TargetTriple, ToolchainDesc}, + dist::{DistOptions, TargetTuple, ToolchainDesc}, errors::RustupError, install::{InstallMethod, UpdateStatus}, process::Process, @@ -497,16 +497,16 @@ pub(crate) fn ignorable_error( /// - The `force_non_host` flag is set to `false`. pub(crate) fn check_non_host_toolchain( toolchain: String, - host_arch: &TargetTriple, - target_triple: &TargetTriple, + host_arch: &TargetTuple, + target_tuple: &TargetTuple, force_non_host: bool, ) -> Result<()> { - if force_non_host || host_arch.can_run(target_triple)? { + if force_non_host || host_arch.can_run(target_tuple)? { return Ok(()); } Err(RustupError::ToolchainIncompatible { toolchain, - target_triple: target_triple.clone(), + target_tuple: target_tuple.clone(), } .into()) } @@ -518,10 +518,10 @@ pub(crate) fn warn_if_host_is_emulated(process: &Process) { if process.var("RUSTUP_CI").is_ok() { return; } - if TargetTriple::is_host_emulated() { + if TargetTuple::is_host_emulated() { warn!( "Rustup is not running natively. It's running under emulation of {}.", - TargetTriple::from_host_or_build(process) + TargetTuple::from_host_or_build(process) ); warn!( "For best compatibility and performance you should reinstall rustup for your native CPU." diff --git a/src/cli/help.rs b/src/cli/help.rs index 8e55180f66..d9c6377499 100644 --- a/src/cli/help.rs +++ b/src/cli/help.rs @@ -88,7 +88,7 @@ pub(crate) fn toolchain_help() -> String { {PLACEHOLDER} = |{PLACEHOLDER:#} {PLACEHOLDER} = beta[.]{PLACEHOLDER:#} {PLACEHOLDER} = YYYY-MM-DD{PLACEHOLDER:#} - {PLACEHOLDER} = {PLACEHOLDER:#} + {PLACEHOLDER} = {PLACEHOLDER:#} 'channel' is a named release channel, a major and minor version number such as `1.42`, or a fully specified version number, such diff --git a/src/cli/proxy_mode.rs b/src/cli/proxy_mode.rs index 15431bd2d4..af513375be 100644 --- a/src/cli/proxy_mode.rs +++ b/src/cli/proxy_mode.rs @@ -36,7 +36,7 @@ pub async fn main(arg0: &str, current_dir: PathBuf, process: &Process) -> Result let (toolchain, source) = cfg .local_toolchain(match toolchain { Some(name) => Some(( - name.resolve(&cfg.get_default_host_triple()?)?, + name.resolve(&cfg.get_default_host_tuple()?)?, ActiveSource::CommandLine, )), None => None, diff --git a/src/cli/rustup_mode.rs b/src/cli/rustup_mode.rs index 7518642759..edf4c0c99c 100644 --- a/src/cli/rustup_mode.rs +++ b/src/cli/rustup_mode.rs @@ -41,7 +41,7 @@ use crate::{ command, component_for_bin, config::{ActiveSource, Cfg}, dist::{ - AutoInstallMode, DistOptions, PartialToolchainDesc, Profile, TargetTriple, + AutoInstallMode, DistOptions, PartialToolchainDesc, Profile, TargetTuple, download::DownloadCfg, manifest::{Component, ComponentStatus}, }, @@ -562,8 +562,8 @@ enum SelfSubcmd { #[derive(Debug, Subcommand)] #[command(arg_required_else_help = true, subcommand_required = true)] enum SetSubcmd { - /// The triple used to identify toolchains when not specified - DefaultHost { host_triple: String }, + /// The tuple used to identify toolchains when not specified + DefaultHost { host_tuple: String }, /// The default components installed with a toolchain Profile { @@ -742,9 +742,9 @@ pub async fn main( SelfSubcmd::UpgradeData => cfg.upgrade_data().map(|_| ExitCode(0)), }, RustupSubcmd::Set { subcmd } => match subcmd { - SetSubcmd::DefaultHost { host_triple } => cfg - .set_default_host_triple(host_triple) - .map(|_| ExitCode(0)), + SetSubcmd::DefaultHost { host_tuple } => { + cfg.set_default_host_tuple(host_tuple).map(|_| ExitCode(0)) + } SetSubcmd::Profile { profile_name } => { cfg.set_profile(profile_name).map(|_| ExitCode(0)) } @@ -778,7 +778,7 @@ async fn default_( cfg.set_default(Some(&toolchain_name.into()))?; } MaybeResolvableToolchainName::Some(ResolvableToolchainName::Official(toolchain)) => { - let desc = toolchain.resolve(&cfg.get_default_host_triple()?)?; + let desc = toolchain.resolve(&cfg.get_default_host_tuple()?)?; let status = cfg .ensure_installed(&desc, vec![], vec![], None, force_non_host, true) .await? @@ -951,17 +951,17 @@ async fn update( if !names.is_empty() { for name in names { // This needs another pass to fix it all up - if name.has_triple() { - let host_arch = TargetTriple::from_host_or_build(cfg.process); - let target_triple = name.clone().resolve(&host_arch)?.target; + if name.has_tuple() { + let host_arch = TargetTuple::from_host_or_build(cfg.process); + let target_tuple = name.clone().resolve(&host_arch)?.target; common::check_non_host_toolchain( name.to_string(), &host_arch, - &target_triple, + &target_tuple, force_non_host, )?; } - let desc = name.resolve(&cfg.get_default_host_triple()?)?; + let desc = name.resolve(&cfg.get_default_host_tuple()?)?; let components = opts.component.iter().map(|s| &**s).collect::>(); let targets = opts.target.iter().map(|s| &**s).collect::>(); @@ -1024,7 +1024,7 @@ async fn run( command: Vec, install: bool, ) -> Result { - let toolchain = toolchain.resolve(&cfg.get_default_host_triple()?)?; + let toolchain = toolchain.resolve(&cfg.get_default_host_tuple()?)?; let toolchain = Toolchain::from_local(toolchain, install, cfg).await?; let cmd = toolchain.command(&command[0])?; command::run_command_for_dir(cmd, &command[0], &command[1..]) @@ -1038,7 +1038,7 @@ async fn which( let (toolchain, _) = cfg .local_toolchain(match toolchain { Some(name) => Some(( - name.resolve(&cfg.get_default_host_triple()?)?.into(), + name.resolve(&cfg.get_default_host_tuple()?)?.into(), ActiveSource::CommandLine, // From --toolchain option )), None => None, @@ -1072,14 +1072,14 @@ async fn which( async fn show(cfg: &Cfg<'_>, verbose: bool) -> Result { common::warn_if_host_is_emulated(cfg.process); - // Print host triple + // Print host tuple { let t = cfg.process.stdout(); let mut t = t.lock(); writeln!( t, "{HEADER}Default host: {HEADER:#}{}", - cfg.get_default_host_triple()? + cfg.get_default_host_tuple()? )?; } @@ -1323,7 +1323,7 @@ async fn target_add( for target in targets { let new_component = Component::new( "rust-std".to_string(), - Some(TargetTriple::new(target)), + Some(TargetTuple::new(target)), false, ); distributable.add_component(new_component).await?; @@ -1344,8 +1344,8 @@ async fn target_remove( .await?; for target in targets { - let target = TargetTriple::new(target); - let default_target = cfg.get_default_host_triple()?; + let target = TargetTuple::new(target); + let default_target = cfg.get_default_host_tuple()?; if target == default_target { warn!( "removing the default host target; proc-macros and build scripts might no longer build" @@ -1429,9 +1429,9 @@ async fn component_add( fn get_target( target: Option, distributable: &DistributableToolchain<'_>, -) -> Option { +) -> Option { target - .map(TargetTriple::new) + .map(TargetTuple::new) .or_else(|| Some(distributable.desc().target.clone())) } @@ -1490,7 +1490,7 @@ async fn toolchain_remove(cfg: &mut Cfg<'_>, opts: UninstallOpts) -> Result, ) -> Result { - let toolchain_name = toolchain.resolve(&cfg.get_default_host_triple()?)?; + let toolchain_name = toolchain.resolve(&cfg.get_default_host_tuple()?)?; match Toolchain::new(cfg, (&toolchain_name).into()) { Ok(_) => {} Err(e @ RustupError::ToolchainNotInstalled { .. }) => match &toolchain_name { diff --git a/src/cli/self_update.rs b/src/cli/self_update.rs index 7f09e5050b..dc837e0bef 100644 --- a/src/cli/self_update.rs +++ b/src/cli/self_update.rs @@ -60,7 +60,7 @@ use crate::{ }, config::Cfg, dist::{ - DistOptions, PartialToolchainDesc, Profile, TargetTriple, ToolchainDesc, + DistOptions, PartialToolchainDesc, Profile, TargetTuple, ToolchainDesc, download::DownloadCfg, }, download::download_file, @@ -99,7 +99,7 @@ use windows::{delete_rustup_and_cargo_home, do_add_to_path, do_remove_from_path} pub(crate) use windows::{run_update, self_replace}; pub(crate) struct InstallOpts<'a> { - pub default_host_triple: Option, + pub default_host_tuple: Option, pub default_toolchain: Option, pub profile: Profile, pub no_modify_path: bool, @@ -111,7 +111,7 @@ pub(crate) struct InstallOpts<'a> { impl InstallOpts<'_> { fn install(self, cfg: &mut Cfg<'_>) -> Result> { let Self { - default_host_triple, + default_host_tuple, default_toolchain, profile, no_modify_path: _no_modify_path, @@ -122,12 +122,12 @@ impl InstallOpts<'_> { cfg.set_profile(profile)?; - if let Some(default_host_triple) = &default_host_triple { - // Set host triple now as it will affect resolution of toolchain_str - info!("setting default host triple to {}", default_host_triple); - cfg.set_default_host_triple(default_host_triple.to_owned())?; + if let Some(default_host_tuple) = &default_host_tuple { + // Set host tuple now as it will affect resolution of toolchain_str + info!("setting default host tuple to {}", default_host_tuple); + cfg.set_default_host_tuple(default_host_tuple.to_owned())?; } else { - info!("default host triple is {}", cfg.get_default_host_triple()?); + info!("default host tuple is {}", cfg.get_default_host_tuple()?); } let user_specified_something = default_toolchain.is_some() @@ -167,7 +167,7 @@ impl InstallOpts<'_> { MaybeOfficialToolchainName::None => unreachable!(), MaybeOfficialToolchainName::Some(n) => n, }; - Some(toolchain_name.resolve(&cfg.get_default_host_triple()?)?) + Some(toolchain_name.resolve(&cfg.get_default_host_tuple()?)?) } None => match cfg.get_default()? { // Default is installable @@ -177,7 +177,7 @@ impl InstallOpts<'_> { None => Some( "stable" .parse::()? - .resolve(&cfg.get_default_host_triple()?)?, + .resolve(&cfg.get_default_host_tuple()?)?, ), }, }) @@ -198,12 +198,12 @@ impl InstallOpts<'_> { writeln!(process.stdout().lock())?; - self.default_host_triple = Some(common::question_str( - "Default host triple?", + self.default_host_tuple = Some(common::question_str( + "Default host tuple?", &self - .default_host_triple + .default_host_tuple .take() - .unwrap_or_else(|| TargetTriple::from_host_or_build(process).to_string()), + .unwrap_or_else(|| TargetTuple::from_host_or_build(process).to_string()), process, )?); @@ -235,18 +235,18 @@ impl InstallOpts<'_> { fn validate(&self, process: &Process) -> Result<()> { common::warn_if_host_is_emulated(process); - let host_triple = self - .default_host_triple + let host_tuple = self + .default_host_tuple .as_ref() - .map(TargetTriple::new) - .unwrap_or_else(|| TargetTriple::from_host_or_build(process)); + .map(TargetTuple::new) + .unwrap_or_else(|| TargetTuple::from_host_or_build(process)); let partial_channel = match &self.default_toolchain { None | Some(MaybeOfficialToolchainName::None) => { ResolvableToolchainName::try_from("stable")? } Some(MaybeOfficialToolchainName::Some(s)) => s.into(), }; - let resolved = partial_channel.resolve(&host_triple)?; + let resolved = partial_channel.resolve(&host_tuple)?; trace!("Successfully resolved installation toolchain as: {resolved}"); Ok(()) } @@ -585,8 +585,8 @@ pub(crate) async fn install( anyhow!( "Pre-checks for host and toolchain failed: {e}\n\ If you are unsure of suitable values, the 'stable' toolchain is the default.\n\ - Valid host triples look something like: {}", - TargetTriple::from_host_or_build(cfg.process) + Valid host tuples look something like: {}", + TargetTuple::from_host_or_build(cfg.process) ) })?; @@ -745,7 +745,7 @@ fn check_existence_of_settings_file(process: &Process) -> Result<()> { warn!("It looks like you have an existing rustup settings file at:"); warn!("{}", settings_file_path.display()); warn!("Rustup will install the default toolchain as specified in the settings file,"); - warn!("instead of the one inferred from the default host triple."); + warn!("instead of the one inferred from the default host tuple."); } Ok(()) } @@ -795,15 +795,15 @@ fn current_install_opts(opts: &InstallOpts<'_>, process: &Process) -> String { format!( r"Current installation options: -- ` `default host triple: `{}` +- ` `default host tuple: `{}` - ` `default toolchain: `{}` - ` `profile: `{}` - modify PATH variable: `{}` ", - opts.default_host_triple + opts.default_host_tuple .as_ref() - .map(TargetTriple::new) - .unwrap_or_else(|| TargetTriple::from_host_or_build(process)), + .map(TargetTuple::new) + .unwrap_or_else(|| TargetTuple::from_host_or_build(process)), opts.default_toolchain .as_ref() .map(ToString::to_string) @@ -1277,17 +1277,17 @@ pub(crate) async fn prepare_update(dl_cfg: &DownloadCfg<'_>) -> Result) -> Result() .unwrap() - .resolve(&cfg.get_default_host_triple().unwrap()) + .resolve(&cfg.get_default_host_tuple().unwrap()) .unwrap(), opts.install(&mut cfg) .unwrap() // result @@ -1466,7 +1466,7 @@ mod tests { assert_eq!( for_host!( r"info: profile set to default -info: default host triple is {0} +info: default host tuple is {0} " ), &String::from_utf8(tp.stderr()).unwrap() diff --git a/src/cli/self_update/windows.rs b/src/cli/self_update/windows.rs index 973fd58d85..399b435995 100644 --- a/src/cli/self_update/windows.rs +++ b/src/cli/self_update/windows.rs @@ -21,7 +21,7 @@ use super::common; use super::{InstallOpts, install_bins, report_error}; use crate::cli::markdown::md; use crate::config::Cfg; -use crate::dist::TargetTriple; +use crate::dist::TargetTuple; use crate::dist::download::DownloadCfg; use crate::download::download_file; use crate::process::{ColorableTerminal, Process}; @@ -187,20 +187,20 @@ pub(crate) fn do_msvc_check(opts: &InstallOpts<'_>, process: &Process) -> Option } use cc::windows_registry; - let host_triple = if let Some(trip) = opts.default_host_triple.as_ref() { + let host_tuple = if let Some(trip) = opts.default_host_tuple.as_ref() { trip.to_owned() } else { - TargetTriple::from_host_or_build(process).to_string() + TargetTuple::from_host_or_build(process).to_string() }; - let installing_msvc = host_triple.contains("msvc"); - let have_msvc = windows_registry::find_tool(&host_triple, "cl.exe").is_some(); + let installing_msvc = host_tuple.contains("msvc"); + let have_msvc = windows_registry::find_tool(&host_tuple, "cl.exe").is_some(); if installing_msvc && !have_msvc { // Visual Studio build tools are required. // If the user does not have Visual Studio installed and their host // machine is i686 or x86_64 then it's OK to try an auto install. // Otherwise a manual install will be required. let has_any_vs = windows_registry::find_vs_version().is_ok(); - let is_x86 = host_triple.contains("i686") || host_triple.contains("x86_64"); + let is_x86 = host_tuple.contains("i686") || host_tuple.contains("x86_64"); if is_x86 && !has_any_vs { Some(VsInstallPlan::Automatic) } else { diff --git a/src/cli/setup_mode.rs b/src/cli/setup_mode.rs index 3ca6528d44..84c63e5b40 100644 --- a/src/cli/setup_mode.rs +++ b/src/cli/setup_mode.rs @@ -39,7 +39,7 @@ struct RustupInit { #[arg(short = 'y')] no_prompt: bool, - /// Choose a default host triple + /// Choose a default host tuple #[arg(long)] default_host: Option, @@ -121,7 +121,7 @@ pub async fn main( update_console_filter(process, &console_filter, quiet, verbose); let opts = InstallOpts { - default_host_triple: default_host, + default_host_tuple: default_host, default_toolchain, profile, no_modify_path, diff --git a/src/config.rs b/src/config.rs index c7256339fb..02c38731ff 100644 --- a/src/config.rs +++ b/src/config.rs @@ -11,7 +11,7 @@ use tracing::{debug, info, trace, warn}; use crate::{ cli::{common, self_update::SelfUpdateMode}, dist::{ - self, AutoInstallMode, DistOptions, PartialToolchainDesc, Profile, TargetTriple, + self, AutoInstallMode, DistOptions, PartialToolchainDesc, Profile, TargetTuple, ToolchainDesc, }, errors::RustupError, @@ -144,7 +144,7 @@ impl OverrideCfg { fn from_file(cfg: &Cfg<'_>, file: OverrideFile) -> Result { let toolchain_name = match (file.toolchain.channel, file.toolchain.path) { (Some(name), None) => { - ResolvableToolchainName::try_from(name)?.resolve(&cfg.get_default_host_triple()?)? + ResolvableToolchainName::try_from(name)?.resolve(&cfg.get_default_host_tuple()?)? } (None, Some(path)) => { if file.toolchain.targets.is_some() @@ -288,13 +288,12 @@ impl<'a> Cfg<'a> { let update_hash_dir = rustup_dir.join("update-hashes"); let download_dir = rustup_dir.join("downloads"); - // Figure out get_default_host_triple before Config is populated - let default_host_triple = - settings_file.with(|s| Ok(get_default_host_triple(s, process)))?; + // Figure out get_default_host_tuple before Config is populated + let default_host_tuple = settings_file.with(|s| Ok(get_default_host_tuple(s, process)))?; // Environment override let env_override = match process.var_opt("RUSTUP_TOOLCHAIN")? { Some(tc) => { - Some(ResolvableLocalToolchainName::try_from(&tc)?.resolve(&default_host_triple)?) + Some(ResolvableLocalToolchainName::try_from(&tc)?.resolve(&default_host_tuple)?) } None => None, }; @@ -323,7 +322,7 @@ impl<'a> Cfg<'a> { // For now, that means simply checking that 'stable' can resolve // for the current configuration. ResolvableToolchainName::try_from("stable")?.resolve( - &cfg.get_default_host_triple() + &cfg.get_default_host_tuple() .context("Unable parse configuration")?, )?; @@ -483,7 +482,7 @@ impl<'a> Cfg<'a> { .map(|(desc, source)| { anyhow::Ok(( LocalToolchainName::Named(ToolchainName::Official( - desc.resolve(&self.get_default_host_triple()?)?, + desc.resolve(&self.get_default_host_tuple()?)?, )), source, )) @@ -529,7 +528,7 @@ impl<'a> Cfg<'a> { let override_config: Option<(OverrideCfg, ActiveSource)> = // First check +toolchain override from the command line if let Some(name) = &self.toolchain_override { - let override_config = name.resolve(&self.get_default_host_triple()?)?.into(); + let override_config = name.resolve(&self.get_default_host_tuple()?)?.into(); Some((override_config, ActiveSource::CommandLine)) } // Then check the RUSTUP_TOOLCHAIN environment variable @@ -574,7 +573,7 @@ impl<'a> Cfg<'a> { // have an unresolved name. I'm just preserving pre-existing // behaviour by choosing ResolvableToolchainName here. let toolchain_name = ResolvableToolchainName::try_from(name)? - .resolve(&get_default_host_triple(settings, self.process))?; + .resolve(&get_default_host_tuple(settings, self.process))?; let override_cfg = toolchain_name.into(); return Ok(Some((override_cfg, source))); } @@ -632,11 +631,11 @@ impl<'a> Cfg<'a> { toolchain_file.display() ) })?; - let default_host_triple = get_default_host_triple(settings, self.process); + let default_host_tuple = get_default_host_tuple(settings, self.process); // Do not permit architecture/os selection in channels as // these are host specific and toolchain files are portable. if let ResolvableToolchainName::Official(name) = &toolchain_name - && name.has_triple() + && name.has_tuple() { // Permit fully qualified names IFF the toolchain is installed. TODO(robertc): consider // disabling this and backing out https://github.com/rust-lang/rustup/pull/2141 (but provide @@ -648,7 +647,7 @@ impl<'a> Cfg<'a> { } // XXX: this awkwardness deals with settings file being locked already - let toolchain_name = toolchain_name.resolve(&default_host_triple)?; + let toolchain_name = toolchain_name.resolve(&default_host_tuple)?; if !Toolchain::exists(self, &(&toolchain_name).into())? && matches!(toolchain_name, ToolchainName::Custom(_)) { @@ -779,7 +778,7 @@ impl<'a> Cfg<'a> { ) -> Result<(UpdateStatus, Toolchain<'_>)> { common::check_non_host_toolchain( toolchain.to_string(), - &TargetTriple::from_host_or_build(self.process), + &TargetTuple::from_host_or_build(self.process), &toolchain.target, force_non_host, )?; @@ -839,7 +838,7 @@ impl<'a> Cfg<'a> { toolchain_maybe_str .map(ResolvableToolchainName::try_from) .transpose()? - .map(|t| t.resolve(&self.get_default_host_triple()?)) + .map(|t| t.resolve(&self.get_default_host_tuple()?)) .transpose() } @@ -896,22 +895,21 @@ impl<'a> Cfg<'a> { }) } - pub(crate) fn set_default_host_triple(&self, host_triple: String) -> Result<()> { - // Ensure that the provided host_triple is capable of resolving + pub(crate) fn set_default_host_tuple(&self, host_tuple: String) -> Result<()> { + // Ensure that the provided host_tuple is capable of resolving // against the 'stable' toolchain. This provides early errors - // if the supplied triple is insufficient / bad. - PartialToolchainDesc::from_str("stable")? - .resolve(&TargetTriple::new(host_triple.clone()))?; + // if the supplied tuple is insufficient / bad. + PartialToolchainDesc::from_str("stable")?.resolve(&TargetTuple::new(host_tuple.clone()))?; self.settings_file.with_mut(|s| { - s.default_host_triple = Some(host_triple); + s.default_host_tuple = Some(host_tuple); Ok(()) }) } #[tracing::instrument(level = "trace", skip_all)] - pub(crate) fn get_default_host_triple(&self) -> Result { + pub(crate) fn get_default_host_tuple(&self) -> Result { self.settings_file - .with(|s| Ok(get_default_host_triple(s, self.process))) + .with(|s| Ok(get_default_host_tuple(s, self.process))) } /// The path on disk of any concrete toolchain @@ -980,11 +978,11 @@ impl Debug for Cfg<'_> { } } -fn get_default_host_triple(s: &Settings, process: &Process) -> TargetTriple { - s.default_host_triple +fn get_default_host_tuple(s: &Settings, process: &Process) -> TargetTuple { + s.default_host_tuple .as_ref() - .map(TargetTriple::new) - .unwrap_or_else(|| TargetTriple::from_host_or_build(process)) + .map(TargetTuple::new) + .unwrap_or_else(|| TargetTuple::from_host_or_build(process)) } fn no_toolchain_error(process: &Process) -> anyhow::Error { diff --git a/src/dist/manifest.rs b/src/dist/manifest.rs index 903a4c4235..d5aa8a9bba 100644 --- a/src/dist/manifest.rs +++ b/src/dist/manifest.rs @@ -22,7 +22,7 @@ use anyhow::{Context, Result, anyhow, bail}; use serde::{Deserialize, Serialize}; use crate::{ - dist::{Profile, TargetTriple, ToolchainDesc, config::Config}, + dist::{Profile, TargetTuple, ToolchainDesc, config::Config}, errors::RustupError, toolchain::DistributableToolchain, }; @@ -94,16 +94,16 @@ pub struct Package { #[serde(from = "TargetsMap", into = "TargetsMap")] pub enum PackageTargets { Wildcard(TargetedPackage), - Targeted(HashMap), + Targeted(HashMap), } #[derive(Deserialize, Serialize)] #[serde(transparent)] -struct TargetsMap(HashMap); +struct TargetsMap(HashMap); impl From for PackageTargets { fn from(mut map: TargetsMap) -> Self { - let wildcard = TargetTriple::new("*"); + let wildcard = TargetTuple::new("*"); match (map.0.len(), map.0.entry(wildcard)) { (1, Entry::Occupied(entry)) => Self::Wildcard(entry.remove()), (_, _) => Self::Targeted(map.0), @@ -116,7 +116,7 @@ impl From for TargetsMap { match targets { PackageTargets::Wildcard(tpkg) => { let mut map = HashMap::new(); - map.insert(TargetTriple::new("*"), tpkg); + map.insert(TargetTuple::new("*"), tpkg); Self(map) } PackageTargets::Targeted(tpkgs) => Self(tpkgs), @@ -253,7 +253,7 @@ pub struct HashedBinary { pub struct Component { pub pkg: String, #[serde(with = "component_target")] - pub target: Option, + pub target: Option, // Older Rustup distinguished between components (which are essential) and // extensions (which are not). #[serde(default)] @@ -277,11 +277,11 @@ impl Hash for Component { } mod component_target { - use super::{Result, TargetTriple}; + use super::{Result, TargetTuple}; use serde::{Deserialize, Deserializer, Serializer}; pub fn serialize( - target: &Option, + target: &Option, serializer: S, ) -> Result { serializer.serialize_str(match target { @@ -292,9 +292,9 @@ mod component_target { pub fn deserialize<'de, D: Deserializer<'de>>( deserializer: D, - ) -> Result, D::Error> { + ) -> Result, D::Error> { Ok(match Option::::deserialize(deserializer)? { - Some(s) if s != "*" => Some(TargetTriple::new(s)), + Some(s) if s != "*" => Some(TargetTuple::new(s)), _ => None, }) } @@ -333,7 +333,7 @@ impl Manifest { self.get_package("rust").map(|p| &*p.version) } - pub(crate) fn get_legacy_components(&self, target: &TargetTriple) -> Result> { + pub(crate) fn get_legacy_components(&self, target: &TargetTuple) -> Result> { // Build a profile from the components/extensions. let result = self .get_package("rust")? @@ -349,7 +349,7 @@ impl Manifest { pub fn get_profile_components( &self, profile: Profile, - target: &TargetTriple, + target: &TargetTuple, ) -> Result> { // An older manifest with no profiles section. if self.profiles.is_empty() { @@ -451,7 +451,7 @@ impl Manifest { for component in &targ_pkg.components { let installed = component.contained_within(&config.components); - let component_target = TargetTriple::new(component.target()); + let component_target = TargetTuple::new(component.target()); // Get the component so we can check if it is available let component_pkg = self @@ -482,7 +482,7 @@ impl Manifest { } impl Package { - pub fn get_target(&self, target: Option<&TargetTriple>) -> Result<&TargetedPackage> { + pub fn get_target(&self, target: Option<&TargetTuple>) -> Result<&TargetedPackage> { match &self.targets { PackageTargets::Wildcard(tpkg) => Ok(tpkg), PackageTargets::Targeted(tpkgs) => { @@ -500,13 +500,13 @@ impl Package { } impl PackageTargets { - pub(crate) fn get<'a>(&'a self, target: &TargetTriple) -> Option<&'a TargetedPackage> { + pub(crate) fn get<'a>(&'a self, target: &TargetTuple) -> Option<&'a TargetedPackage> { match self { Self::Wildcard(tpkg) => Some(tpkg), Self::Targeted(tpkgs) => tpkgs.get(target), } } - pub fn get_mut<'a>(&'a mut self, target: &TargetTriple) -> Option<&'a mut TargetedPackage> { + pub fn get_mut<'a>(&'a mut self, target: &TargetTuple) -> Option<&'a mut TargetedPackage> { match self { Self::Wildcard(tpkg) => Some(tpkg), Self::Targeted(tpkgs) => tpkgs.get_mut(target), @@ -521,7 +521,7 @@ impl TargetedPackage { } impl Component { - pub fn new(pkg: String, target: Option, is_extension: bool) -> Self { + pub fn new(pkg: String, target: Option, is_extension: bool) -> Self { Self { pkg, target, @@ -532,7 +532,7 @@ impl Component { pub(crate) fn try_new( name: &str, distributable: &DistributableToolchain<'_>, - fallback_target: Option<&TargetTriple>, + fallback_target: Option<&TargetTuple>, ) -> Result { let manifest = distributable.get_manifest()?; for component_status in distributable.components()? { @@ -634,7 +634,7 @@ impl fmt::Display for ManifestVersion { #[cfg(test)] mod tests { use crate::RustupError; - use crate::dist::TargetTriple; + use crate::dist::TargetTuple; use crate::dist::manifest::Manifest; // Example manifest from https://public.etherpad-mozilla.org/p/Rust-infra-work-week @@ -644,8 +644,8 @@ mod tests { #[test] fn parse_smoke_test() { - let x86_64_unknown_linux_gnu = TargetTriple::new("x86_64-unknown-linux-gnu"); - let x86_64_unknown_linux_musl = TargetTriple::new("x86_64-unknown-linux-musl"); + let x86_64_unknown_linux_gnu = TargetTuple::new("x86_64-unknown-linux-gnu"); + let x86_64_unknown_linux_musl = TargetTuple::new("x86_64-unknown-linux-musl"); let pkg = Manifest::parse(EXAMPLE).unwrap(); diff --git a/src/dist/manifestation.rs b/src/dist/manifestation.rs index 4d71b583ca..daac28f432 100644 --- a/src/dist/manifestation.rs +++ b/src/dist/manifestation.rs @@ -24,7 +24,7 @@ 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::dist::{DEFAULT_DIST_SERVER, Profile, TargetTuple}; use crate::errors::RustupError; use crate::utils; @@ -34,7 +34,7 @@ pub(crate) const CONFIG_FILE: &str = "multirust-config.toml"; #[derive(Debug)] pub struct Manifestation { installation: Components, - target_triple: TargetTriple, + target_tuple: TargetTuple, } #[derive(Debug)] @@ -79,12 +79,12 @@ impl Manifestation { /// it will be created as needed. If there's an existing install /// then the rust-install installation format will be verified. A /// bad installer version is the only reason this will fail. - pub fn open(prefix: InstallPrefix, triple: TargetTriple) -> Result { - // TODO: validate the triple with the existing install as well + pub fn open(prefix: InstallPrefix, tuple: TargetTuple) -> Result { + // TODO: validate the tuple with the existing install as well // as the metadata format of the existing install Ok(Self { installation: Components::open(prefix)?, - target_triple: triple, + target_tuple: tuple, }) } @@ -138,7 +138,7 @@ impl Manifestation { { for component in &components { match &component.target { - Some(t) if t != &self.target_triple => warn!( + Some(t) if t != &self.target_tuple => warn!( "skipping unavailable component {} for target {}", new_manifest.short_name(component), t @@ -188,14 +188,14 @@ impl Manifestation { // Uninstall components for component in update.components_to_uninstall { match (implicit_modify, &component.target) { - (true, Some(t)) if t != &self.target_triple => { + (true, Some(t)) if t != &self.target_tuple => { info!( "removing previous version of component {} for target {}", new_manifest.short_name(&component), t ); } - (false, Some(t)) if t != &self.target_triple => { + (false, Some(t)) if t != &self.target_tuple => { info!( "removing component {} for target {}", new_manifest.short_name(&component), @@ -382,11 +382,11 @@ impl Manifestation { let url = new_manifest .iter() - .find(|u| u.contains(&format!("{}{}", self.target_triple, ".tar.gz"))); + .find(|u| u.contains(&format!("{}{}", self.target_tuple, ".tar.gz"))); if url.is_none() { return Err(anyhow!( "binary package was not provided for '{}'", - self.target_triple, + self.target_tuple, )); } // Only replace once. The cost is inexpensive. @@ -560,7 +560,7 @@ impl Update { ) -> Result { // The package to install. let rust_package = new_manifest.get_package("rust")?; - let rust_target_package = rust_package.get_target(Some(&manifestation.target_triple))?; + let rust_target_package = rust_package.get_target(Some(&manifestation.target_tuple))?; changes.check_invariants(config)?; @@ -574,7 +574,7 @@ impl Update { let looks_like_v1 = config.is_none() && !installed_components.is_empty(); if looks_like_v1 { let mut profile_components = new_manifest - .get_profile_components(Profile::Default, &manifestation.target_triple)?; + .get_profile_components(Profile::Default, &manifestation.target_tuple)?; starting_list.append(&mut profile_components); } @@ -654,7 +654,7 @@ impl Update { result.components_to_install.push(component.clone()); } else if changes.explicit_add_components.contains(component) { match &component.target { - Some(t) if t != &manifestation.target_triple => info!( + Some(t) if t != &manifestation.target_tuple => info!( "component {} for target {} is up to date", new_manifest.short_name(component), t, diff --git a/src/dist/manifestation/tests.rs b/src/dist/manifestation/tests.rs index e595295dd6..9248d2b5f9 100644 --- a/src/dist/manifestation/tests.rs +++ b/src/dist/manifestation/tests.rs @@ -15,7 +15,7 @@ use url::Url; use crate::{ dist::{ - DEFAULT_DIST_SERVER, Profile, TargetTriple, ToolchainDesc, + DEFAULT_DIST_SERVER, Profile, TargetTuple, ToolchainDesc, download::{DownloadCfg, DownloadTracker}, manifest::{Component, Manifest}, manifestation::{Changes, Manifestation, UpdateStatus}, @@ -317,7 +317,7 @@ async fn rename_component() { let adds = [Component::new( "bonus".to_string(), - Some(TargetTriple::new("x86_64-apple-darwin")), + Some(TargetTuple::new("x86_64-apple-darwin")), true, )]; @@ -357,7 +357,7 @@ async fn rename_component_new() { let adds = [Component::new( "bobo".to_string(), - Some(TargetTriple::new("x86_64-apple-darwin")), + Some(TargetTuple::new("x86_64-apple-darwin")), true, )]; // Install the basics from day 1 @@ -642,7 +642,7 @@ async fn unavailable_component() { let cx = TestContext::new(Some(edit), GZOnly); let adds = [Component::new( "bonus".to_string(), - Some(TargetTriple::new("x86_64-apple-darwin")), + Some(TargetTuple::new("x86_64-apple-darwin")), true, )]; @@ -741,7 +741,7 @@ async fn removed_component() { let cx = TestContext::new(Some(edit), GZOnly); let adds = [Component::new( "bonus".to_string(), - Some(TargetTriple::new("x86_64-apple-darwin")), + Some(TargetTuple::new("x86_64-apple-darwin")), true, )]; @@ -792,12 +792,12 @@ async fn unavailable_components_is_target() { let adds = [ Component::new( "rust-std".to_string(), - Some(TargetTriple::new("i686-apple-darwin")), + Some(TargetTuple::new("i686-apple-darwin")), false, ), Component::new( "rust-std".to_string(), - Some(TargetTriple::new("i686-unknown-linux-gnu")), + Some(TargetTuple::new("i686-unknown-linux-gnu")), false, ), ]; @@ -912,12 +912,12 @@ async fn update_preserves_extensions() { let adds = vec![ Component::new( "rust-std".to_string(), - Some(TargetTriple::new("i686-apple-darwin")), + Some(TargetTuple::new("i686-apple-darwin")), false, ), Component::new( "rust-std".to_string(), - Some(TargetTriple::new("i686-unknown-linux-gnu")), + Some(TargetTuple::new("i686-unknown-linux-gnu")), false, ), ]; @@ -962,12 +962,12 @@ async fn add_extensions_for_initial_install() { let adds = vec![ Component::new( "rust-std".to_string(), - Some(TargetTriple::new("i686-apple-darwin")), + Some(TargetTuple::new("i686-apple-darwin")), false, ), Component::new( "rust-std".to_string(), - Some(TargetTriple::new("i686-unknown-linux-gnu")), + Some(TargetTuple::new("i686-unknown-linux-gnu")), false, ), ]; @@ -991,12 +991,12 @@ async fn add_extensions_for_same_manifest() { let adds = vec![ Component::new( "rust-std".to_string(), - Some(TargetTriple::new("i686-apple-darwin")), + Some(TargetTuple::new("i686-apple-darwin")), false, ), Component::new( "rust-std".to_string(), - Some(TargetTriple::new("i686-unknown-linux-gnu")), + Some(TargetTuple::new("i686-unknown-linux-gnu")), false, ), ]; @@ -1025,12 +1025,12 @@ async fn add_extensions_for_upgrade() { let adds = vec![ Component::new( "rust-std".to_string(), - Some(TargetTriple::new("i686-apple-darwin")), + Some(TargetTuple::new("i686-apple-darwin")), false, ), Component::new( "rust-std".to_string(), - Some(TargetTriple::new("i686-unknown-linux-gnu")), + Some(TargetTuple::new("i686-unknown-linux-gnu")), false, ), ]; @@ -1053,7 +1053,7 @@ async fn add_extension_not_in_manifest() { let cx = TestContext::new(None, GZOnly); let adds = vec![Component::new( "rust-bogus".to_string(), - Some(TargetTriple::new("i686-apple-darwin")), + Some(TargetTuple::new("i686-apple-darwin")), true, )]; @@ -1066,7 +1066,7 @@ async fn add_extension_that_is_required_component() { let cx = TestContext::new(None, GZOnly); let adds = vec![Component::new( "rustc".to_string(), - Some(TargetTriple::new("x86_64-apple-darwin")), + Some(TargetTuple::new("x86_64-apple-darwin")), false, )]; @@ -1088,7 +1088,7 @@ async fn add_extensions_does_not_remove_other_components() { let adds = vec![Component::new( "rust-std".to_string(), - Some(TargetTriple::new("i686-apple-darwin")), + Some(TargetTuple::new("i686-apple-darwin")), false, )]; @@ -1104,7 +1104,7 @@ async fn remove_extensions_for_initial_install() { let cx = TestContext::new(None, GZOnly); let removes = vec![Component::new( "rustc".to_string(), - Some(TargetTriple::new("x86_64-apple-darwin")), + Some(TargetTuple::new("x86_64-apple-darwin")), false, )]; @@ -1117,12 +1117,12 @@ async fn remove_extensions_for_same_manifest() { let adds = vec![ Component::new( "rust-std".to_string(), - Some(TargetTriple::new("i686-apple-darwin")), + Some(TargetTuple::new("i686-apple-darwin")), false, ), Component::new( "rust-std".to_string(), - Some(TargetTriple::new("i686-unknown-linux-gnu")), + Some(TargetTuple::new("i686-unknown-linux-gnu")), false, ), ]; @@ -1131,7 +1131,7 @@ async fn remove_extensions_for_same_manifest() { let removes = vec![Component::new( "rust-std".to_string(), - Some(TargetTriple::new("i686-apple-darwin")), + Some(TargetTuple::new("i686-apple-darwin")), false, )]; @@ -1155,12 +1155,12 @@ async fn remove_extensions_for_upgrade() { let adds = vec![ Component::new( "rust-std".to_string(), - Some(TargetTriple::new("i686-apple-darwin")), + Some(TargetTuple::new("i686-apple-darwin")), false, ), Component::new( "rust-std".to_string(), - Some(TargetTriple::new("i686-unknown-linux-gnu")), + Some(TargetTuple::new("i686-unknown-linux-gnu")), false, ), ]; @@ -1171,7 +1171,7 @@ async fn remove_extensions_for_upgrade() { let removes = vec![Component::new( "rust-std".to_string(), - Some(TargetTriple::new("i686-apple-darwin")), + Some(TargetTuple::new("i686-apple-darwin")), false, )]; @@ -1200,7 +1200,7 @@ async fn remove_extension_not_in_manifest() { let removes = vec![Component::new( "rust-bogus".to_string(), - Some(TargetTriple::new("i686-apple-darwin")), + Some(TargetTuple::new("i686-apple-darwin")), true, )]; @@ -1234,7 +1234,7 @@ async fn remove_extension_not_in_manifest_but_is_already_installed() { let adds = [Component::new( "bonus".to_string(), - Some(TargetTriple::new("x86_64-apple-darwin")), + Some(TargetTuple::new("x86_64-apple-darwin")), true, )]; cx.update_from_dist(&adds, &[], false).await.unwrap(); @@ -1244,7 +1244,7 @@ async fn remove_extension_not_in_manifest_but_is_already_installed() { let removes = vec![Component::new( "bonus".to_string(), - Some(TargetTriple::new("x86_64-apple-darwin")), + Some(TargetTuple::new("x86_64-apple-darwin")), true, )]; cx.update_from_dist(&[], &removes, false).await.unwrap(); @@ -1258,7 +1258,7 @@ async fn remove_extension_that_is_required_component() { let removes = vec![Component::new( "rustc".to_string(), - Some(TargetTriple::new("x86_64-apple-darwin")), + Some(TargetTuple::new("x86_64-apple-darwin")), false, )]; @@ -1273,7 +1273,7 @@ async fn remove_extension_not_installed() { let removes = vec![Component::new( "rust-std".to_string(), - Some(TargetTriple::new("i686-apple-darwin")), + Some(TargetTuple::new("i686-apple-darwin")), false, )]; @@ -1289,7 +1289,7 @@ async fn remove_extensions_does_not_remove_other_components() { let cx = TestContext::new(None, GZOnly); let adds = vec![Component::new( "rust-std".to_string(), - Some(TargetTriple::new("i686-apple-darwin")), + Some(TargetTuple::new("i686-apple-darwin")), false, )]; @@ -1297,7 +1297,7 @@ async fn remove_extensions_does_not_remove_other_components() { let removes = vec![Component::new( "rust-std".to_string(), - Some(TargetTriple::new("i686-apple-darwin")), + Some(TargetTuple::new("i686-apple-darwin")), false, )]; @@ -1316,7 +1316,7 @@ async fn remove_extensions_does_not_hang_with_concurrent_downloads_override() { let adds = vec![Component::new( "rust-std".to_string(), - Some(TargetTriple::new("i686-apple-darwin")), + Some(TargetTuple::new("i686-apple-darwin")), false, )]; @@ -1324,7 +1324,7 @@ async fn remove_extensions_does_not_hang_with_concurrent_downloads_override() { let removes = vec![Component::new( "rust-std".to_string(), - Some(TargetTriple::new("i686-apple-darwin")), + Some(TargetTuple::new("i686-apple-darwin")), false, )]; @@ -1340,7 +1340,7 @@ async fn add_and_remove_for_upgrade() { let adds = vec![Component::new( "rust-std".to_string(), - Some(TargetTriple::new("i686-unknown-linux-gnu")), + Some(TargetTuple::new("i686-unknown-linux-gnu")), false, )]; @@ -1350,13 +1350,13 @@ async fn add_and_remove_for_upgrade() { let adds = vec![Component::new( "rust-std".to_string(), - Some(TargetTriple::new("i686-apple-darwin")), + Some(TargetTuple::new("i686-apple-darwin")), false, )]; let removes = vec![Component::new( "rust-std".to_string(), - Some(TargetTriple::new("i686-unknown-linux-gnu")), + Some(TargetTuple::new("i686-unknown-linux-gnu")), false, )]; @@ -1378,7 +1378,7 @@ async fn add_and_remove() { let adds = vec![Component::new( "rust-std".to_string(), - Some(TargetTriple::new("i686-unknown-linux-gnu")), + Some(TargetTuple::new("i686-unknown-linux-gnu")), false, )]; @@ -1386,13 +1386,13 @@ async fn add_and_remove() { let adds = vec![Component::new( "rust-std".to_string(), - Some(TargetTriple::new("i686-apple-darwin")), + Some(TargetTuple::new("i686-apple-darwin")), false, )]; let removes = vec![Component::new( "rust-std".to_string(), - Some(TargetTriple::new("i686-unknown-linux-gnu")), + Some(TargetTuple::new("i686-unknown-linux-gnu")), false, )]; @@ -1415,13 +1415,13 @@ async fn add_and_remove_same_component() { let adds = vec![Component::new( "rust-std".to_string(), - Some(TargetTriple::new("i686-apple-darwin")), + Some(TargetTuple::new("i686-apple-darwin")), false, )]; let removes = vec![Component::new( "rust-std".to_string(), - Some(TargetTriple::new("i686-apple-darwin")), + Some(TargetTuple::new("i686-apple-darwin")), false, )]; diff --git a/src/dist/mod.rs b/src/dist/mod.rs index bfb6603bcd..f0303116ba 100644 --- a/src/dist/mod.rs +++ b/src/dist/mod.rs @@ -44,8 +44,8 @@ use prefix::InstallPrefix; pub mod temp; -pub(crate) mod triple; -pub(crate) use triple::*; +pub(crate) mod target_tuple; +pub(crate) use target_tuple::*; pub static DEFAULT_DIST_SERVER: &str = "https://static.rust-lang.org"; @@ -147,17 +147,17 @@ struct ParsedToolchainDesc { /// A toolchain descriptor from rustup's perspective. These contain /// 'partial target tuples', which allow toolchain names like /// 'stable-msvc' to work. Partial target tuples though are parsed -/// from a hardcoded set of known triples, whereas target tuples +/// from a hardcoded set of known tuples, whereas target tuples /// are nearly-arbitrary strings. #[derive(Debug, Clone, Eq, PartialEq, PartialOrd, Ord)] pub struct PartialToolchainDesc { pub channel: Channel, pub date: Option, - pub target: PartialTargetTriple, + pub target: PartialTargetTuple, } /// Fully-resolved toolchain descriptors. These always have full target -/// triples attached to them and are used for canonical identification, +/// tuples attached to them and are used for canonical identification, /// such as naming their installation directory. /// /// As strings they look like stable-x86_64-pc-windows-msvc or @@ -166,7 +166,7 @@ pub struct PartialToolchainDesc { pub struct ToolchainDesc { pub channel: Channel, pub date: Option, - pub target: TargetTriple, + pub target: TargetTuple, } #[derive(Debug, Clone, Eq, PartialEq, PartialOrd, Ord)] @@ -254,40 +254,40 @@ impl FromStr for PartialVersion { #[derive(Debug, Clone, Deserialize, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize)] #[serde(transparent)] -pub struct TargetTriple(String); +pub struct TargetTuple(String); // Linux hosts don't indicate clib in uname, however binaries only // run on boxes with the same clib, as expected. #[cfg(all(not(windows), not(target_env = "musl")))] -const TRIPLE_X86_64_UNKNOWN_LINUX: &str = "x86_64-unknown-linux-gnu"; +const TUPLE_X86_64_UNKNOWN_LINUX: &str = "x86_64-unknown-linux-gnu"; #[cfg(all(not(windows), target_env = "musl"))] -const TRIPLE_X86_64_UNKNOWN_LINUX: &str = "x86_64-unknown-linux-musl"; +const TUPLE_X86_64_UNKNOWN_LINUX: &str = "x86_64-unknown-linux-musl"; #[cfg(all(not(windows), not(target_env = "musl")))] -const TRIPLE_AARCH64_UNKNOWN_LINUX: &str = "aarch64-unknown-linux-gnu"; +const TUPLE_AARCH64_UNKNOWN_LINUX: &str = "aarch64-unknown-linux-gnu"; #[cfg(all(not(windows), target_env = "musl"))] -const TRIPLE_AARCH64_UNKNOWN_LINUX: &str = "aarch64-unknown-linux-musl"; +const TUPLE_AARCH64_UNKNOWN_LINUX: &str = "aarch64-unknown-linux-musl"; #[cfg(all(not(windows), not(target_env = "musl")))] -const TRIPLE_LOONGARCH64_UNKNOWN_LINUX: &str = "loongarch64-unknown-linux-gnu"; +const TUPLE_LOONGARCH64_UNKNOWN_LINUX: &str = "loongarch64-unknown-linux-gnu"; #[cfg(all(not(windows), target_env = "musl"))] -const TRIPLE_LOONGARCH64_UNKNOWN_LINUX: &str = "loongarch64-unknown-linux-musl"; +const TUPLE_LOONGARCH64_UNKNOWN_LINUX: &str = "loongarch64-unknown-linux-musl"; #[cfg(all(not(windows), not(target_env = "musl")))] -const TRIPLE_POWERPC64LE_UNKNOWN_LINUX: &str = "powerpc64le-unknown-linux-gnu"; +const TUPLE_POWERPC64LE_UNKNOWN_LINUX: &str = "powerpc64le-unknown-linux-gnu"; #[cfg(all(not(windows), target_env = "musl"))] -const TRIPLE_POWERPC64LE_UNKNOWN_LINUX: &str = "powerpc64le-unknown-linux-musl"; +const TUPLE_POWERPC64LE_UNKNOWN_LINUX: &str = "powerpc64le-unknown-linux-musl"; // MIPS platforms don't indicate endianness in uname, however binaries only // run on boxes with the same endianness, as expected. // Hence we could distinguish between the variants with compile-time cfg() // attributes alone. #[cfg(all(not(windows), target_endian = "big"))] -static TRIPLE_MIPS_UNKNOWN_LINUX_GNU: &str = "mips-unknown-linux-gnu"; +static TUPLE_MIPS_UNKNOWN_LINUX_GNU: &str = "mips-unknown-linux-gnu"; #[cfg(all(not(windows), target_endian = "little"))] -static TRIPLE_MIPS_UNKNOWN_LINUX_GNU: &str = "mipsel-unknown-linux-gnu"; +static TUPLE_MIPS_UNKNOWN_LINUX_GNU: &str = "mipsel-unknown-linux-gnu"; #[cfg(all(not(windows), target_endian = "big"))] -static TRIPLE_MIPS64_UNKNOWN_LINUX_GNUABI64: &str = "mips64-unknown-linux-gnuabi64"; +static TUPLE_MIPS64_UNKNOWN_LINUX_GNUABI64: &str = "mips64-unknown-linux-gnuabi64"; #[cfg(all(not(windows), target_endian = "little"))] -static TRIPLE_MIPS64_UNKNOWN_LINUX_GNUABI64: &str = "mips64el-unknown-linux-gnuabi64"; +static TUPLE_MIPS64_UNKNOWN_LINUX_GNUABI64: &str = "mips64el-unknown-linux-gnuabi64"; impl FromStr for ParsedToolchainDesc { type Err = anyhow::Error; @@ -344,7 +344,7 @@ impl FromStr for ParsedToolchainDesc { } } -impl Deref for TargetTriple { +impl Deref for TargetTuple { type Target = str; fn deref(&self) -> &Self::Target { &self.0 @@ -374,14 +374,14 @@ fn is_32bit_userspace() -> bool { inner().unwrap_or(cfg!(target_pointer_width = "32")) } -impl TargetTriple { +impl TargetTuple { pub fn new(name: impl Into) -> Self { Self(name.into()) } pub(crate) fn from_build() -> Self { - if let Some(triple) = option_env!("RUSTUP_OVERRIDE_BUILD_TRIPLE") { - Self::new(triple) + if let Some(tuple) = option_env!("RUSTUP_OVERRIDE_BUILD_TUPLE") { + Self::new(tuple) } else { Self::new(env!("TARGET")) } @@ -411,7 +411,7 @@ impl TargetTriple { pub(crate) fn from_host(process: &Process) -> Option { #[cfg(windows)] - fn inner() -> Option { + fn inner() -> Option { use std::mem; /// Get the host architecture using `IsWow64Process2`. This function @@ -482,12 +482,12 @@ impl TargetTriple { // Default to msvc let arch = arch_primary().or_else(arch_fallback)?; - let msvc_triple = format!("{arch}-pc-windows-msvc"); - Some(TargetTriple(msvc_triple)) + let msvc_tuple = format!("{arch}-pc-windows-msvc"); + Some(TargetTuple(msvc_tuple)) } #[cfg(not(windows))] - fn inner() -> Option { + fn inner() -> Option { use std::ffi::CStr; use std::mem; @@ -505,21 +505,21 @@ impl TargetTriple { }; #[cfg(not(target_os = "android"))] - let host_triple = match (sysname, machine) { - (b"Linux", b"x86_64") => Some(TRIPLE_X86_64_UNKNOWN_LINUX), + let host_tuple = match (sysname, machine) { + (b"Linux", b"x86_64") => Some(TUPLE_X86_64_UNKNOWN_LINUX), (b"Linux", b"i686") => Some("i686-unknown-linux-gnu"), - (b"Linux", b"mips") => Some(TRIPLE_MIPS_UNKNOWN_LINUX_GNU), - (b"Linux", b"mips64") => Some(TRIPLE_MIPS64_UNKNOWN_LINUX_GNUABI64), + (b"Linux", b"mips") => Some(TUPLE_MIPS_UNKNOWN_LINUX_GNU), + (b"Linux", b"mips64") => Some(TUPLE_MIPS64_UNKNOWN_LINUX_GNUABI64), (b"Linux", b"arm") => Some("arm-unknown-linux-gnueabi"), (b"Linux", b"armv7l") => Some("armv7-unknown-linux-gnueabihf"), (b"Linux", b"armv8l") => Some("armv7-unknown-linux-gnueabihf"), (b"Linux", b"aarch64") => Some(if is_32bit_userspace() { "armv7-unknown-linux-gnueabihf" } else { - TRIPLE_AARCH64_UNKNOWN_LINUX + TUPLE_AARCH64_UNKNOWN_LINUX }), - (b"Linux", b"loongarch64") => Some(TRIPLE_LOONGARCH64_UNKNOWN_LINUX), - (b"Linux", b"ppc64le") => Some(TRIPLE_POWERPC64LE_UNKNOWN_LINUX), + (b"Linux", b"loongarch64") => Some(TUPLE_LOONGARCH64_UNKNOWN_LINUX), + (b"Linux", b"ppc64le") => Some(TUPLE_POWERPC64LE_UNKNOWN_LINUX), (b"Darwin", b"x86_64") => Some("x86_64-apple-darwin"), (b"Darwin", b"i686") => Some("i686-apple-darwin"), (b"FreeBSD", b"x86_64") => Some("x86_64-unknown-freebsd"), @@ -538,7 +538,7 @@ impl TargetTriple { }; #[cfg(target_os = "android")] - let host_triple = match (sysname, machine) { + let host_tuple = match (sysname, machine) { (_, b"arm") => Some("arm-linux-androideabi"), (_, b"armv7l") => Some("armv7-linux-androideabi"), (_, b"armv8l") => Some("armv7-linux-androideabi"), @@ -548,11 +548,11 @@ impl TargetTriple { _ => None, }; - host_triple.map(TargetTriple::new) + host_tuple.map(TargetTuple::new) } - if let Ok(triple) = process.var("RUSTUP_OVERRIDE_HOST_TRIPLE") { - Some(Self(triple)) + if let Ok(tuple) = process.var("RUSTUP_OVERRIDE_HOST_TUPLE") { + Some(Self(tuple)) } else { inner() } @@ -562,15 +562,15 @@ impl TargetTriple { Self::from_host(process).unwrap_or_else(Self::from_build) } - pub(crate) fn can_run(&self, other: &TargetTriple) -> Result { + pub(crate) fn can_run(&self, other: &TargetTuple) -> Result { // Most trivial shortcut of all if self == other { return Ok(true); } // Otherwise we need to parse things - let partial_self = PartialTargetTriple::new(&self.0) + let partial_self = PartialTargetTuple::new(&self.0) .ok_or_else(|| anyhow!(format!("Unable to parse target tuple: {}", self.0)))?; - let partial_other = PartialTargetTriple::new(&other.0) + let partial_other = PartialTargetTuple::new(&other.0) .ok_or_else(|| anyhow!(format!("Unable to parse target tuple: {}", other.0)))?; // First obvious check is OS, if that doesn't match there's no chance let ret = if partial_self.os != partial_other.os { @@ -595,7 +595,7 @@ impl FromStr for PartialToolchainDesc { type Err = anyhow::Error; fn from_str(name: &str) -> Result { let parsed: ParsedToolchainDesc = name.parse()?; - let target = PartialTargetTriple::new(parsed.target.as_deref().unwrap_or("")); + let target = PartialTargetTuple::new(parsed.target.as_deref().unwrap_or("")); target .map(|target| Self { @@ -609,10 +609,10 @@ impl FromStr for PartialToolchainDesc { impl PartialToolchainDesc { /// Create a toolchain desc using input_host to fill in missing fields - pub(crate) fn resolve(self, input_host: &TargetTriple) -> Result { - let host = PartialTargetTriple::new(&input_host.0).ok_or_else(|| { + pub(crate) fn resolve(self, input_host: &TargetTuple) -> Result { + let host = PartialTargetTuple::new(&input_host.0).ok_or_else(|| { anyhow!(format!( - "Provided host '{}' couldn't be converted to partial triple", + "Provided host '{}' couldn't be converted to partial tuple", input_host.0 )) })?; @@ -649,11 +649,11 @@ impl PartialToolchainDesc { Ok(ToolchainDesc { channel: self.channel, date: self.date, - target: TargetTriple(trip), + target: TargetTuple(trip), }) } - pub(crate) fn has_triple(&self) -> bool { + pub(crate) fn has_tuple(&self) -> bool { self.target.arch.is_some() || self.target.os.is_some() || self.target.env.is_some() } } @@ -670,7 +670,7 @@ impl FromStr for ToolchainDesc { Ok(Self { channel: parsed.channel, date: parsed.date, - target: TargetTriple(parsed.target.unwrap()), + target: TargetTuple(parsed.target.unwrap()), }) } } @@ -830,7 +830,7 @@ impl fmt::Display for AutoInstallMode { } } -impl fmt::Display for TargetTriple { +impl fmt::Display for TargetTuple { fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result { self.0.fmt(f) } @@ -1180,8 +1180,8 @@ async fn try_update_from_dist_( } for &target in targets { - let triple = TargetTriple::new(target); - all_components.insert(Component::new("rust-std".to_string(), Some(triple), false)); + let tuple = TargetTuple::new(target); + all_components.insert(Component::new("rust-std".to_string(), Some(tuple), false)); } let mut explicit_add_components: Vec<_> = all_components.into_iter().collect(); @@ -1449,7 +1449,7 @@ mod tests { } #[test] - fn compatible_host_triples() { + fn compatible_host_tuples() { static CASES: &[(&str, &[&str], &[&str])] = &[ ( // 64bit linux @@ -1494,11 +1494,11 @@ mod tests { for &(host, compatible, incompatible) in CASES { println!("host={host}"); - let host = TargetTriple::new(host); + let host = TargetTuple::new(host); assert!(host.can_run(&host).unwrap(), "host wasn't self-compatible"); for &other in compatible.iter() { println!("compatible with {other}"); - let other = TargetTriple::new(other); + let other = TargetTuple::new(other); assert!( host.can_run(&other).unwrap(), "host and other were unexpectedly incompatible" @@ -1506,7 +1506,7 @@ mod tests { } for &other in incompatible.iter() { println!("incompatible with {other}"); - let other = TargetTriple::new(other); + let other = TargetTuple::new(other); assert!( !host.can_run(&other).unwrap(), "host and other were unexpectedly compatible" diff --git a/src/dist/triple.rs b/src/dist/target_tuple.rs similarity index 83% rename from src/dist/triple.rs rename to src/dist/target_tuple.rs index 34aff1475c..0c8ce4cb62 100644 --- a/src/dist/triple.rs +++ b/src/dist/target_tuple.rs @@ -5,13 +5,13 @@ use regex::Regex; pub mod known; #[derive(Debug, Clone, PartialEq, Eq, PartialOrd, Ord)] -pub struct PartialTargetTriple { +pub struct PartialTargetTuple { pub arch: Option, pub os: Option, pub env: Option, } -impl PartialTargetTriple { +impl PartialTargetTuple { pub(crate) fn new(name: &str) -> Option { if name.is_empty() { return Some(Self { @@ -22,7 +22,7 @@ impl PartialTargetTriple { } // Prepending `-` makes this next regex easier since - // we can count on all triple components being + // we can count on all tuple components being // delineated by it. let name = format!("-{name}"); static RE: LazyLock = LazyLock::new(|| { @@ -58,7 +58,7 @@ mod test { use super::*; #[test] - fn test_partial_target_triple_new() { + fn test_partial_target_tuple_new() { let success_cases = vec![ ("", (None, None, None)), ("i386", (Some("i386"), None, None)), @@ -74,19 +74,19 @@ mod test { ]; for (input, (arch, os, env)) in success_cases { - let partial_target_triple = PartialTargetTriple::new(input); + let partial_target_tuple = PartialTargetTuple::new(input); assert!( - partial_target_triple.is_some(), + partial_target_tuple.is_some(), "expected `{input}` to create some partial target tuple; got None" ); - let expected = PartialTargetTriple { + let expected = PartialTargetTuple { arch: arch.map(String::from), os: os.map(String::from), env: env.map(String::from), }; - assert_eq!(partial_target_triple.unwrap(), expected, "input: `{input}`"); + assert_eq!(partial_target_tuple.unwrap(), expected, "input: `{input}`"); } let failure_cases = vec![ @@ -104,10 +104,10 @@ mod test { ]; for input in failure_cases { - let partial_target_triple = PartialTargetTriple::new(input); + let partial_target_tuple = PartialTargetTuple::new(input); assert!( - partial_target_triple.is_none(), - "expected `{input}` to be `None`, was: `{partial_target_triple:?}`" + partial_target_tuple.is_none(), + "expected `{input}` to be `None`, was: `{partial_target_tuple:?}`" ); } } diff --git a/src/dist/triple/known.rs b/src/dist/target_tuple/known.rs similarity index 100% rename from src/dist/triple/known.rs rename to src/dist/target_tuple/known.rs diff --git a/src/errors.rs b/src/errors.rs index 8fb12b6913..ce3491d9b7 100644 --- a/src/errors.rs +++ b/src/errors.rs @@ -12,7 +12,7 @@ use url::Url; use crate::{ dist::{ - Channel, TargetTriple, ToolchainDesc, + Channel, TargetTuple, ToolchainDesc, manifest::{Component, Manifest}, }, toolchain::{PathBasedToolchainName, ToolchainName}, @@ -93,12 +93,12 @@ pub enum RustupError { RunningCommand { name: OsString }, #[error( "toolchain '{toolchain}' may not be able to run on this system\n\ - note: to build software for that platform, try `rustup target add {target_triple}` instead\n\ + note: to build software for that platform, try `rustup target add {target_tuple}` instead\n\ note: add the `--force-non-host` flag to install the toolchain anyway" )] ToolchainIncompatible { toolchain: String, - target_triple: TargetTriple, + target_tuple: TargetTuple, }, #[error("toolchain '{0}' is not installable")] ToolchainNotInstallable(String), @@ -147,14 +147,14 @@ pub enum RustupError { suggest_message(.suggestion))] UnknownTarget { desc: ToolchainDesc, - target: TargetTriple, + target: TargetTuple, suggestion: Option, }, #[error("toolchain '{}' does not have target '{}' installed{}\n", .desc, .target, suggest_message(.suggestion))] TargetNotInstalled { desc: ToolchainDesc, - target: TargetTriple, + target: TargetTuple, suggestion: Option, }, #[error( diff --git a/src/settings.rs b/src/settings.rs index 15d7669fa0..a845d459a3 100644 --- a/src/settings.rs +++ b/src/settings.rs @@ -82,7 +82,8 @@ impl SettingsFile { pub struct Settings { pub version: MetadataVersion, #[serde(skip_serializing_if = "Option::is_none")] - pub default_host_triple: Option, + #[serde(alias = "default_host_triple")] + pub default_host_tuple: Option, #[serde(skip_serializing_if = "Option::is_none")] pub default_toolchain: Option, #[serde(skip_serializing_if = "Option::is_none")] @@ -218,10 +219,50 @@ mod tests { assert_eq!(settings.profile, Some(Profile::Default)); } + #[test] + fn serialize_host_tuple() { + let settings = Settings { + default_host_tuple: Some("riscv64a23-unknown-linux-gnu".into()), + ..Default::default() + }; + let toml = settings.stringify().unwrap(); + assert_eq!(toml, WITH_NEW_DEFAULT_HOST_NAME); + } + + #[test] + fn deserialize_host_tuple_old_name() { + let settings = Settings::parse(WITH_OLD_DEFAULT_HOST_NAME).unwrap(); + assert_eq!( + settings.default_host_tuple, + Some("riscv64a23-unknown-linux-gnu".into()), + ); + } + + #[test] + fn deserialize_host_tuple() { + let settings = Settings::parse(WITH_NEW_DEFAULT_HOST_NAME).unwrap(); + assert_eq!( + settings.default_host_tuple, + Some("riscv64a23-unknown-linux-gnu".into()), + ); + } + const BASIC: &str = r#"version = "12" default_toolchain = "stable-aarch64-apple-darwin" profile = "default" +[overrides] +"#; + + const WITH_OLD_DEFAULT_HOST_NAME: &str = r#"version = "12" +default_host_triple = "riscv64a23-unknown-linux-gnu" + +[overrides] +"#; + + const WITH_NEW_DEFAULT_HOST_NAME: &str = r#"version = "12" +default_host_tuple = "riscv64a23-unknown-linux-gnu" + [overrides] "#; } diff --git a/src/test.rs b/src/test.rs index 99e57e275b..6e93a94b1a 100644 --- a/src/test.rs +++ b/src/test.rs @@ -20,7 +20,7 @@ use std::process::Command; use anyhow::Result; use sha2::{Digest, Sha256}; -use crate::dist::TargetTriple; +use crate::dist::TargetTuple; use crate::process::TestProcess; #[cfg(windows)] @@ -123,26 +123,26 @@ fn tempdir_in_with_prefix>(path: P, prefix: &str) -> io::Result

String { +/// this_host_tuple that doesn't make its own process or use +/// TargetTuple::from_host() from within the process context as needed. +pub fn this_host_tuple() -> String { if cfg!(target_os = "windows") { // For windows, this host may be different to the target: we may be // building with i686 toolchain, but on an x86_64 host, so run the // actual detection logic and trust it. let tp = TestProcess::default(); - return TargetTriple::from_host(&tp.process).unwrap().to_string(); + return TargetTuple::from_host(&tp.process).unwrap().to_string(); } let arch = if cfg!(target_arch = "x86") { "i686" @@ -193,11 +193,11 @@ pub fn this_host_triple() -> String { } } -// Format a string with this host triple. +// Format a string with this host tuple. #[macro_export] macro_rules! for_host { ($s:tt $($arg:tt)*) => { - &format!($s, $crate::test::this_host_triple() $($arg)*) + &format!($s, $crate::test::this_host_tuple() $($arg)*) }; } diff --git a/src/test/clitools.rs b/src/test/clitools.rs index 17bcf923b8..c7a427f1b6 100644 --- a/src/test/clitools.rs +++ b/src/test/clitools.rs @@ -28,7 +28,7 @@ use crate::process; use crate::test as rustup_test; use crate::test::const_dist_dir; use crate::test::tempdir_in_with_prefix; -use crate::test::this_host_triple; +use crate::test::this_host_tuple; use crate::utils; use super::{ @@ -103,7 +103,7 @@ pub struct Config { /// [`assert_data_eq`]'s documentation for more info) with a list of /// rustup-specific values, including: /// - `[CURRENT_VERSION]`: The current rustup version. -/// - `[HOST_TRIPLE]`: The return value of [`this_host_triple()`]. +/// - `[HOST_TUPLE]`: The return value of [`this_host_tuple()`]. /// - `[CROSS_ARCH_I]`: The value of [`CROSS_ARCH1`]. /// - `[CROSS_ARCH_II]`: The value of [`CROSS_ARCH2`]. /// - `[MULTI_ARCH_I]`: The value of [`MULTI_ARCH1`]. @@ -129,7 +129,7 @@ impl Assert { "[CURRENT_VERSION]", Cow::Borrowed(env!("CARGO_PKG_VERSION")), ), - ("[HOST_TRIPLE]", Cow::Owned(this_host_triple())), + ("[HOST_TUPLE]", Cow::Owned(this_host_tuple())), ("[CROSS_ARCH_I]", Cow::Borrowed(CROSS_ARCH1)), ("[CROSS_ARCH_II]", Cow::Borrowed(CROSS_ARCH2)), ("[MULTI_ARCH_I]", Cow::Borrowed(MULTI_ARCH1)), @@ -275,7 +275,9 @@ impl Config { format!("file://{}", distdir.to_string_lossy()), ); cmd.env("CARGO_HOME", self.cargodir.to_string_lossy().to_string()); - cmd.env("RUSTUP_OVERRIDE_HOST_TRIPLE", this_host_triple()); + cmd.env("RUSTUP_OVERRIDE_HOST_TUPLE", this_host_tuple()); + // Kept for compatibility + cmd.env("RUSTUP_OVERRIDE_HOST_TRIPLE", this_host_tuple()); // These are used in some installation tests that unset RUSTUP_HOME/CARGO_HOME cmd.env("HOME", self.homedir.to_string_lossy().to_string()); @@ -862,11 +864,11 @@ async fn setup_test_state(test_dist_dir: TempDir) -> (TempDir, Config) { hard_link(&rustup_path, rls_path).unwrap(); hard_link(&rustup_path, rust_lldb_path).unwrap(); - // Make sure the host triple matches the build triple. Otherwise testing a 32-bit build of + // Make sure the host tuple matches the build tuple. Otherwise testing a 32-bit build of // rustup on a 64-bit machine will fail, because the tests do not have the host detection // functionality built in. config - .run("rustup", ["set", "default-host", &this_host_triple()], &[]) + .run("rustup", ["set", "default-host", &this_host_tuple()], &[]) .await; // Set the auto update mode to disable, as most tests do not want to update rustup itself during the test. @@ -900,7 +902,7 @@ impl SelfUpdateTestContext { let root_url = create_local_update_server(self_dist, &cx.config.exedir, version); cx.config.rustup_update_root = Some(root_url); - let trip = this_host_triple(); + let trip = this_host_tuple(); let dist_dir = self_dist.join(format!("archive/{version}/{trip}")); let dist_exe = dist_dir.join(format!("rustup-init{EXE_SUFFIX}")); let dist_tmp = dist_dir.join("rustup-init-tmp"); @@ -969,7 +971,7 @@ impl CliTestContext { let self_dist = self_dist_tmp.path(); let root_url = create_local_update_server(self_dist, &self.config.exedir, version); - let trip = this_host_triple(); + let trip = this_host_tuple(); let dist_dir = self_dist.join(format!("archive/{version}/{trip}")); let dist_exe = dist_dir.join(format!("rustup-init{EXE_SUFFIX}")); let dist_tmp = dist_dir.join("rustup-init-tmp"); @@ -1056,7 +1058,7 @@ impl Drop for DistDirGuard<'_> { } fn create_local_update_server(self_dist: &Path, exedir: &Path, version: &str) -> String { - let trip = this_host_triple(); + let trip = this_host_tuple(); let dist_dir = self_dist.join(format!("archive/{version}/{trip}")); let dist_exe = dist_dir.join(format!("rustup-init{EXE_SUFFIX}")); let rustup_bin = exedir.join(format!("rustup-init{EXE_SUFFIX}")); diff --git a/src/test/dist.rs b/src/test/dist.rs index 65a94a6862..82773ea57b 100644 --- a/src/test/dist.rs +++ b/src/test/dist.rs @@ -11,9 +11,9 @@ use url::Url; use super::clitools::hard_link; use super::mock::MockInstallerBuilder; -use super::{CROSS_ARCH1, CROSS_ARCH2, MULTI_ARCH1, create_hash, this_host_triple}; +use super::{CROSS_ARCH1, CROSS_ARCH2, MULTI_ARCH1, create_hash, this_host_tuple}; use crate::dist::{ - DEFAULT_DIST_SERVER, Profile, TargetTriple, + DEFAULT_DIST_SERVER, Profile, TargetTuple, component::{Components, DirectoryPackage, Transaction}, manifest::{ Component, CompressionKind, HashedBinary, Manifest, ManifestVersion, Package, @@ -189,24 +189,24 @@ impl Release { if self.channel == "stable" { // Same for v1 manifests. These are just the installers. - let host_triple = this_host_triple(); + let host_tuple = this_host_tuple(); hard_link( path.join(format!( "dist/{}/rust-stable-{}.tar.gz", - self.date, host_triple + self.date, host_tuple )), - path.join(format!("dist/rust-{}-{}.tar.gz", self.version, host_triple)), + path.join(format!("dist/rust-{}-{}.tar.gz", self.version, host_tuple)), ) .unwrap(); hard_link( path.join(format!( "dist/{}/rust-stable-{}.tar.gz.sha256", - self.date, host_triple + self.date, host_tuple )), path.join(format!( "dist/rust-{}-{}.tar.gz.sha256", - self.version, host_triple + self.version, host_tuple )), ) .unwrap(); @@ -289,49 +289,49 @@ impl MockChannel { version_hash: &str, rls: RlsStatus, multi_arch: bool, - swap_triples: bool, + swap_tuples: bool, ) -> Self { // Build the mock installers - let host_triple = if swap_triples { + let host_tuple = if swap_tuples { MULTI_ARCH1.to_owned() } else { - this_host_triple() + this_host_tuple() }; - let std = MockInstallerBuilder::std(&host_triple); - let rustc = MockInstallerBuilder::rustc(&host_triple, version, version_hash); + let std = MockInstallerBuilder::std(&host_tuple); + let rustc = MockInstallerBuilder::rustc(&host_tuple, version, version_hash); let cargo = MockInstallerBuilder::cargo(version, version_hash); let rust_docs = MockInstallerBuilder::rust_doc(); let rust = MockInstallerBuilder::combined(&[&std, &rustc, &cargo, &rust_docs]); let cross_std1 = MockInstallerBuilder::cross_std(CROSS_ARCH1, date); let cross_std2 = MockInstallerBuilder::cross_std(CROSS_ARCH2, date); let rust_src = MockInstallerBuilder::rust_src(); - let rust_analysis = MockInstallerBuilder::rust_analysis(&host_triple); + let rust_analysis = MockInstallerBuilder::rust_analysis(&host_tuple); // Convert the mock installers to mock package definitions for the // mock dist server let mut all = MockChannelContent::default(); all.std.extend(vec![ - (std, host_triple.clone()), + (std, host_tuple.clone()), (cross_std1, CROSS_ARCH1.to_string()), (cross_std2, CROSS_ARCH2.to_string()), ]); - all.rustc.push((rustc, host_triple.clone())); - all.cargo.push((cargo, host_triple.clone())); + all.rustc.push((rustc, host_tuple.clone())); + all.cargo.push((cargo, host_tuple.clone())); if rls != RlsStatus::Unavailable { let rls = MockInstallerBuilder::rls(version, version_hash, rls.pkg_name()); - all.rls.push((rls, host_triple.clone())); + all.rls.push((rls, host_tuple.clone())); } else { all.rls.push(( MockInstallerBuilder { components: vec![] }, - host_triple.clone(), + host_tuple.clone(), )); } - all.docs.push((rust_docs, host_triple.clone())); + all.docs.push((rust_docs, host_tuple.clone())); all.src.push((rust_src, "*".to_string())); all.analysis.push((rust_analysis, "*".to_string())); - all.combined.push((rust, host_triple)); + all.combined.push((rust, host_tuple)); if multi_arch { let std = MockInstallerBuilder::std(MULTI_ARCH1); @@ -340,21 +340,21 @@ impl MockChannel { let rust_docs = MockInstallerBuilder::rust_doc(); let rust = MockInstallerBuilder::combined(&[&std, &rustc, &cargo, &rust_docs]); - let triple = MULTI_ARCH1.to_string(); - all.std.push((std, triple.clone())); - all.rustc.push((rustc, triple.clone())); - all.cargo.push((cargo, triple.clone())); + let tuple = MULTI_ARCH1.to_string(); + all.std.push((std, tuple.clone())); + all.rustc.push((rustc, tuple.clone())); + all.cargo.push((cargo, tuple.clone())); if rls != RlsStatus::Unavailable { let rls = MockInstallerBuilder::rls(version, version_hash, rls.pkg_name()); - all.rls.push((rls, triple.clone())); + all.rls.push((rls, tuple.clone())); } else { all.rls - .push((MockInstallerBuilder { components: vec![] }, triple.clone())); + .push((MockInstallerBuilder { components: vec![] }, tuple.clone())); } - all.docs.push((rust_docs, triple.to_string())); - all.combined.push((rust, triple)); + all.docs.push((rust_docs, tuple.to_string())); + all.combined.push((rust, tuple)); } let all_std_archs: Vec = all.std.iter().map(|(_, arch)| arch).cloned().collect(); @@ -365,8 +365,8 @@ impl MockChannel { let target_pkgs = target_pkgs .into_iter() - .map(|(installer, triple)| MockTargetedPackage { - target: triple, + .map(|(installer, tuple)| MockTargetedPackage { + target: tuple, available: !installer.components.is_empty(), components: vec![], installer, @@ -466,7 +466,7 @@ impl MockChannel { version: &str, version_hash: &str, ) -> Self { - let host_triple = this_host_triple(); + let host_tuple = this_host_tuple(); let packages = [ "cargo", @@ -483,7 +483,7 @@ impl MockChannel { name, version: format!("{version} ({version_hash})"), targets: vec![MockTargetedPackage { - target: host_triple.clone(), + target: host_tuple.clone(), available: false, components: vec![], installer: MockInstallerBuilder { components: vec![] }, @@ -549,7 +549,7 @@ impl RlsStatus { // A single rust-installer package #[derive(Debug, Hash, Eq, PartialEq)] pub(crate) struct MockPackage { - // rust, rustc, rust-std-$triple, rust-doc, etc. + // rust, rustc, rust-std-$tuple, rust-doc, etc. pub name: &'static str, pub version: String, pub targets: Vec, @@ -836,12 +836,12 @@ impl MockDistServer { for component in &target.components { tpkg.components.push(Component { pkg: component.name.to_owned(), - target: Some(TargetTriple::new(&component.target)), + target: Some(TargetTuple::new(&component.target)), is_extension: component.is_extension, }); } - targets.insert(TargetTriple::new(&target.target), tpkg); + targets.insert(TargetTuple::new(&target.target), tpkg); } manifest.packages.insert( diff --git a/src/test/mock.rs b/src/test/mock.rs index 37162c3498..89b2b3ee72 100644 --- a/src/test/mock.rs +++ b/src/test/mock.rs @@ -6,7 +6,7 @@ use std::path::Path; use std::sync::Arc; use super::clitools::mock_bin; -use super::{this_host_triple, topical_doc_data}; +use super::{this_host_tuple, topical_doc_data}; // Mock of the on-disk structure of rust-installer installers #[derive(Debug, PartialEq, Eq, Hash, Clone)] @@ -42,7 +42,7 @@ impl MockInstallerBuilder { pub(super) fn rustc(target: &str, version: &str, version_hash_: &str) -> Self { // For cross-host rustc's modify the version_hash so they can be identified from // test cases. - let this_host = this_host_triple(); + let this_host = this_host_tuple(); let version_hash = if this_host != target { format!("xxxx-{}", &version_hash_[5..]) } else { diff --git a/src/toolchain.rs b/src/toolchain.rs index f13ef0aaf3..d2925bd2a9 100644 --- a/src/toolchain.rs +++ b/src/toolchain.rs @@ -23,7 +23,7 @@ use crate::{ RustupError, config::{ActiveSource, Cfg, InstalledPath}, dist::{ - DistOptions, PartialToolchainDesc, TargetTriple, + DistOptions, PartialToolchainDesc, TargetTuple, component::{Component, Components}, prefix::InstallPrefix, }, @@ -371,12 +371,12 @@ impl<'a> Toolchain<'a> { return Ok(None); } - let default_host_triple = self.cfg.get_default_host_triple()?; + let default_host_tuple = self.cfg.get_default_host_tuple()?; // XXX: This could actually consider all installed distributable // toolchains in principle. for fallback in ["nightly", "beta", "stable"] { let resolved = - PartialToolchainDesc::from_str(fallback)?.resolve(&default_host_triple)?; + PartialToolchainDesc::from_str(fallback)?.resolve(&default_host_tuple)?; if let Ok(fallback) = DistributableToolchain::new(self.cfg, resolved) { let cmd = fallback.create_fallback_command("cargo", self)?; return Ok(Some(cmd)); @@ -588,14 +588,14 @@ impl<'a> Toolchain<'a> { } /// Get the list of installed targets for any toolchain - pub fn installed_targets(&self) -> anyhow::Result> { + pub fn installed_targets(&self) -> anyhow::Result> { Ok(self .installed_components()? .into_iter() .filter_map(|c| { c.name() .strip_prefix("rust-std-") - .map(|triple| TargetTriple::new(triple.to_string())) + .map(|tuple| TargetTuple::new(tuple.to_string())) }) .collect()) } diff --git a/src/toolchain/names.rs b/src/toolchain/names.rs index b9ea7404d4..b62ecfbe5b 100644 --- a/src/toolchain/names.rs +++ b/src/toolchain/names.rs @@ -6,7 +6,7 @@ //! //! `MaybeOfficialToolchainName` represents a toolchain passed to rustup-init: //! 'none' to select no toolchain to install, and otherwise a partial toolchain -//! description - channel and optional triple and optional date. +//! description - channel and optional tuple and optional date. //! //! `ResolvableToolchainName` represents a toolchain name from a user. Either a //! partial toolchain description or a single path component that is not 'none'. @@ -15,7 +15,7 @@ //! for both custom and official names. //! //! `ToolchainName` is the result of resolving `ResolvableToolchainName` with a -//! host triple, or parsing an installed toolchain name directly. +//! host tuple, or parsing an installed toolchain name directly. //! //! `ResolvableLocalToolchainName` represents the values permittable in //! `RUSTUP_TOOLCHAIN`: resolved or not resolved official names, custom names, @@ -50,7 +50,7 @@ use std::{ use thiserror::Error; -use crate::dist::{PartialToolchainDesc, TargetTriple, ToolchainDesc}; +use crate::dist::{PartialToolchainDesc, TargetTuple, ToolchainDesc}; /// Errors related to toolchains #[derive(Error, Debug)] @@ -139,7 +139,7 @@ pub(crate) enum ResolvableToolchainName { impl ResolvableToolchainName { /// Resolve to a concrete toolchain name - pub fn resolve(&self, host: &TargetTriple) -> Result { + pub fn resolve(&self, host: &TargetTuple) -> Result { match self.clone() { ResolvableToolchainName::Custom(c) => Ok(ToolchainName::Custom(c)), ResolvableToolchainName::Official(desc) => { @@ -296,7 +296,7 @@ pub(crate) enum ResolvableLocalToolchainName { impl ResolvableLocalToolchainName { /// Resolve to a concrete toolchain name - pub fn resolve(&self, host: &TargetTriple) -> Result { + pub fn resolve(&self, host: &TargetTuple) -> Result { match self.clone() { ResolvableLocalToolchainName::Named(t) => { Ok(LocalToolchainName::Named(t.resolve(host)?)) @@ -482,19 +482,19 @@ mod tests { use crate::{ dist::{ PartialToolchainDesc, - triple::known::{LIST_ARCHS, LIST_ENVS, LIST_OSES}, + target_tuple::known::{LIST_ARCHS, LIST_ENVS, LIST_OSES}, }, toolchain::names::{CustomToolchainName, ResolvableToolchainName, ToolchainName}, }; fn partial_toolchain_desc_re() -> String { - let triple_re = format!( + let tuple_re = format!( r"(-({}))?(?:-({}))?(?:-({}))?", LIST_ARCHS.join("|"), LIST_OSES.join("|"), LIST_ENVS.join("|") ); - r"(nightly|beta|stable|[0-9]{1}(\.(0|[1-9][0-9]{0,2}))(\.(0|[1-9][0-9]{0,1}))?(-beta(\.(0|[1-9][1-9]{0,1}))?)?)(-([0-9]{4}-[0-9]{2}-[0-9]{2}))?".to_owned() + &triple_re + r"(nightly|beta|stable|[0-9]{1}(\.(0|[1-9][0-9]{0,2}))(\.(0|[1-9][0-9]{0,1}))?(-beta(\.(0|[1-9][1-9]{0,1}))?)?)(-([0-9]{4}-[0-9]{2}-[0-9]{2}))?".to_owned() + &tuple_re } prop_compose! { diff --git a/tests/suite/cli_exact.rs b/tests/suite/cli_exact.rs index 196a9ac37f..fa20ef80ee 100644 --- a/tests/suite/cli_exact.rs +++ b/tests/suite/cli_exact.rs @@ -2,7 +2,7 @@ //! is exactly as expected. use rustup::test::{ - CROSS_ARCH1, CROSS_ARCH2, CliTestContext, MULTI_ARCH1, Scenario, this_host_triple, + CROSS_ARCH1, CROSS_ARCH2, CliTestContext, MULTI_ARCH1, Scenario, this_host_tuple, }; use rustup::utils::raw; @@ -15,16 +15,16 @@ async fn update_once() { .is_ok() .with_stdout(snapbox::str![[r#" - nightly-[HOST_TRIPLE] installed - 1.3.0 (hash-nightly-2) + nightly-[HOST_TUPLE] installed - 1.3.0 (hash-nightly-2) "#]]) .with_stderr(snapbox::str![[r#" -info: syncing channel updates for nightly-[HOST_TRIPLE] +info: syncing channel updates for nightly-[HOST_TUPLE] 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_TUPLE] "#]]); cx.config @@ -32,10 +32,10 @@ info: default toolchain set to nightly-[HOST_TRIPLE] .await .is_ok() .with_stdout(snapbox::str![[r#" -cargo-[HOST_TRIPLE] -rust-docs-[HOST_TRIPLE] -rust-std-[HOST_TRIPLE] -rustc-[HOST_TRIPLE] +cargo-[HOST_TUPLE] +rust-docs-[HOST_TUPLE] +rust-std-[HOST_TUPLE] +rustc-[HOST_TUPLE] "#]]); } @@ -61,13 +61,13 @@ async fn update_once_and_check_self_update() { .is_ok() .with_stdout(snapbox::str![[r#" - nightly-[HOST_TRIPLE] installed - 1.3.0 (hash-nightly-2) + nightly-[HOST_TUPLE] installed - 1.3.0 (hash-nightly-2) rustup - Update available : [CURRENT_VERSION] -> [TEST_VERSION] "#]]) .with_stderr(snapbox::str![[r#" -info: syncing channel updates for nightly-[HOST_TRIPLE] +info: syncing channel updates for nightly-[HOST_TUPLE] info: latest update on 2015-01-02 for version 1.3.0 (hash-nightly-2) info: downloading component[..] ... @@ -77,10 +77,10 @@ info: downloading component[..] .await .is_ok() .with_stdout(snapbox::str![[r#" -cargo-[HOST_TRIPLE] -rust-docs-[HOST_TRIPLE] -rust-std-[HOST_TRIPLE] -rustc-[HOST_TRIPLE] +cargo-[HOST_TUPLE] +rust-docs-[HOST_TUPLE] +rust-std-[HOST_TUPLE] +rustc-[HOST_TUPLE] "#]]); } @@ -105,12 +105,12 @@ async fn update_once_and_self_update() { .is_ok() .with_stdout(snapbox::str![[r#" - nightly-[HOST_TRIPLE] installed - 1.3.0 (hash-nightly-2) + nightly-[HOST_TUPLE] installed - 1.3.0 (hash-nightly-2) "#]]) .with_stderr(snapbox::str![[r#" -info: syncing channel updates for nightly-[HOST_TRIPLE] +info: syncing channel updates for nightly-[HOST_TUPLE] info: latest update on 2015-01-02 for version 1.3.0 (hash-nightly-2) info: downloading component[..] ... @@ -123,10 +123,10 @@ info: downloading self-update (new version: [TEST_VERSION]) .await .is_ok() .with_stdout(snapbox::str![[r#" -cargo-[HOST_TRIPLE] -rust-docs-[HOST_TRIPLE] -rust-std-[HOST_TRIPLE] -rustc-[HOST_TRIPLE] +cargo-[HOST_TUPLE] +rust-docs-[HOST_TUPLE] +rust-std-[HOST_TUPLE] +rustc-[HOST_TUPLE] "#]]); } @@ -148,12 +148,12 @@ async fn update_again() { .is_ok() .with_stdout(snapbox::str![[r#" - nightly-[HOST_TRIPLE] unchanged - 1.3.0 (hash-nightly-2) + nightly-[HOST_TUPLE] unchanged - 1.3.0 (hash-nightly-2) "#]]) .with_stderr(snapbox::str![[r#" -info: syncing channel updates for nightly-[HOST_TRIPLE] +info: syncing channel updates for nightly-[HOST_TUPLE] "#]]); cx.config @@ -162,12 +162,12 @@ info: syncing channel updates for nightly-[HOST_TRIPLE] .is_ok() .with_stdout(snapbox::str![[r#" - nightly-[HOST_TRIPLE] unchanged - 1.3.0 (hash-nightly-2) + nightly-[HOST_TUPLE] unchanged - 1.3.0 (hash-nightly-2) "#]]) .with_stderr(snapbox::str![[r#" -info: syncing channel updates for nightly-[HOST_TRIPLE] +info: syncing channel updates for nightly-[HOST_TUPLE] "#]]); } @@ -184,9 +184,9 @@ async fn check_updates_none() { .await .is_err() .with_stdout(snapbox::str![[r#" -stable-[HOST_TRIPLE] - up to date: 1.1.0 (hash-stable-1.1.0) -beta-[HOST_TRIPLE] - up to date: 1.2.0 (hash-beta-1.2.0) -nightly-[HOST_TRIPLE] - up to date: 1.3.0 (hash-nightly-2) +stable-[HOST_TUPLE] - up to date: 1.1.0 (hash-stable-1.1.0) +beta-[HOST_TUPLE] - up to date: 1.2.0 (hash-beta-1.2.0) +nightly-[HOST_TUPLE] - up to date: 1.3.0 (hash-nightly-2) "#]]); } @@ -209,9 +209,9 @@ async fn check_updates_some() { .await .is_ok() .with_stdout(snapbox::str![[r#" -stable-[HOST_TRIPLE] - update available: 1.0.0 (hash-stable-1.0.0) -> 1.1.0 (hash-stable-1.1.0) -beta-[HOST_TRIPLE] - update available: 1.1.0 (hash-beta-1.1.0) -> 1.2.0 (hash-beta-1.2.0) -nightly-[HOST_TRIPLE] - update available: 1.2.0 (hash-nightly-1) -> 1.3.0 (hash-nightly-2) +stable-[HOST_TUPLE] - update available: 1.0.0 (hash-stable-1.0.0) -> 1.1.0 (hash-stable-1.1.0) +beta-[HOST_TUPLE] - update available: 1.1.0 (hash-beta-1.1.0) -> 1.2.0 (hash-beta-1.2.0) +nightly-[HOST_TUPLE] - update available: 1.2.0 (hash-nightly-1) -> 1.3.0 (hash-nightly-2) "#]]); } @@ -276,9 +276,9 @@ async fn check_updates_with_update() { .await .is_err() .with_stdout(snapbox::str![[r#" -stable-[HOST_TRIPLE] - up to date: 1.0.0 (hash-stable-1.0.0) -beta-[HOST_TRIPLE] - up to date: 1.1.0 (hash-beta-1.1.0) -nightly-[HOST_TRIPLE] - up to date: 1.2.0 (hash-nightly-1) +stable-[HOST_TUPLE] - up to date: 1.0.0 (hash-stable-1.0.0) +beta-[HOST_TUPLE] - up to date: 1.1.0 (hash-beta-1.1.0) +nightly-[HOST_TUPLE] - up to date: 1.2.0 (hash-nightly-1) "#]]); } @@ -289,9 +289,9 @@ nightly-[HOST_TRIPLE] - up to date: 1.2.0 (hash-nightly-1) .await .is_ok() .with_stdout(snapbox::str![[r#" -stable-[HOST_TRIPLE] - update available: 1.0.0 (hash-stable-1.0.0) -> 1.1.0 (hash-stable-1.1.0) -beta-[HOST_TRIPLE] - update available: 1.1.0 (hash-beta-1.1.0) -> 1.2.0 (hash-beta-1.2.0) -nightly-[HOST_TRIPLE] - update available: 1.2.0 (hash-nightly-1) -> 1.3.0 (hash-nightly-2) +stable-[HOST_TUPLE] - update available: 1.0.0 (hash-stable-1.0.0) -> 1.1.0 (hash-stable-1.1.0) +beta-[HOST_TUPLE] - update available: 1.1.0 (hash-beta-1.1.0) -> 1.2.0 (hash-beta-1.2.0) +nightly-[HOST_TUPLE] - update available: 1.2.0 (hash-nightly-1) -> 1.3.0 (hash-nightly-2) "#]]); cx.config.expect(["rustup", "update", "beta"]).await.is_ok(); @@ -300,9 +300,9 @@ nightly-[HOST_TRIPLE] - update available: 1.2.0 (hash-nightly-1) -> 1.3.0 (hash- .await .is_ok() .with_stdout(snapbox::str![[r#" -stable-[HOST_TRIPLE] - update available: 1.0.0 (hash-stable-1.0.0) -> 1.1.0 (hash-stable-1.1.0) -beta-[HOST_TRIPLE] - up to date: 1.2.0 (hash-beta-1.2.0) -nightly-[HOST_TRIPLE] - update available: 1.2.0 (hash-nightly-1) -> 1.3.0 (hash-nightly-2) +stable-[HOST_TUPLE] - update available: 1.0.0 (hash-stable-1.0.0) -> 1.1.0 (hash-stable-1.1.0) +beta-[HOST_TUPLE] - up to date: 1.2.0 (hash-beta-1.2.0) +nightly-[HOST_TUPLE] - update available: 1.2.0 (hash-nightly-1) -> 1.3.0 (hash-nightly-2) "#]]); } @@ -316,16 +316,16 @@ async fn default() { .is_ok() .with_stdout(snapbox::str![[r#" - nightly-[HOST_TRIPLE] installed - 1.3.0 (hash-nightly-2) + nightly-[HOST_TUPLE] installed - 1.3.0 (hash-nightly-2) "#]]) .with_stderr(snapbox::str![[r#" -info: syncing channel updates for nightly-[HOST_TRIPLE] +info: syncing channel updates for nightly-[HOST_TUPLE] 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_TUPLE] "#]]); cx.config @@ -333,10 +333,10 @@ info: default toolchain set to nightly-[HOST_TRIPLE] .await .is_ok() .with_stdout(snapbox::str![[r#" -cargo-[HOST_TRIPLE] -rust-docs-[HOST_TRIPLE] -rust-std-[HOST_TRIPLE] -rustc-[HOST_TRIPLE] +cargo-[HOST_TUPLE] +rust-docs-[HOST_TUPLE] +rust-std-[HOST_TUPLE] +rustc-[HOST_TUPLE] "#]]); } @@ -355,7 +355,7 @@ async fn override_again() { .is_ok() .with_stdout(snapbox::str![[""]]) .with_stderr(snapbox::str![[r#" -info: override toolchain for [CWD] set to nightly-[HOST_TRIPLE] +info: override toolchain for [CWD] set to nightly-[HOST_TUPLE] "#]]); } @@ -527,7 +527,7 @@ async fn list_overrides() { .extend_redactions([("[CWD]", cwd_formatted)]) .is_ok() .with_stdout(snapbox::str![[r#" -[CWD] nightly-[HOST_TRIPLE] +[CWD] nightly-[HOST_TUPLE] "#]]) .with_stderr(snapbox::str![[""]]); @@ -564,7 +564,7 @@ async fn list_overrides_with_nonexistent() { .extend_redactions([("[PATH]", path_formatted + " (not a directory)")]) .is_ok() .with_stdout(snapbox::str![[r#" -[PATH] nightly-[HOST_TRIPLE] +[PATH] nightly-[HOST_TUPLE] "#]]) @@ -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_TUPLE] error: no release found for 'nightly-2016-01-01' "#]]); @@ -659,7 +659,7 @@ help: run 'rustup default stable' to download the latest stable release of Rust #[tokio::test] async fn list_targets() { let cx = CliTestContext::new(Scenario::SimpleV2).await; - let trip = this_host_triple(); + let trip = this_host_tuple(); let mut sorted = [ format!("{} (installed)", &*trip), format!("{CROSS_ARCH1} (installed)"), @@ -690,7 +690,7 @@ async fn list_targets() { #[tokio::test] async fn list_targets_quiet() { let cx = CliTestContext::new(Scenario::SimpleV2).await; - let trip = this_host_triple(); + let trip = this_host_tuple(); let mut sorted = [trip, CROSS_ARCH1.to_string(), CROSS_ARCH2.to_string()]; sorted.sort(); @@ -717,7 +717,7 @@ async fn list_targets_quiet() { #[tokio::test] async fn list_installed_targets() { let cx = CliTestContext::new(Scenario::SimpleV2).await; - let trip = this_host_triple(); + let trip = this_host_tuple(); let mut sorted = [trip, CROSS_ARCH1.to_string(), CROSS_ARCH2.to_string()]; sorted.sort(); @@ -778,8 +778,8 @@ async fn show_suggestion_for_missing_toolchain() { .await .is_err() .with_stderr(snapbox::str![[r#" -error: toolchain 'nightly-[HOST_TRIPLE]' is not installed -help: run `rustup toolchain install nightly-[HOST_TRIPLE]` to install it +error: toolchain 'nightly-[HOST_TUPLE]' is not installed +help: run `rustup toolchain install nightly-[HOST_TUPLE]` to install it "#]]); } @@ -805,7 +805,7 @@ components = [ "rust-src" ] .await .is_err() .with_stderr(snapbox::str![[r#" -error: toolchain 'stable-[HOST_TRIPLE]' is not installed +error: toolchain 'stable-[HOST_TUPLE]' is not installed help: run `rustup toolchain install` to install it "#]]); @@ -862,15 +862,15 @@ async fn install_unreleased_component() { .is_ok() .with_stdout(snapbox::str![[r#" - nightly-[HOST_TRIPLE] unchanged - 1.37.0 (hash-nightly-1) + nightly-[HOST_TUPLE] unchanged - 1.37.0 (hash-nightly-1) "#]]) .with_stderr(snapbox::str![[r#" -info: syncing channel updates for nightly-[HOST_TRIPLE] +info: syncing channel updates for nightly-[HOST_TUPLE] 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] +info: syncing channel updates for nightly-2019-09-12-[HOST_TUPLE] "#]]); @@ -882,18 +882,18 @@ info: syncing channel updates for nightly-2019-09-12-[HOST_TRIPLE] .is_ok() .with_stdout(snapbox::str![[r#" - nightly-[HOST_TRIPLE] unchanged - 1.37.0 (hash-nightly-1) + nightly-[HOST_TUPLE] unchanged - 1.37.0 (hash-nightly-1) "#]]) .with_stderr(snapbox::str![[r#" -info: syncing channel updates for nightly-[HOST_TRIPLE] +info: syncing channel updates for nightly-[HOST_TUPLE] 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: syncing channel updates for nightly-2019-09-13-[HOST_TUPLE] 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] +info: syncing channel updates for nightly-2019-09-12-[HOST_TUPLE] "#]]); } diff --git a/tests/suite/cli_inst_interactive.rs b/tests/suite/cli_inst_interactive.rs index 6b1e31bfd2..33b6604184 100644 --- a/tests/suite/cli_inst_interactive.rs +++ b/tests/suite/cli_inst_interactive.rs @@ -4,7 +4,7 @@ use std::env::consts::EXE_SUFFIX; use std::io::Write; use std::process::Stdio; -use rustup::test::{Assert, CliTestContext, Config, SanitizedOutput, Scenario, this_host_triple}; +use rustup::test::{Assert, CliTestContext, Config, SanitizedOutput, Scenario, this_host_tuple}; #[cfg(windows)] use rustup::test::{RegistryGuard, USER_PATH}; use rustup::utils::raw; @@ -74,7 +74,7 @@ these changes will be reverted. Current installation options: - default host triple: [HOST_TRIPLE] + default host tuple: [HOST_TUPLE] default toolchain: stable (default) profile: default modify PATH variable: no @@ -84,7 +84,7 @@ Current installation options: 3) Cancel installation > - stable-[HOST_TRIPLE] installed - 1.1.0 (hash-stable-1.1.0) + stable-[HOST_TUPLE] installed - 1.1.0 (hash-stable-1.1.0) Rust is installed now. Great! @@ -136,12 +136,12 @@ Rust is installed now. Great! } #[tokio::test] -async fn installer_shows_default_host_triple() { +async fn installer_shows_default_host_tuple() { let cx = CliTestContext::new(Scenario::SimpleV2).await; run_input(&cx.config, &["rustup-init", "--no-modify-path"], "2\n").with_stdout(snapbox::str![ [r#" ... -Default host triple? [[HOST_TRIPLE]] +Default host tuple? [[HOST_TUPLE]] ... "#] ]); @@ -320,7 +320,7 @@ async fn with_non_default_toolchain_still_prompts() { ... installed toolchains -------------------- -nightly-[HOST_TRIPLE] (active, default) +nightly-[HOST_TUPLE] (active, default) ... "#]]) .is_ok(); @@ -347,7 +347,7 @@ async fn with_non_release_channel_non_default_toolchain() { ... installed toolchains -------------------- -nightly-2015-01-02-[HOST_TRIPLE] (active, default) +nightly-2015-01-02-[HOST_TUPLE] (active, default) ... "#]]) .is_ok(); @@ -370,7 +370,7 @@ async fn set_nightly_toolchain() { ... installed toolchains -------------------- -nightly-[HOST_TRIPLE] (active, default) +nightly-[HOST_TUPLE] (active, default) ... "#]]) .is_ok(); @@ -408,7 +408,7 @@ async fn set_nightly_toolchain_and_unset() { ... installed toolchains -------------------- -beta-[HOST_TRIPLE] (active, default) +beta-[HOST_TUPLE] (active, default) ... "#]]) .is_ok(); @@ -448,7 +448,7 @@ rust-src (installed) .await .with_stdout(snapbox::str![[r#" ... -rust-analysis-[HOST_TRIPLE] (installed) +rust-analysis-[HOST_TUPLE] (installed) ... "#]]) .is_ok(); @@ -513,7 +513,7 @@ async fn installing_when_already_installed_updates_toolchain() { run_input(&cx.config, &["rustup-init", "--no-modify-path"], "\n\n").with_stdout(snapbox::str![ [r#" ... -[..]stable-[HOST_TRIPLE] unchanged - 1.1.0 (hash-stable-1.1.0) +[..]stable-[HOST_TUPLE] unchanged - 1.1.0 (hash-stable-1.1.0) ... "#] ]); @@ -620,7 +620,7 @@ async fn install_non_installable_toolchain() { .await .with_stderr(snapbox::str![[r#" ... -error: toolchain 'nightly-[HOST_TRIPLE]' is not installable +error: toolchain 'nightly-[HOST_TUPLE]' is not installable ... "#]]) .is_err(); @@ -640,7 +640,7 @@ async fn install_warns_about_existing_settings_file() { r#"default_toolchain = "{}" profile = "default" version = "12""#, - this_host_triple() + this_host_tuple() ), ) .unwrap(); diff --git a/tests/suite/cli_misc.rs b/tests/suite/cli_misc.rs index eb5ac8a303..ebdc6c1d22 100644 --- a/tests/suite/cli_misc.rs +++ b/tests/suite/cli_misc.rs @@ -7,7 +7,7 @@ use std::{env::consts::EXE_SUFFIX, path::Path}; use itertools::Itertools; use rustup::test::Assert; -use rustup::test::{CliTestContext, MULTI_ARCH1, Scenario, this_host_triple}; +use rustup::test::{CliTestContext, MULTI_ARCH1, Scenario, this_host_tuple}; use rustup::utils; use rustup::utils::raw::symlink_dir; @@ -144,7 +144,7 @@ async fn update_all_no_update_whitespace() { .is_ok() .with_stdout(snapbox::str![[r#" - nightly-[HOST_TRIPLE] installed - 1.3.0 (hash-nightly-2) + nightly-[HOST_TUPLE] installed - 1.3.0 (hash-nightly-2) "#]]); @@ -226,10 +226,10 @@ async fn subcommand_required_for_self() { #[tokio::test] async fn multi_host_smoke_test() { - // We cannot run this test if the current host triple is equal to the - // multi-arch triple, but this should never be the case. Check that just + // We cannot run this test if the current host tuple is equal to the + // multi-arch tuple, but this should never be the case. Check that just // to be sure. - assert_ne!(this_host_triple(), MULTI_ARCH1); + assert_ne!(this_host_tuple(), MULTI_ARCH1); let cx = CliTestContext::new(Scenario::MultiHost).await; let toolchain = format!("nightly-{MULTI_ARCH1}"); @@ -584,8 +584,8 @@ async fn rustup_run_not_installed() { .expect(["rustup", "run", "nightly", "rustc", "--version"]) .await .with_stderr(snapbox::str![[r#" -error: toolchain 'nightly-[HOST_TRIPLE]' is not installed -help: run `rustup toolchain install nightly-[HOST_TRIPLE]` to install it +error: toolchain 'nightly-[HOST_TUPLE]' is not installed +help: run `rustup toolchain install nightly-[HOST_TUPLE]` to install it "#]]) .is_err(); @@ -614,10 +614,10 @@ async fn rustup_run_install() { .await .is_ok() .with_stdout(snapbox::str![[r#" -cargo-[HOST_TRIPLE] -rust-docs-[HOST_TRIPLE] -rust-std-[HOST_TRIPLE] -rustc-[HOST_TRIPLE] +cargo-[HOST_TUPLE] +rust-docs-[HOST_TUPLE] +rust-std-[HOST_TUPLE] +rustc-[HOST_TUPLE] "#]]); } @@ -630,13 +630,13 @@ async fn toolchains_are_resolved_early() { .await .is_ok(); - let full_toolchain = format!("nightly-{}", this_host_triple()); + let full_toolchain = format!("nightly-{}", this_host_tuple()); cx.config .expect(["rustup", "default", &full_toolchain]) .await .with_stderr(snapbox::str![[r#" ... -info: using existing install for nightly-[HOST_TRIPLE] +info: using existing install for nightly-[HOST_TUPLE] ... "#]]) .is_ok(); @@ -684,7 +684,7 @@ async fn run_rls_when_not_available_in_toolchain() { .expect(["rls", "--version"]) .await .with_stderr(snapbox::str![[r#" -error: the 'rls' component which provides the command 'rls[EXE]' is not available for the 'nightly-[HOST_TRIPLE]' toolchain +error: the 'rls' component which provides the command 'rls[EXE]' is not available for the 'nightly-[HOST_TUPLE]' toolchain "#]]) .is_err(); @@ -710,7 +710,7 @@ async fn run_rls_when_not_installed() { .expect(["rls", "--version"]) .await .with_stderr(snapbox::str![[r#" -error: 'rls[EXE]' is not installed for the toolchain 'stable-[HOST_TRIPLE]'. +error: 'rls[EXE]' is not installed for the toolchain 'stable-[HOST_TUPLE]'. help: run `rustup component add rls` to install it "#]]) @@ -732,8 +732,8 @@ async fn run_rls_when_not_installed_for_nightly() { .expect(["rls", "+nightly", "--version"]) .await .with_stderr(snapbox::str![[r#" -error: 'rls[EXE]' is not installed for the toolchain 'nightly-[HOST_TRIPLE]'. -help: run `rustup component add --toolchain nightly-[HOST_TRIPLE] rls` to install it +error: 'rls[EXE]' is not installed for the toolchain 'nightly-[HOST_TUPLE]'. +help: run `rustup component add --toolchain nightly-[HOST_TUPLE] rls` to install it "#]]) .is_err(); @@ -751,7 +751,7 @@ async fn run_rust_lldb_when_not_in_toolchain() { .expect(["rust-lldb", "--version"]) .await .with_stderr(snapbox::str![[r#" -error: the 'rust-lldb[EXE]' binary, normally provided by the 'rustc' component, is not applicable to the 'nightly-[HOST_TRIPLE]' toolchain +error: the 'rust-lldb[EXE]' binary, normally provided by the 'rustc' component, is not applicable to the 'nightly-[HOST_TUPLE]' toolchain "#]]) .is_err(); @@ -838,7 +838,7 @@ async fn rename_rls_list() { .await .with_stdout(snapbox::str![[r#" ... -rls-[HOST_TRIPLE] (installed) +rls-[HOST_TUPLE] (installed) ... "#]]) .is_ok(); @@ -865,7 +865,7 @@ async fn rename_rls_preview_list() { .await .with_stdout(snapbox::str![[r#" ... -rls-[HOST_TRIPLE] (installed) +rls-[HOST_TUPLE] (installed) ... "#]]) .is_ok(); @@ -897,7 +897,7 @@ async fn rename_rls_remove() { .await .with_stderr(snapbox::str![[r#" ... -error: 'rls[EXE]' is not installed for the toolchain 'nightly-[HOST_TRIPLE]'. +error: 'rls[EXE]' is not installed for the toolchain 'nightly-[HOST_TUPLE]'. ... "#]]) .is_err(); @@ -916,7 +916,7 @@ error: 'rls[EXE]' is not installed for the toolchain 'nightly-[HOST_TRIPLE]'. .await .with_stderr(snapbox::str![[r#" ... -error: 'rls[EXE]' is not installed for the toolchain 'nightly-[HOST_TRIPLE]'. +error: 'rls[EXE]' is not installed for the toolchain 'nightly-[HOST_TUPLE]'. ... "#]]) .is_err(); @@ -1091,7 +1091,7 @@ async fn install_unavailable_platform() { .await .with_stderr(snapbox::str![[r#" ... -error: toolchain 'nightly-[HOST_TRIPLE]' is not installable +error: toolchain 'nightly-[HOST_TUPLE]' is not installable ... "#]]) .is_err(); @@ -1101,7 +1101,7 @@ error: toolchain 'nightly-[HOST_TRIPLE]' is not installable .await .with_stderr(snapbox::str![[r#" ... -error: toolchain 'nightly-[HOST_TRIPLE]' is not installable +error: toolchain 'nightly-[HOST_TUPLE]' is not installable ... "#]]) .is_err(); @@ -1384,7 +1384,7 @@ async fn which_asking_uninstalled_toolchain() { .expect(["rustup", "which", "--toolchain=nightly", "rustc"]) .await .with_stdout(snapbox::str![[r#" -[..]/toolchains/nightly-[HOST_TRIPLE]/bin/rustc[EXE] +[..]/toolchains/nightly-[HOST_TUPLE]/bin/rustc[EXE] "#]]) .is_ok(); @@ -1466,7 +1466,7 @@ async fn override_by_toolchain_on_the_command_line() { .expect(["rustup", "+stable", "which", "rustc"]) .await .with_stdout(snapbox::str![[r#" -[..]/toolchains/stable-[HOST_TRIPLE]/bin/rustc[EXE] +[..]/toolchains/stable-[HOST_TUPLE]/bin/rustc[EXE] "#]]) .is_ok(); @@ -1474,7 +1474,7 @@ async fn override_by_toolchain_on_the_command_line() { .expect(["rustup", "+nightly", "which", "rustc"]) .await .with_stdout(snapbox::str![[r#" -[..]/toolchains/nightly-[HOST_TRIPLE]/bin/rustc[EXE] +[..]/toolchains/nightly-[HOST_TUPLE]/bin/rustc[EXE] "#]]) .is_ok(); @@ -1487,7 +1487,7 @@ async fn override_by_toolchain_on_the_command_line() { .expect(["rustup", "+stable", "which", "rustc"]) .await .with_stdout(snapbox::str![[r#" -[..]/toolchains/stable-[HOST_TRIPLE]/bin/rustc[EXE] +[..]/toolchains/stable-[HOST_TUPLE]/bin/rustc[EXE] "#]]) .is_ok(); @@ -1495,7 +1495,7 @@ async fn override_by_toolchain_on_the_command_line() { .expect(["rustup", "+nightly", "which", "rustc"]) .await .with_stdout(snapbox::str![[r#" -[..]/toolchains/nightly-[HOST_TRIPLE]/bin/rustc[EXE] +[..]/toolchains/nightly-[HOST_TUPLE]/bin/rustc[EXE] "#]]) .is_ok(); @@ -1528,7 +1528,7 @@ info: profile set to minimal .expect(["rustup", "default"]) .await .with_stdout(snapbox::str![[r#" -nightly-[HOST_TRIPLE][..] +nightly-[HOST_TUPLE][..] "#]]) .is_ok(); @@ -1603,9 +1603,9 @@ async fn toolchain_install_multi_components_comma() { .await .with_stdout(snapbox::str![[r#" ... -rls-[HOST_TRIPLE][..] +rls-[HOST_TUPLE][..] ... -rust-docs-[HOST_TRIPLE][..] +rust-docs-[HOST_TUPLE][..] ... "#]]) .is_ok(); @@ -1692,7 +1692,7 @@ async fn rust_analyzer_proxy_falls_back_external() { .config .rustupdir .join("toolchains") - .join(format!("stable-{}", this_host_triple())) + .join(format!("stable-{}", this_host_tuple())) .join("bin"); for dir in [exedir, bindir] { fs::rename(dir.join(&rls), dir.join(&ra)).unwrap(); diff --git a/tests/suite/cli_rustup.rs b/tests/suite/cli_rustup.rs index 21d3b86f5f..1bab3512c2 100644 --- a/tests/suite/cli_rustup.rs +++ b/tests/suite/cli_rustup.rs @@ -5,7 +5,7 @@ use std::path::PathBuf; use std::{env::consts::EXE_SUFFIX, path::Path}; use rustup::test::{ - CROSS_ARCH1, CROSS_ARCH2, CliTestContext, MULTI_ARCH1, Scenario, this_host_triple, + CROSS_ARCH1, CROSS_ARCH2, CliTestContext, MULTI_ARCH1, Scenario, this_host_tuple, topical_doc_data, }; use rustup::utils::raw; @@ -28,12 +28,12 @@ async fn rustup_stable() { .await .with_stdout(snapbox::str![[r#" - stable-[HOST_TRIPLE] updated - 1.1.0 (hash-stable-1.1.0) (from 1.0.0 (hash-stable-1.0.0)) + stable-[HOST_TUPLE] updated - 1.1.0 (hash-stable-1.1.0) (from 1.0.0 (hash-stable-1.0.0)) "#]]) .with_stderr(snapbox::str![[r#" -info: syncing channel updates for stable-[HOST_TRIPLE] +info: syncing channel updates for stable-[HOST_TUPLE] info: latest update on 2015-01-02 for version 1.1.0 (hash-stable-1.1.0) info: removing previous version of component cargo ... @@ -46,10 +46,10 @@ info: cleaning up downloads & tmp directories .await .is_ok() .with_stdout(snapbox::str![[r#" -cargo-[HOST_TRIPLE] -rust-docs-[HOST_TRIPLE] -rust-std-[HOST_TRIPLE] -rustc-[HOST_TRIPLE] +cargo-[HOST_TUPLE] +rust-docs-[HOST_TUPLE] +rust-std-[HOST_TUPLE] +rustc-[HOST_TUPLE] "#]]); } @@ -72,7 +72,7 @@ async fn rustup_stable_quiet() { .await .with_stdout(snapbox::str![[r#" - stable-[HOST_TRIPLE] updated - 1.1.0 (hash-stable-1.1.0) (from 1.0.0 (hash-stable-1.0.0)) + stable-[HOST_TUPLE] updated - 1.1.0 (hash-stable-1.1.0) (from 1.0.0 (hash-stable-1.0.0)) "#]]) @@ -92,12 +92,12 @@ async fn rustup_stable_no_change() { .await .with_stdout(snapbox::str![[r#" - stable-[HOST_TRIPLE] unchanged - 1.0.0 (hash-stable-1.0.0) + stable-[HOST_TUPLE] unchanged - 1.0.0 (hash-stable-1.0.0) "#]]) .with_stderr(snapbox::str![[r#" -info: syncing channel updates for stable-[HOST_TRIPLE] +info: syncing channel updates for stable-[HOST_TUPLE] info: cleaning up downloads & tmp directories "#]]) @@ -122,22 +122,22 @@ async fn rustup_all_channels() { .await .with_stdout(snapbox::str![[r#" - stable-[HOST_TRIPLE] updated - 1.1.0 (hash-stable-1.1.0) (from 1.0.0 (hash-stable-1.0.0)) - beta-[HOST_TRIPLE] updated - 1.2.0 (hash-beta-1.2.0) (from 1.1.0 (hash-beta-1.1.0)) - nightly-[HOST_TRIPLE] updated - 1.3.0 (hash-nightly-2) (from 1.2.0 (hash-nightly-1)) + stable-[HOST_TUPLE] updated - 1.1.0 (hash-stable-1.1.0) (from 1.0.0 (hash-stable-1.0.0)) + beta-[HOST_TUPLE] updated - 1.2.0 (hash-beta-1.2.0) (from 1.1.0 (hash-beta-1.1.0)) + nightly-[HOST_TUPLE] updated - 1.3.0 (hash-nightly-2) (from 1.2.0 (hash-nightly-1)) "#]]) .with_stderr(snapbox::str![[r#" -info: syncing channel updates for stable-[HOST_TRIPLE] +info: syncing channel updates for stable-[HOST_TUPLE] info: latest update on 2015-01-02 for version 1.1.0 (hash-stable-1.1.0) info: removing previous version of component cargo ... -info: syncing channel updates for beta-[HOST_TRIPLE] +info: syncing channel updates for beta-[HOST_TUPLE] info: latest update on 2015-01-02 for version 1.2.0 (hash-beta-1.2.0) info: removing previous version of component cargo ... -info: syncing channel updates for nightly-[HOST_TRIPLE] +info: syncing channel updates for nightly-[HOST_TUPLE] info: latest update on 2015-01-02 for version 1.3.0 (hash-nightly-2) info: removing previous version of component cargo ... @@ -150,10 +150,10 @@ info: cleaning up downloads & tmp directories .await .is_ok() .with_stdout(snapbox::str![[r#" -cargo-[HOST_TRIPLE] -rust-docs-[HOST_TRIPLE] -rust-std-[HOST_TRIPLE] -rustc-[HOST_TRIPLE] +cargo-[HOST_TUPLE] +rust-docs-[HOST_TUPLE] +rust-std-[HOST_TUPLE] +rustc-[HOST_TUPLE] "#]]); cx.config @@ -161,10 +161,10 @@ rustc-[HOST_TRIPLE] .await .is_ok() .with_stdout(snapbox::str![[r#" -cargo-[HOST_TRIPLE] -rust-docs-[HOST_TRIPLE] -rust-std-[HOST_TRIPLE] -rustc-[HOST_TRIPLE] +cargo-[HOST_TUPLE] +rust-docs-[HOST_TUPLE] +rust-std-[HOST_TUPLE] +rustc-[HOST_TUPLE] "#]]); cx.config @@ -172,10 +172,10 @@ rustc-[HOST_TRIPLE] .await .is_ok() .with_stdout(snapbox::str![[r#" -cargo-[HOST_TRIPLE] -rust-docs-[HOST_TRIPLE] -rust-std-[HOST_TRIPLE] -rustc-[HOST_TRIPLE] +cargo-[HOST_TUPLE] +rust-docs-[HOST_TUPLE] +rust-std-[HOST_TUPLE] +rustc-[HOST_TUPLE] "#]]); } @@ -199,19 +199,19 @@ async fn rustup_some_channels_up_to_date() { .await .with_stdout(snapbox::str![[r#" - stable-[HOST_TRIPLE] updated - 1.1.0 (hash-stable-1.1.0) (from 1.0.0 (hash-stable-1.0.0)) - beta-[HOST_TRIPLE] unchanged - 1.2.0 (hash-beta-1.2.0) - nightly-[HOST_TRIPLE] updated - 1.3.0 (hash-nightly-2) (from 1.2.0 (hash-nightly-1)) + stable-[HOST_TUPLE] updated - 1.1.0 (hash-stable-1.1.0) (from 1.0.0 (hash-stable-1.0.0)) + beta-[HOST_TUPLE] unchanged - 1.2.0 (hash-beta-1.2.0) + nightly-[HOST_TUPLE] updated - 1.3.0 (hash-nightly-2) (from 1.2.0 (hash-nightly-1)) "#]]) .with_stderr(snapbox::str![[r#" -info: syncing channel updates for stable-[HOST_TRIPLE] +info: syncing channel updates for stable-[HOST_TUPLE] info: latest update on 2015-01-02 for version 1.1.0 (hash-stable-1.1.0) info: removing previous version of component cargo ... -info: syncing channel updates for beta-[HOST_TRIPLE] -info: syncing channel updates for nightly-[HOST_TRIPLE] +info: syncing channel updates for beta-[HOST_TUPLE] +info: syncing channel updates for nightly-[HOST_TUPLE] info: latest update on 2015-01-02 for version 1.3.0 (hash-nightly-2) info: removing previous version of component cargo ... @@ -224,10 +224,10 @@ info: cleaning up downloads & tmp directories .await .is_ok() .with_stdout(snapbox::str![[r#" -cargo-[HOST_TRIPLE] -rust-docs-[HOST_TRIPLE] -rust-std-[HOST_TRIPLE] -rustc-[HOST_TRIPLE] +cargo-[HOST_TUPLE] +rust-docs-[HOST_TUPLE] +rust-std-[HOST_TUPLE] +rustc-[HOST_TUPLE] "#]]); cx.config @@ -235,10 +235,10 @@ rustc-[HOST_TRIPLE] .await .is_ok() .with_stdout(snapbox::str![[r#" -cargo-[HOST_TRIPLE] -rust-docs-[HOST_TRIPLE] -rust-std-[HOST_TRIPLE] -rustc-[HOST_TRIPLE] +cargo-[HOST_TUPLE] +rust-docs-[HOST_TUPLE] +rust-std-[HOST_TUPLE] +rustc-[HOST_TUPLE] "#]]); cx.config @@ -246,10 +246,10 @@ rustc-[HOST_TRIPLE] .await .is_ok() .with_stdout(snapbox::str![[r#" -cargo-[HOST_TRIPLE] -rust-docs-[HOST_TRIPLE] -rust-std-[HOST_TRIPLE] -rustc-[HOST_TRIPLE] +cargo-[HOST_TUPLE] +rust-docs-[HOST_TUPLE] +rust-std-[HOST_TUPLE] +rustc-[HOST_TUPLE] "#]]); } @@ -277,16 +277,16 @@ async fn default() { .await .with_stdout(snapbox::str![[r#" - nightly-[HOST_TRIPLE] installed - 1.3.0 (hash-nightly-2) + nightly-[HOST_TUPLE] installed - 1.3.0 (hash-nightly-2) "#]]) .with_stderr(snapbox::str![[r#" -info: syncing channel updates for nightly-[HOST_TRIPLE] +info: syncing channel updates for nightly-[HOST_TUPLE] 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_TUPLE] "#]]) .is_ok(); @@ -295,10 +295,10 @@ info: default toolchain set to nightly-[HOST_TRIPLE] .await .is_ok() .with_stdout(snapbox::str![[r#" -cargo-[HOST_TRIPLE] -rust-docs-[HOST_TRIPLE] -rust-std-[HOST_TRIPLE] -rustc-[HOST_TRIPLE] +cargo-[HOST_TUPLE] +rust-docs-[HOST_TUPLE] +rust-std-[HOST_TUPLE] +rustc-[HOST_TUPLE] "#]]); } @@ -322,9 +322,9 @@ async fn default_override() { .expect(["rustup", "default", "stable"]) .await .with_stderr(snapbox::str![[r#" -info: using existing install for 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 '[..]') +info: using existing install for stable-[HOST_TUPLE] +info: default toolchain set to stable-[HOST_TUPLE] +info: note that the toolchain 'nightly-[HOST_TUPLE]' is currently in use (directory override for '[..]') "#]]) .is_ok(); @@ -338,7 +338,7 @@ async fn rustup_zstd() { .await .with_stderr(snapbox::str![[r#" ... -[..]dist/2015-01-01/rust-std-nightly-[HOST_TRIPLE].tar.zst[..] +[..]dist/2015-01-01/rust-std-nightly-[HOST_TUPLE].tar.zst[..] ... "#]]) .is_ok(); @@ -349,7 +349,7 @@ async fn add_target() { let cx = CliTestContext::new(Scenario::SimpleV2).await; let path = format!( "toolchains/nightly-{}/lib/rustlib/{}/lib/libstd.rlib", - &this_host_triple(), + &this_host_tuple(), CROSS_ARCH1 ); cx.config @@ -368,7 +368,7 @@ async fn remove_target() { let cx = CliTestContext::new(Scenario::SimpleV2).await; let path = format!( "toolchains/nightly-{}/lib/rustlib/{}/lib/libstd.rlib", - &this_host_triple(), + &this_host_tuple(), CROSS_ARCH1 ); cx.config @@ -400,13 +400,13 @@ async fn add_remove_multiple_targets() { .is_ok(); let path = format!( "toolchains/nightly-{}/lib/rustlib/{}/lib/libstd.rlib", - &this_host_triple(), + &this_host_tuple(), CROSS_ARCH1 ); assert!(cx.config.rustupdir.has(path)); let path = format!( "toolchains/nightly-{}/lib/rustlib/{}/lib/libstd.rlib", - &this_host_triple(), + &this_host_tuple(), CROSS_ARCH2 ); assert!(cx.config.rustupdir.has(path)); @@ -417,13 +417,13 @@ async fn add_remove_multiple_targets() { .is_ok(); let path = format!( "toolchains/nightly-{}/lib/rustlib/{}/lib/libstd.rlib", - &this_host_triple(), + &this_host_tuple(), CROSS_ARCH1 ); assert!(!cx.config.rustupdir.has(path)); let path = format!( "toolchains/nightly-{}/lib/rustlib/{}/lib/libstd.rlib", - &this_host_triple(), + &this_host_tuple(), CROSS_ARCH2 ); assert!(!cx.config.rustupdir.has(path)); @@ -459,7 +459,7 @@ async fn list_installed_targets() { .expect(["rustup", "target", "list", "--installed"]) .await .with_stdout(snapbox::str![[r#" -[HOST_TRIPLE] +[HOST_TUPLE] "#]]) .is_ok(); @@ -470,7 +470,7 @@ async fn add_target_explicit() { let cx = CliTestContext::new(Scenario::SimpleV2).await; let path = format!( "toolchains/nightly-{}/lib/rustlib/{}/lib/libstd.rlib", - &this_host_triple(), + &this_host_tuple(), CROSS_ARCH1 ); cx.config @@ -496,7 +496,7 @@ async fn remove_target_explicit() { let cx = CliTestContext::new(Scenario::SimpleV2).await; let path = format!( "toolchains/nightly-{}/lib/rustlib/{}/lib/libstd.rlib", - &this_host_triple(), + &this_host_tuple(), CROSS_ARCH1 ); cx.config @@ -731,7 +731,7 @@ async fn show_toolchain_none() { .await .extend_redactions([("[RUSTUP_DIR]", &cx.config.rustupdir.to_string())]) .with_stdout(snapbox::str![[r#" -Default host: [HOST_TRIPLE] +Default host: [HOST_TUPLE] rustup home: [RUSTUP_DIR] installed toolchains @@ -758,19 +758,19 @@ async fn show_toolchain_default() { .await .extend_redactions([("[RUSTUP_DIR]", &cx.config.rustupdir.to_string())]) .with_stdout(snapbox::str![[r#" -Default host: [HOST_TRIPLE] +Default host: [HOST_TUPLE] rustup home: [RUSTUP_DIR] installed toolchains -------------------- -nightly-[HOST_TRIPLE] (active, default) +nightly-[HOST_TUPLE] (active, default) active toolchain ---------------- -name: nightly-[HOST_TRIPLE] +name: nightly-[HOST_TUPLE] active because: it's the default toolchain installed targets: - [HOST_TRIPLE] + [HOST_TUPLE] "#]]) .with_stderr(snapbox::str![[""]]) @@ -795,7 +795,7 @@ async fn show_no_default() { ... installed toolchains -------------------- -nightly-[HOST_TRIPLE] +nightly-[HOST_TUPLE] active toolchain ---------------- @@ -823,14 +823,14 @@ async fn show_no_default_active() { ... installed toolchains -------------------- -nightly-[HOST_TRIPLE] (active) +nightly-[HOST_TUPLE] (active) active toolchain ---------------- -name: nightly-[HOST_TRIPLE] +name: nightly-[HOST_TUPLE] active because: overridden by +toolchain on the command line installed targets: - [HOST_TRIPLE] + [HOST_TUPLE] "#]]) .is_ok(); @@ -852,20 +852,20 @@ async fn show_multiple_toolchains() { .await .extend_redactions([("[RUSTUP_DIR]", &cx.config.rustupdir.to_string())]) .with_stdout(snapbox::str![[r#" -Default host: [HOST_TRIPLE] +Default host: [HOST_TUPLE] rustup home: [RUSTUP_DIR] installed toolchains -------------------- -stable-[HOST_TRIPLE] -nightly-[HOST_TRIPLE] (active, default) +stable-[HOST_TUPLE] +nightly-[HOST_TUPLE] (active, default) active toolchain ---------------- -name: nightly-[HOST_TRIPLE] +name: nightly-[HOST_TUPLE] active because: it's the default toolchain installed targets: - [HOST_TRIPLE] + [HOST_TUPLE] "#]]) .with_stderr(snapbox::str![[""]]) @@ -893,7 +893,7 @@ async fn show_multiple_targets() { .await .extend_redactions([("[RUSTUP_DIR]", &cx.config.rustupdir.to_string())]) .with_stdout(snapbox::str![[r#" -Default host: [HOST_TRIPLE] +Default host: [HOST_TUPLE] rustup home: [RUSTUP_DIR] installed toolchains @@ -947,7 +947,7 @@ async fn show_multiple_toolchains_and_targets() { .await .extend_redactions([("[RUSTUP_DIR]", &cx.config.rustupdir.to_string())]) .with_stdout(snapbox::str![[r#" -Default host: [HOST_TRIPLE] +Default host: [HOST_TUPLE] rustup home: [RUSTUP_DIR] installed toolchains @@ -979,7 +979,7 @@ async fn list_default_toolchain() { .expect(["rustup", "toolchain", "list"]) .await .with_stdout(snapbox::str![[r#" -nightly-[HOST_TRIPLE] (active, default) +nightly-[HOST_TUPLE] (active, default) "#]]) .with_stderr(snapbox::str![[""]]) @@ -997,7 +997,7 @@ async fn list_default_toolchain_quiet() { .expect(["rustup", "toolchain", "list", "--quiet"]) .await .with_stdout(snapbox::str![[r#" -nightly-[HOST_TRIPLE] +nightly-[HOST_TUPLE] "#]]) .with_stderr(snapbox::str![[""]]) @@ -1019,7 +1019,7 @@ async fn list_no_default_toolchain() { .expect(["rustup", "toolchain", "list"]) .await .with_stdout(snapbox::str![[r#" -nightly-[HOST_TRIPLE] +nightly-[HOST_TUPLE] "#]]) .with_stderr(snapbox::str![[""]]) @@ -1037,7 +1037,7 @@ async fn list_no_default_override_toolchain() { .expect(["rustup", "toolchain", "list"]) .await .with_stdout(snapbox::str![[r#" -nightly-[HOST_TRIPLE] (active) +nightly-[HOST_TUPLE] (active) "#]]) .with_stderr(snapbox::str![[""]]) @@ -1060,7 +1060,7 @@ async fn list_default_and_override_toolchain() { .await .is_ok() .with_stdout(snapbox::str![[r#" -nightly-[HOST_TRIPLE] (active, default) +nightly-[HOST_TUPLE] (active, default) "#]]) .with_stderr(snapbox::str![[""]]); @@ -1078,19 +1078,19 @@ async fn show_toolchain_override() { .await .extend_redactions([("[RUSTUP_DIR]", &cx.config.rustupdir.to_string())]) .with_stdout(snapbox::str![[r#" -Default host: [HOST_TRIPLE] +Default host: [HOST_TUPLE] rustup home: [RUSTUP_DIR] installed toolchains -------------------- -nightly-[HOST_TRIPLE] (active) +nightly-[HOST_TUPLE] (active) active toolchain ---------------- -name: nightly-[HOST_TRIPLE] +name: nightly-[HOST_TUPLE] active because: directory override for '[..]' installed targets: - [HOST_TRIPLE] + [HOST_TUPLE] "#]]) .with_stderr(snapbox::str![[""]]) @@ -1119,20 +1119,20 @@ async fn show_toolchain_toolchain_file_override() { .await .extend_redactions([("[RUSTUP_DIR]", &cx.config.rustupdir.to_string())]) .with_stdout(snapbox::str![[r#" -Default host: [HOST_TRIPLE] +Default host: [HOST_TUPLE] rustup home: [RUSTUP_DIR] installed toolchains -------------------- -stable-[HOST_TRIPLE] (default) -nightly-[HOST_TRIPLE] (active) +stable-[HOST_TUPLE] (default) +nightly-[HOST_TUPLE] (active) active toolchain ---------------- -name: nightly-[HOST_TRIPLE] +name: nightly-[HOST_TUPLE] active because: overridden by '[..]' installed targets: - [HOST_TRIPLE] + [HOST_TUPLE] "#]]) .with_stderr(snapbox::str![[""]]) @@ -1169,21 +1169,21 @@ async fn show_toolchain_version_nested_file_override() { .await .extend_redactions([("[RUSTUP_DIR]", &cx.config.rustupdir.to_string())]) .with_stdout(snapbox::str![[r#" -Default host: [HOST_TRIPLE] +Default host: [HOST_TUPLE] rustup home: [RUSTUP_DIR] installed toolchains -------------------- -stable-[HOST_TRIPLE] (default) -beta-[HOST_TRIPLE] -nightly-[HOST_TRIPLE] (active) +stable-[HOST_TUPLE] (default) +beta-[HOST_TUPLE] +nightly-[HOST_TUPLE] (active) active toolchain ---------------- -name: nightly-[HOST_TRIPLE] +name: nightly-[HOST_TUPLE] active because: overridden by '[..]' installed targets: - [HOST_TRIPLE] + [HOST_TUPLE] "#]]) .with_stderr(snapbox::str![[""]]) @@ -1213,13 +1213,13 @@ async fn show_toolchain_toolchain_file_override_not_installed() { ("[TOOLCHAIN_FILE]", &toolchain_file), ]) .with_stdout(snapbox::str![[r#" -Default host: [HOST_TRIPLE] +Default host: [HOST_TUPLE] rustup home: [RUSTUP_DIR] "#]]) .with_stderr(snapbox::str![[r#" -error: toolchain 'nightly-[HOST_TRIPLE]' is not installed +error: toolchain 'nightly-[HOST_TUPLE]' is not installed help: run `rustup toolchain install` to install it "#]]) @@ -1242,7 +1242,7 @@ async fn show_toolchain_override_not_installed() { .await .extend_redactions([("[RUSTUP_DIR]", &cx.config.rustupdir.to_string())]) .with_stdout(snapbox::str![[r#" -Default host: [HOST_TRIPLE] +Default host: [HOST_TUPLE] rustup home: [RUSTUP_DIR] installed toolchains @@ -1250,10 +1250,10 @@ installed toolchains active toolchain ---------------- -name: nightly-[HOST_TRIPLE] +name: nightly-[HOST_TUPLE] active because: directory override for '[..]' installed targets: - [HOST_TRIPLE] + [HOST_TUPLE] "#]]) .is_ok(); @@ -1262,10 +1262,10 @@ installed targets: .await .is_ok() .with_stdout(snapbox::str![[r#" -cargo-[HOST_TRIPLE] -rust-docs-[HOST_TRIPLE] -rust-std-[HOST_TRIPLE] -rustc-[HOST_TRIPLE] +cargo-[HOST_TUPLE] +rust-docs-[HOST_TUPLE] +rust-std-[HOST_TUPLE] +rustc-[HOST_TUPLE] "#]]); } @@ -1294,7 +1294,7 @@ async fn override_set_unset_with_path() { .await .extend_redactions([("[CWD]", cwd_str.to_string())]) .with_stdout(snapbox::str![[r#" -[CWD] nightly-[HOST_TRIPLE] +[CWD] nightly-[HOST_TUPLE] "#]]) .with_stderr(snapbox::str![[""]]) @@ -1332,19 +1332,19 @@ async fn show_toolchain_env() { .extend_redactions([("[RUSTUP_DIR]", &cx.config.rustupdir.to_string())]) .is_ok() .with_stdout(snapbox::str![[r#" -Default host: [HOST_TRIPLE] +Default host: [HOST_TUPLE] rustup home: [RUSTUP_DIR] installed toolchains -------------------- -nightly-[HOST_TRIPLE] (active, default) +nightly-[HOST_TUPLE] (active, default) active toolchain ---------------- -name: nightly-[HOST_TRIPLE] +name: nightly-[HOST_TUPLE] active because: overridden by environment variable RUSTUP_TOOLCHAIN installed targets: - [HOST_TRIPLE] + [HOST_TUPLE] "#]]); } @@ -1358,7 +1358,7 @@ async fn show_toolchain_env_not_installed() { .extend_redactions([("[RUSTUP_DIR]", &cx.config.rustupdir.to_string())]) .is_ok() .with_stdout(snapbox::str![[r#" -Default host: [HOST_TRIPLE] +Default host: [HOST_TUPLE] rustup home: [RUSTUP_DIR] installed toolchains @@ -1366,10 +1366,10 @@ installed toolchains active toolchain ---------------- -name: nightly-[HOST_TRIPLE] +name: nightly-[HOST_TUPLE] active because: overridden by environment variable RUSTUP_TOOLCHAIN installed targets: - [HOST_TRIPLE] + [HOST_TUPLE] "#]]); } @@ -1385,7 +1385,7 @@ async fn show_active_toolchain() { .expect(&["rustup", "show", "active-toolchain"]) .await .with_stdout(snapbox::str![[r#" -nightly-[HOST_TRIPLE] (default) +nightly-[HOST_TUPLE] (default) "#]]) .with_stderr(snapbox::str![[""]]) @@ -1415,27 +1415,27 @@ async fn show_with_verbose() { .await .extend_redactions([("[RUSTUP_DIR]", &cx.config.rustupdir.to_string())]) .with_stdout(snapbox::str![[r#" -Default host: [HOST_TRIPLE] +Default host: [HOST_TUPLE] rustup home: [RUSTUP_DIR] installed toolchains -------------------- -nightly-[HOST_TRIPLE] (active, default) +nightly-[HOST_TUPLE] (active, default) 1.3.0 (hash-nightly-2) - path: [RUSTUP_DIR]/toolchains/nightly-[HOST_TRIPLE] + path: [RUSTUP_DIR]/toolchains/nightly-[HOST_TUPLE] -nightly-2015-01-01-[HOST_TRIPLE] +nightly-2015-01-01-[HOST_TUPLE] 1.2.0 (hash-nightly-1) - path: [RUSTUP_DIR]/toolchains/nightly-2015-01-01-[HOST_TRIPLE] + path: [RUSTUP_DIR]/toolchains/nightly-2015-01-01-[HOST_TUPLE] active toolchain ---------------- -name: nightly-[HOST_TRIPLE] +name: nightly-[HOST_TUPLE] active because: it's the default toolchain compiler: 1.3.0 (hash-nightly-2) -path: [RUSTUP_DIR]/toolchains/nightly-[HOST_TRIPLE] +path: [RUSTUP_DIR]/toolchains/nightly-[HOST_TUPLE] installed targets: - [HOST_TRIPLE] + [HOST_TUPLE] "#]]) .with_stderr(snapbox::str![[""]]) @@ -1454,10 +1454,10 @@ async fn show_active_toolchain_with_verbose() { .await .extend_redactions([("[RUSTUP_DIR]", &cx.config.rustupdir.to_string())]) .with_stdout(snapbox::str![[r#" -nightly-[HOST_TRIPLE] +nightly-[HOST_TUPLE] active because: it's the default toolchain compiler: 1.3.0 (hash-nightly-2) -path: [RUSTUP_DIR]/toolchains/nightly-[HOST_TRIPLE] +path: [RUSTUP_DIR]/toolchains/nightly-[HOST_TUPLE] "#]]) .with_stderr(snapbox::str![[""]]) @@ -1483,7 +1483,7 @@ async fn show_active_toolchain_with_override() { .expect(["rustup", "show", "active-toolchain"]) .await .with_stdout(snapbox::str![[r#" -stable-[HOST_TRIPLE] (directory override for '[..]') +stable-[HOST_TUPLE] (directory override for '[..]') "#]]) .is_ok(); @@ -1509,10 +1509,10 @@ async fn show_active_toolchain_with_override_verbose() { .await .extend_redactions([("[RUSTUP_DIR]", &cx.config.rustupdir.to_string())]) .with_stdout(snapbox::str![[r#" -stable-[HOST_TRIPLE] +stable-[HOST_TUPLE] active because: directory override for '[..]' compiler: 1.1.0 (hash-stable-1.1.0) -path: [RUSTUP_DIR]/toolchains/stable-[HOST_TRIPLE] +path: [RUSTUP_DIR]/toolchains/stable-[HOST_TUPLE] "#]]) .with_stderr(snapbox::str![[""]]) @@ -1581,7 +1581,7 @@ default async fn set_default_host() { let cx = CliTestContext::new(Scenario::None).await; cx.config - .expect(["rustup", "set", "default-host", &this_host_triple()]) + .expect(["rustup", "set", "default-host", &this_host_tuple()]) .await .is_ok(); cx.config @@ -1589,7 +1589,7 @@ async fn set_default_host() { .await .with_stdout(snapbox::str![[r#" ... -Default host: [HOST_TRIPLE] +Default host: [HOST_TUPLE] ... "#]]) .is_ok(); @@ -1597,13 +1597,13 @@ Default host: [HOST_TRIPLE] // #846 #[tokio::test] -async fn set_default_host_invalid_triple() { +async fn set_default_host_invalid_tuple() { let cx = CliTestContext::new(Scenario::None).await; cx.config .expect(["rustup", "set", "default-host", "foo"]) .await .with_stderr(snapbox::str![[r#" -error: Provided host 'foo' couldn't be converted to partial triple +error: Provided host 'foo' couldn't be converted to partial tuple "#]]) .is_err(); @@ -1611,7 +1611,7 @@ error: Provided host 'foo' couldn't be converted to partial triple // #745 #[tokio::test] -async fn set_default_host_invalid_triple_valid_partial() { +async fn set_default_host_invalid_tuple_valid_partial() { let cx = CliTestContext::new(Scenario::None).await; cx.config .expect(["rustup", "set", "default-host", "x86_64-msvc"]) @@ -1647,7 +1647,7 @@ async fn update_doesnt_update_non_tracking_channels() { .is_ok() .without_stderr(&format!( "syncing channel updates for 'nightly-2015-01-01-{}'", - this_host_triple(), + this_host_tuple(), )); } @@ -1706,11 +1706,11 @@ channel = "nightly" .await .extend_redactions([("[TOOLCHAIN_FILE]", &toolchain_file)]) .with_stderr(snapbox::str![[r#" -info: syncing channel updates for nightly-[HOST_TRIPLE] +info: syncing channel updates for nightly-[HOST_TUPLE] 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 +info: the active toolchain `nightly-[HOST_TUPLE]` has been installed info: it's active because: overridden by '[TOOLCHAIN_FILE]' "#]]) @@ -1720,7 +1720,7 @@ info: it's active because: overridden by '[TOOLCHAIN_FILE]' .await .is_ok() .with_stdout(snapbox::str![[r#" -rustc-[HOST_TRIPLE] +rustc-[HOST_TUPLE] "#]]); @@ -1729,8 +1729,8 @@ rustc-[HOST_TRIPLE] .await .extend_redactions([("[TOOLCHAIN_FILE]", &toolchain_file)]) .with_stderr(snapbox::str![[r#" -info: using existing install for nightly-[HOST_TRIPLE] -info: the active toolchain `nightly-[HOST_TRIPLE]` has been installed +info: using existing install for nightly-[HOST_TUPLE] +info: the active toolchain `nightly-[HOST_TUPLE]` has been installed info: it's active because: overridden by '[TOOLCHAIN_FILE]' "#]]) @@ -1755,7 +1755,7 @@ async fn toolchain_install_no_change_with_no_update() { .await .with_stdout(snapbox::str![[r#" - stable-[HOST_TRIPLE] unchanged - 1.0.0 (hash-stable-1.0.0) + stable-[HOST_TUPLE] unchanged - 1.0.0 (hash-stable-1.0.0) "#]]) @@ -1866,13 +1866,13 @@ async fn add_component() { .is_ok(); let path = format!( "toolchains/stable-{}/lib/rustlib/src/rust-src/foo.rs", - this_host_triple() + this_host_tuple() ); assert!(cx.config.rustupdir.has(path)); } #[tokio::test] -async fn add_component_by_target_triple() { +async fn add_component_by_target_tuple() { let cx = CliTestContext::new(Scenario::SimpleV2).await; cx.config .expect(["rustup", "default", "stable"]) @@ -1889,13 +1889,13 @@ async fn add_component_by_target_triple() { .is_ok(); let path = format!( "toolchains/stable-{}/lib/rustlib/{CROSS_ARCH1}/lib/libstd.rlib", - this_host_triple() + this_host_tuple() ); assert!(cx.config.rustupdir.has(path)); } #[tokio::test] -async fn add_component_by_target_triple_renamed_from() { +async fn add_component_by_target_tuple_renamed_from() { let cx = CliTestContext::new(Scenario::SimpleV2).await; cx.config .expect(["rustup", "default", "nightly"]) @@ -1906,7 +1906,7 @@ async fn add_component_by_target_triple_renamed_from() { "rustup", "component", "add", - &format!("rls-{}", this_host_triple()), + &format!("rls-{}", this_host_tuple()), ]) .await .is_ok(); @@ -1915,14 +1915,14 @@ async fn add_component_by_target_triple_renamed_from() { .await .with_stdout(snapbox::str![[r#" ... -rls-[HOST_TRIPLE] +rls-[HOST_TUPLE] ... "#]]) .is_ok(); } #[tokio::test] -async fn add_component_by_target_triple_renamed_to() { +async fn add_component_by_target_tuple_renamed_to() { let cx = CliTestContext::new(Scenario::SimpleV2).await; cx.config .expect(["rustup", "default", "nightly"]) @@ -1933,7 +1933,7 @@ async fn add_component_by_target_triple_renamed_to() { "rustup", "component", "add", - &format!("rls-preview-{}", this_host_triple()), + &format!("rls-preview-{}", this_host_tuple()), ]) .await .is_ok(); @@ -1942,7 +1942,7 @@ async fn add_component_by_target_triple_renamed_to() { .await .with_stdout(snapbox::str![[r#" ... -rls-[HOST_TRIPLE] +rls-[HOST_TUPLE] ... "#]]) .is_ok(); @@ -1964,7 +1964,7 @@ async fn fail_invalid_component_name() { ]) .await .with_stderr(snapbox::str![[r#" -error: toolchain 'stable-[HOST_TRIPLE]' does not contain component 'dummy-[CROSS_ARCH_I]' for target '[HOST_TRIPLE]' +error: toolchain 'stable-[HOST_TUPLE]' does not contain component 'dummy-[CROSS_ARCH_I]' for target '[HOST_TUPLE]' "#]]) .is_err(); @@ -1986,7 +1986,7 @@ async fn fail_invalid_component_target() { .await .with_stderr(snapbox::str![[r#" ... -error: toolchain 'stable-[HOST_TRIPLE]' does not contain component 'rust-std-invalid-target' for target '[HOST_TRIPLE]' +error: toolchain 'stable-[HOST_TUPLE]' does not contain component 'rust-std-invalid-target' for target '[HOST_TUPLE]' ... "#]]) .is_err(); @@ -2005,7 +2005,7 @@ async fn remove_component() { .is_ok(); let path = PathBuf::from(format!( "toolchains/stable-{}/lib/rustlib/src/rust-src/foo.rs", - this_host_triple(), + this_host_tuple(), )); assert!(cx.config.rustupdir.has(&path)); cx.config @@ -2016,24 +2016,24 @@ async fn remove_component() { } #[tokio::test] -async fn remove_component_by_target_triple() { - let component_with_triple = format!("rust-std-{CROSS_ARCH1}"); +async fn remove_component_by_target_tuple() { + let component_with_tuple = format!("rust-std-{CROSS_ARCH1}"); let cx = CliTestContext::new(Scenario::SimpleV2).await; cx.config .expect(&["rustup", "default", "stable"]) .await .is_ok(); cx.config - .expect(&["rustup", "component", "add", &component_with_triple]) + .expect(&["rustup", "component", "add", &component_with_tuple]) .await .is_ok(); let path = PathBuf::from(format!( "toolchains/stable-{}/lib/rustlib/{CROSS_ARCH1}/lib/libstd.rlib", - this_host_triple() + this_host_tuple() )); assert!(cx.config.rustupdir.has(&path)); cx.config - .expect(&["rustup", "component", "remove", &component_with_triple]) + .expect(&["rustup", "component", "remove", &component_with_tuple]) .await .is_ok(); assert!(!cx.config.rustupdir.has(path.parent().unwrap())); @@ -2043,12 +2043,12 @@ async fn remove_component_by_target_triple() { async fn add_remove_multiple_components() { let files = [ "lib/rustlib/src/rust-src/foo.rs".to_owned(), - format!("lib/rustlib/{}/analysis/libfoo.json", this_host_triple()), + format!("lib/rustlib/{}/analysis/libfoo.json", this_host_tuple()), format!("lib/rustlib/{CROSS_ARCH1}/lib/libstd.rlib"), format!("lib/rustlib/{CROSS_ARCH2}/lib/libstd.rlib"), ]; - let component_with_triple1 = format!("rust-std-{CROSS_ARCH1}"); - let component_with_triple2 = format!("rust-std-{CROSS_ARCH2}"); + let component_with_tuple1 = format!("rust-std-{CROSS_ARCH1}"); + let component_with_tuple2 = format!("rust-std-{CROSS_ARCH2}"); let cx = CliTestContext::new(Scenario::SimpleV2).await; cx.config @@ -2062,13 +2062,13 @@ async fn add_remove_multiple_components() { "add", "rust-src", "rust-analysis", - &component_with_triple1, - &component_with_triple2, + &component_with_tuple1, + &component_with_tuple2, ]) .await .is_ok(); for file in &files { - let path = format!("toolchains/nightly-{}/{}", this_host_triple(), file); + let path = format!("toolchains/nightly-{}/{}", this_host_tuple(), file); assert!(cx.config.rustupdir.has(&path)); } cx.config @@ -2078,17 +2078,13 @@ async fn add_remove_multiple_components() { "remove", "rust-src", "rust-analysis", - &component_with_triple1, - &component_with_triple2, + &component_with_tuple1, + &component_with_tuple2, ]) .await .is_ok(); for file in &files { - let path = PathBuf::from(format!( - "toolchains/nightly-{}/{}", - this_host_triple(), - file - )); + let path = PathBuf::from(format!("toolchains/nightly-{}/{}", this_host_tuple(), file)); assert!(!cx.config.rustupdir.has(path.parent().unwrap())); } } @@ -2144,7 +2140,7 @@ async fn env_override_path() { .config .rustupdir .join("toolchains") - .join(format!("nightly-{}", this_host_triple())); + .join(format!("nightly-{}", this_host_tuple())); cx.config .expect_with_env( @@ -2174,7 +2170,7 @@ async fn plus_override_relpath_is_not_supported() { let toolchain_path = Path::new("..") .join(cx.config.rustupdir.rustupdir.file_name().unwrap()) .join("toolchains") - .join(format!("nightly-{}", this_host_triple())); + .join(format!("nightly-{}", this_host_tuple())); cx.config .expect([ "rustc", @@ -2183,7 +2179,7 @@ async fn plus_override_relpath_is_not_supported() { ]) .await .with_stderr(snapbox::str![[r#" -error: relative path toolchain '[..]/toolchains/nightly-[HOST_TRIPLE]' +error: relative path toolchain '[..]/toolchains/nightly-[HOST_TUPLE]' "#]]) .is_err(); @@ -2204,7 +2200,7 @@ async fn run_with_relpath_is_not_supported() { let toolchain_path = Path::new("..") .join(cx.config.rustupdir.rustupdir.file_name().unwrap()) .join("toolchains") - .join(format!("nightly-{}", this_host_triple())); + .join(format!("nightly-{}", this_host_tuple())); cx.config .expect([ "rustup", @@ -2216,7 +2212,7 @@ async fn run_with_relpath_is_not_supported() { .await .with_stderr(snapbox::str![[r#" ... -error:[..] relative path toolchain '[..]/toolchains/nightly-[HOST_TRIPLE]' +error:[..] relative path toolchain '[..]/toolchains/nightly-[HOST_TUPLE]' ... "#]]) .is_err(); @@ -2257,7 +2253,7 @@ async fn plus_override_abspath_is_supported() { .config .rustupdir .join("toolchains") - .join(format!("nightly-{}", this_host_triple())) + .join(format!("nightly-{}", this_host_tuple())) .canonicalize() .unwrap(); cx.config @@ -2286,7 +2282,7 @@ async fn run_with_abspath_is_supported() { .config .rustupdir .join("toolchains") - .join(format!("nightly-{}", this_host_triple())) + .join(format!("nightly-{}", this_host_tuple())) .canonicalize() .unwrap(); cx.config @@ -2317,7 +2313,7 @@ async fn file_override_path() { .config .rustupdir .join("toolchains") - .join(format!("nightly-{}", this_host_triple())); + .join(format!("nightly-{}", this_host_tuple())); let toolchain_file = cx.config.current_dir().join("rust-toolchain.toml"); raw::write_file( &toolchain_file, @@ -2339,7 +2335,7 @@ async fn file_override_path() { .expect(["rustup", "show", "active-toolchain"]) .await .with_stdout(snapbox::str![[r#" -[..]/toolchains/nightly-[HOST_TRIPLE] (overridden by '[..]/rust-toolchain.toml') +[..]/toolchains/nightly-[HOST_TUPLE] (overridden by '[..]/rust-toolchain.toml') "#]]) .is_ok(); @@ -2361,7 +2357,7 @@ async fn proxy_override_path() { .config .rustupdir .join("toolchains") - .join(format!("nightly-{}", this_host_triple())); + .join(format!("nightly-{}", this_host_tuple())); let toolchain_file = cx.config.current_dir().join("rust-toolchain.toml"); raw::write_file( &toolchain_file, @@ -2395,7 +2391,7 @@ async fn file_override_path_relative_not_supported() { .config .rustupdir .join("toolchains") - .join(format!("nightly-{}", this_host_triple())); + .join(format!("nightly-{}", this_host_tuple())); let toolchain_file = cx.config.current_dir().join("rust-toolchain.toml"); // Find shared prefix so we can determine a relative path @@ -2435,7 +2431,7 @@ async fn file_override_path_relative_not_supported() { .expect(["rustc", "--version"]) .await .with_stderr(snapbox::str![[r#" -error: relative path toolchain '[..]/toolchains/nightly-[HOST_TRIPLE]' +error: relative path toolchain '[..]/toolchains/nightly-[HOST_TUPLE]' "#]]) .is_err(); @@ -2835,10 +2831,10 @@ async fn file_override_toml_format_specify_profile() { cx.config .expect(&["rustup", "component", "list"]) .await - // The `rust-docs-[HOST_TRIPLE]` component is installed. + // The `rust-docs-[HOST_TUPLE]` component is installed. .with_stdout(snapbox::str![[r#" ... -rust-docs-[HOST_TRIPLE] (installed) +rust-docs-[HOST_TUPLE] (installed) ... "#]]) .is_ok(); @@ -2861,10 +2857,10 @@ channel = "nightly" cx.config .expect(&["rustup", "component", "list"]) .await - // The `rust-docs-[HOST_TRIPLE]` component is not installed. + // The `rust-docs-[HOST_TUPLE]` component is not installed. .with_stdout(snapbox::str![[r#" ... -rust-docs-[HOST_TRIPLE] +rust-docs-[HOST_TUPLE] ... "#]]) .is_ok(); @@ -2901,7 +2897,7 @@ channel = "nightly" .await .with_stdout(snapbox::str![[r#" ... -rust-docs-[HOST_TRIPLE] +rust-docs-[HOST_TUPLE] ... "#]]) .is_ok(); @@ -2959,7 +2955,7 @@ async fn close_file_override_beats_far_directory_override() { #[tokio::test] async fn override_order() { let cx = CliTestContext::new(Scenario::ArchivesV2).await; - let host = this_host_triple(); + let host = this_host_tuple(); // give each override type a different toolchain let default_tc = &format!("beta-2015-01-01-{host}"); let env_tc = &format!("stable-2015-01-01-{host}"); @@ -3378,7 +3374,7 @@ async fn valid_override_settings() { .expect(&["rustup", "default", "nightly"]) .await .is_ok(); - let nightly_with_host = format!("nightly-{}", this_host_triple()); + let nightly_with_host = format!("nightly-{}", this_host_tuple()); raw::write_file(&toolchain_file, "nightly").unwrap(); cx.config.expect(&["rustc", "--version"]).await.is_ok(); // Special case: same version as is installed is permitted. @@ -3416,7 +3412,7 @@ async fn file_override_with_target_info() { cx.config .expect(["rustc", "--version"]) .await - .remove_redactions(["[HOST_TRIPLE]"]) + .remove_redactions(["[HOST_TUPLE]"]) .with_stderr(snapbox::str![[r#" ... error: target tuple in channel name 'nightly-x86_64-unknown-linux-gnu' @@ -3441,7 +3437,7 @@ async fn docs_with_path() { .expect(["rustup", "doc", "--path"]) .await .with_stdout(snapbox::str![[r#" -[..]/toolchains/stable-[HOST_TRIPLE]/share/doc/rust/html/index.html +[..]/toolchains/stable-[HOST_TUPLE]/share/doc/rust/html/index.html "#]]) .is_ok(); @@ -3450,7 +3446,7 @@ async fn docs_with_path() { .expect(["rustup", "doc", "--path", "--toolchain", "nightly"]) .await .with_stdout(snapbox::str![[r#" -[..]/toolchains/nightly-[HOST_TRIPLE]/share/doc/rust/html/index.html +[..]/toolchains/nightly-[HOST_TUPLE]/share/doc/rust/html/index.html "#]]) .is_ok(); @@ -3477,7 +3473,7 @@ async fn docs_topical_with_path() { .extend_redactions([("[PATH]", path)]) .is_ok() .with_stdout(snapbox::str![[r#" -[..]/toolchains/stable-[HOST_TRIPLE]/[PATH] +[..]/toolchains/stable-[HOST_TUPLE]/[PATH] "#]]) .with_stderr(snapbox::str![""]); @@ -3499,8 +3495,8 @@ async fn docs_missing() { .expect(["rustup", "doc"]) .await .with_stderr(snapbox::str![[r#" -info: `rust-docs` not installed in toolchain `nightly-[HOST_TRIPLE]` -help: run `rustup component add --toolchain nightly-[HOST_TRIPLE] rust-docs` to install it +info: `rust-docs` not installed in toolchain `nightly-[HOST_TUPLE]` +help: run `rustup component add --toolchain nightly-[HOST_TUPLE] rust-docs` to install it error: unable to view documentation which is not installed "#]]) @@ -3655,7 +3651,7 @@ async fn check_host_goes_away() { .await .with_stderr(snapbox::str![[r#" ... -error: target '[HOST_TRIPLE]' not found in channel[..] +error: target '[HOST_TUPLE]' not found in channel[..] ... "#]]) .is_err(); @@ -3680,7 +3676,7 @@ error: no default toolchain is configured let mock_settings_file = cx.config.current_dir().join("mock_fallback_settings.toml"); raw::write_file( &mock_settings_file, - &format!("default_toolchain = 'nightly-{}'", this_host_triple()), + &format!("default_toolchain = 'nightly-{}'", this_host_tuple()), ) .unwrap(); @@ -3694,7 +3690,7 @@ error: no default toolchain is configured ) .await .with_stdout(snapbox::str![[r#" -nightly-[HOST_TRIPLE] (default) +nightly-[HOST_TUPLE] (default) "#]]) .is_ok(); @@ -3737,13 +3733,13 @@ note: add the `--force-non-host` flag to install the toolchain anyway #[tokio::test] async fn dont_warn_on_partial_build() { let cx = CliTestContext::new(Scenario::SimpleV2).await; - let arch = this_host_triple().split_once('-').unwrap().0.to_owned(); + let arch = this_host_tuple().split_once('-').unwrap().0.to_owned(); cx.config .expect(["rustup", "toolchain", "install", &format!("nightly-{arch}")]) .await .with_stderr(snapbox::str![[r#" ... -info: syncing channel updates for nightly-[HOST_TRIPLE] +info: syncing channel updates for nightly-[HOST_TUPLE] ... "#]]) .is_ok() @@ -3844,11 +3840,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: syncing channel updates for nightly-[HOST_TUPLE] 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_TUPLE] "#]]) .is_ok(); @@ -3857,15 +3853,15 @@ info: default toolchain set to nightly-[HOST_TRIPLE] .await .is_ok() .with_stdout(snapbox::str![[r#" -cargo-[HOST_TRIPLE] -rustc-[HOST_TRIPLE] +cargo-[HOST_TUPLE] +rustc-[HOST_TUPLE] "#]]); // link the toolchain let toolchains = cx.config.rustupdir.join("toolchains"); raw::symlink_dir( - &toolchains.join(format!("nightly-{}", this_host_triple())), + &toolchains.join(format!("nightly-{}", this_host_tuple())), &toolchains.join("my-custom"), ) .expect("failed to symlink"); @@ -3923,7 +3919,7 @@ async fn show_custom_toolchain() { .config .rustupdir .join("toolchains") - .join(format!("stable-{}", this_host_triple())); + .join(format!("stable-{}", this_host_tuple())); cx.config .expect([ "rustup", @@ -3939,12 +3935,12 @@ async fn show_custom_toolchain() { .await .extend_redactions([("[RUSTUP_DIR]", cx.config.rustupdir.to_string())]) .with_stdout(snapbox::str![[r#" -Default host: [HOST_TRIPLE] +Default host: [HOST_TUPLE] rustup home: [RUSTUP_DIR] installed toolchains -------------------- -stable-[HOST_TRIPLE] (default) +stable-[HOST_TUPLE] (default) stuff (active) active toolchain @@ -3952,7 +3948,7 @@ active toolchain name: stuff active because: overridden by +toolchain on the command line installed targets: - [HOST_TRIPLE] + [HOST_TUPLE] "#]]) .with_stderr(snapbox::str![[""]]) @@ -3970,7 +3966,7 @@ async fn show_custom_toolchain_without_components_file() { .config .rustupdir .join("toolchains") - .join(format!("stable-{}", this_host_triple())); + .join(format!("stable-{}", this_host_tuple())); cx.config .expect([ "rustup", @@ -3989,12 +3985,12 @@ async fn show_custom_toolchain_without_components_file() { .await .extend_redactions([("[RUSTUP_DIR]", cx.config.rustupdir.to_string())]) .with_stdout(snapbox::str![[r#" -Default host: [HOST_TRIPLE] +Default host: [HOST_TUPLE] rustup home: [RUSTUP_DIR] installed toolchains -------------------- -stable-[HOST_TRIPLE] (default) +stable-[HOST_TUPLE] (default) stuff (active) active toolchain diff --git a/tests/suite/cli_rustup_init_ui/rustup_init_help_flag.stdout.term.svg b/tests/suite/cli_rustup_init_ui/rustup_init_help_flag.stdout.term.svg index a239c6c51b..1758f3b3ee 100644 --- a/tests/suite/cli_rustup_init_ui/rustup_init_help_flag.stdout.term.svg +++ b/tests/suite/cli_rustup_init_ui/rustup_init_help_flag.stdout.term.svg @@ -48,7 +48,7 @@ --default-host <DEFAULT_HOST> - Choose a default host triple + Choose a default host tuple --default-toolchain <DEFAULT_TOOLCHAIN> diff --git a/tests/suite/cli_rustup_init_ui/rustup_init_sh_help_flag.stdout.term.svg b/tests/suite/cli_rustup_init_ui/rustup_init_sh_help_flag.stdout.term.svg index c99ac1ee69..8dd73229be 100644 --- a/tests/suite/cli_rustup_init_ui/rustup_init_sh_help_flag.stdout.term.svg +++ b/tests/suite/cli_rustup_init_ui/rustup_init_sh_help_flag.stdout.term.svg @@ -44,7 +44,7 @@ --default-host <DEFAULT_HOST> - Choose a default host triple + Choose a default host tuple --default-toolchain <DEFAULT_TOOLCHAIN> diff --git a/tests/suite/cli_rustup_ui/rustup_check_updates_none.stdout.term.svg b/tests/suite/cli_rustup_ui/rustup_check_updates_none.stdout.term.svg index 1e9b9229ef..b13876fdaf 100644 --- a/tests/suite/cli_rustup_ui/rustup_check_updates_none.stdout.term.svg +++ b/tests/suite/cli_rustup_ui/rustup_check_updates_none.stdout.term.svg @@ -18,11 +18,11 @@ - stable-[HOST_TRIPLE] - up to date: 1.1.0 (hash-stable-1.1.0) + stable-[HOST_TUPLE] - up to date: 1.1.0 (hash-stable-1.1.0) - beta-[HOST_TRIPLE] - up to date: 1.2.0 (hash-beta-1.2.0) + beta-[HOST_TUPLE] - up to date: 1.2.0 (hash-beta-1.2.0) - nightly-[HOST_TRIPLE] - up to date: 1.3.0 (hash-nightly-2) + nightly-[HOST_TUPLE] - up to date: 1.3.0 (hash-nightly-2) diff --git a/tests/suite/cli_rustup_ui/rustup_check_updates_some.stdout.term.svg b/tests/suite/cli_rustup_ui/rustup_check_updates_some.stdout.term.svg index 0bd67b78d0..33199f974f 100644 --- a/tests/suite/cli_rustup_ui/rustup_check_updates_some.stdout.term.svg +++ b/tests/suite/cli_rustup_ui/rustup_check_updates_some.stdout.term.svg @@ -18,11 +18,11 @@ - stable-[HOST_TRIPLE] - update available: 1.0.0 (hash-stable-1.0.0) -> 1.1.0 (hash-stable-1.1.0) + stable-[HOST_TUPLE] - update available: 1.0.0 (hash-stable-1.0.0) -> 1.1.0 (hash-stable-1.1.0) - beta-[HOST_TRIPLE] - update available: 1.1.0 (hash-beta-1.1.0) -> 1.2.0 (hash-beta-1.2.0) + beta-[HOST_TUPLE] - update available: 1.1.0 (hash-beta-1.1.0) -> 1.2.0 (hash-beta-1.2.0) - nightly-[HOST_TRIPLE] - update available: 1.2.0 (hash-nightly-1) -> 1.3.0 (hash-nightly-2) + nightly-[HOST_TUPLE] - update available: 1.2.0 (hash-nightly-1) -> 1.3.0 (hash-nightly-2) diff --git a/tests/suite/cli_rustup_ui/rustup_component_list.stdout.term.svg b/tests/suite/cli_rustup_ui/rustup_component_list.stdout.term.svg index 4d693f5507..990cbd77ca 100644 --- a/tests/suite/cli_rustup_ui/rustup_component_list.stdout.term.svg +++ b/tests/suite/cli_rustup_ui/rustup_component_list.stdout.term.svg @@ -18,17 +18,17 @@ - cargo-[HOST_TRIPLE] (installed) + cargo-[HOST_TUPLE] (installed) - rust-docs-[HOST_TRIPLE] (installed) + rust-docs-[HOST_TUPLE] (installed) - rust-std-[HOST_TRIPLE] (installed) + rust-std-[HOST_TUPLE] (installed) - rustc-[HOST_TRIPLE] (installed) + rustc-[HOST_TUPLE] (installed) - rls-[HOST_TRIPLE] + rls-[HOST_TUPLE] - rust-analysis-[HOST_TRIPLE] + rust-analysis-[HOST_TUPLE] rust-src diff --git a/tests/suite/cli_rustup_ui/rustup_default.stderr.term.svg b/tests/suite/cli_rustup_ui/rustup_default.stderr.term.svg index cf448a0598..dddf7c4828 100644 --- a/tests/suite/cli_rustup_ui/rustup_default.stderr.term.svg +++ b/tests/suite/cli_rustup_ui/rustup_default.stderr.term.svg @@ -17,13 +17,13 @@ - info: syncing channel updates for nightly-[HOST_TRIPLE] + info: syncing channel updates for nightly-[HOST_TUPLE] info: latest update on 2015-01-02 for version 1.3.0 (hash-nightly-2) info: downloading component(s) - info: default toolchain set to nightly-[HOST_TRIPLE] + info: default toolchain set to nightly-[HOST_TUPLE] diff --git a/tests/suite/cli_rustup_ui/rustup_default.stdout.term.svg b/tests/suite/cli_rustup_ui/rustup_default.stdout.term.svg index 0fd28b918f..733db103db 100644 --- a/tests/suite/cli_rustup_ui/rustup_default.stdout.term.svg +++ b/tests/suite/cli_rustup_ui/rustup_default.stdout.term.svg @@ -20,7 +20,7 @@ - nightly-[HOST_TRIPLE] installed - 1.3.0 (hash-nightly-2) + nightly-[HOST_TUPLE] installed - 1.3.0 (hash-nightly-2) diff --git a/tests/suite/cli_rustup_ui/rustup_set_cmd_default_host_cmd_help_flag.stdout.term.svg b/tests/suite/cli_rustup_ui/rustup_set_cmd_default_host_cmd_help_flag.stdout.term.svg index 099258a6e5..a63925ceb9 100644 --- a/tests/suite/cli_rustup_ui/rustup_set_cmd_default_host_cmd_help_flag.stdout.term.svg +++ b/tests/suite/cli_rustup_ui/rustup_set_cmd_default_host_cmd_help_flag.stdout.term.svg @@ -20,17 +20,17 @@ - The triple used to identify toolchains when not specified + The tuple used to identify toolchains when not specified - Usage: rustup[EXE] set default-host <HOST_TRIPLE> + Usage: rustup[EXE] set default-host <HOST_TUPLE> Arguments: - <HOST_TRIPLE> + <HOST_TUPLE> diff --git a/tests/suite/cli_rustup_ui/rustup_set_cmd_help_flag.stdout.term.svg b/tests/suite/cli_rustup_ui/rustup_set_cmd_help_flag.stdout.term.svg index 54cb5a7e5b..dbd73fe467 100644 --- a/tests/suite/cli_rustup_ui/rustup_set_cmd_help_flag.stdout.term.svg +++ b/tests/suite/cli_rustup_ui/rustup_set_cmd_help_flag.stdout.term.svg @@ -30,7 +30,7 @@ Commands: - default-host The triple used to identify toolchains when not specified + default-host The tuple used to identify toolchains when not specified profile The default components installed with a toolchain diff --git a/tests/suite/cli_rustup_ui/rustup_show_toolchain.stdout.term.svg b/tests/suite/cli_rustup_ui/rustup_show_toolchain.stdout.term.svg index 1dda66273f..4eb4d16fea 100644 --- a/tests/suite/cli_rustup_ui/rustup_show_toolchain.stdout.term.svg +++ b/tests/suite/cli_rustup_ui/rustup_show_toolchain.stdout.term.svg @@ -19,7 +19,7 @@ - Default host: [HOST_TRIPLE] + Default host: [HOST_TUPLE] rustup home: [RUSTUP_DIR] @@ -29,7 +29,7 @@ -------------------- - nightly-[HOST_TRIPLE] (active, default) + nightly-[HOST_TUPLE] (active, default) @@ -37,13 +37,13 @@ ---------------- - name: nightly-[HOST_TRIPLE] + name: nightly-[HOST_TUPLE] active because: it's the default toolchain installed targets: - [HOST_TRIPLE] + [HOST_TUPLE] diff --git a/tests/suite/cli_rustup_ui/rustup_toolchain_cmd_help_flag.stdout.term.svg b/tests/suite/cli_rustup_ui/rustup_toolchain_cmd_help_flag.stdout.term.svg index a3c2b5bc14..7c0d3b87c3 100644 --- a/tests/suite/cli_rustup_ui/rustup_toolchain_cmd_help_flag.stdout.term.svg +++ b/tests/suite/cli_rustup_ui/rustup_toolchain_cmd_help_flag.stdout.term.svg @@ -80,7 +80,7 @@ <date> = YYYY-MM-DD - <host> = <target-triple> + <host> = <target-tuple> diff --git a/tests/suite/cli_rustup_ui/rustup_toolchain_list.stdout.term.svg b/tests/suite/cli_rustup_ui/rustup_toolchain_list.stdout.term.svg index 47d2427515..b3456a1f4f 100644 --- a/tests/suite/cli_rustup_ui/rustup_toolchain_list.stdout.term.svg +++ b/tests/suite/cli_rustup_ui/rustup_toolchain_list.stdout.term.svg @@ -18,9 +18,9 @@ - beta-2015-01-01-[HOST_TRIPLE] + beta-2015-01-01-[HOST_TUPLE] - nightly-[HOST_TRIPLE] (active, default) + nightly-[HOST_TUPLE] (active, default) diff --git a/tests/suite/cli_rustup_ui/rustup_update_no_change.stderr.term.svg b/tests/suite/cli_rustup_ui/rustup_update_no_change.stderr.term.svg index 5ce55154fc..c9497f1a2f 100644 --- a/tests/suite/cli_rustup_ui/rustup_update_no_change.stderr.term.svg +++ b/tests/suite/cli_rustup_ui/rustup_update_no_change.stderr.term.svg @@ -17,7 +17,7 @@ - info: syncing channel updates for stable-[HOST_TRIPLE] + info: syncing channel updates for stable-[HOST_TUPLE] info: cleaning up downloads & tmp directories diff --git a/tests/suite/cli_rustup_ui/rustup_update_no_change.stdout.term.svg b/tests/suite/cli_rustup_ui/rustup_update_no_change.stdout.term.svg index 6395bf9b7d..1a0ded926d 100644 --- a/tests/suite/cli_rustup_ui/rustup_update_no_change.stdout.term.svg +++ b/tests/suite/cli_rustup_ui/rustup_update_no_change.stdout.term.svg @@ -19,7 +19,7 @@ - stable-[HOST_TRIPLE] unchanged - 1.0.0 (hash-stable-1.0.0) + stable-[HOST_TUPLE] unchanged - 1.0.0 (hash-stable-1.0.0) diff --git a/tests/suite/cli_rustup_ui/rustup_update_updated.stderr.term.svg b/tests/suite/cli_rustup_ui/rustup_update_updated.stderr.term.svg index 7e73169d03..49568bed81 100644 --- a/tests/suite/cli_rustup_ui/rustup_update_updated.stderr.term.svg +++ b/tests/suite/cli_rustup_ui/rustup_update_updated.stderr.term.svg @@ -17,7 +17,7 @@ - info: syncing channel updates for stable-[HOST_TRIPLE] + info: syncing channel updates for stable-[HOST_TUPLE] info: latest update on 2015-01-02 for version 1.1.0 (hash-stable-1.1.0) diff --git a/tests/suite/cli_rustup_ui/rustup_update_updated.stdout.term.svg b/tests/suite/cli_rustup_ui/rustup_update_updated.stdout.term.svg index a2cb7c6702..1a65dded5c 100644 --- a/tests/suite/cli_rustup_ui/rustup_update_updated.stdout.term.svg +++ b/tests/suite/cli_rustup_ui/rustup_update_updated.stdout.term.svg @@ -20,7 +20,7 @@ - stable-[HOST_TRIPLE] updated - 1.1.0 (hash-stable-1.1.0) (from 1.0.0 (hash-stable-1.0.0)) + stable-[HOST_TUPLE] updated - 1.1.0 (hash-stable-1.1.0) (from 1.0.0 (hash-stable-1.0.0)) diff --git a/tests/suite/cli_self_upd.rs b/tests/suite/cli_self_upd.rs index 3b18c7e9fb..49a11a3b8a 100644 --- a/tests/suite/cli_self_upd.rs +++ b/tests/suite/cli_self_upd.rs @@ -14,7 +14,7 @@ use retry::{ }; use rustup::test::{ CROSS_ARCH1, CliTestContext, Scenario, SelfUpdateTestContext, calc_hash, output_release_file, - this_host_triple, + this_host_tuple, }; #[cfg(windows)] use rustup::test::{RegistryGuard, RegistryValueId, USER_PATH}; @@ -65,16 +65,16 @@ async fn install_bins_to_cargo_home() { .await .with_stdout(snapbox::str![[r#" ... - stable-[HOST_TRIPLE] installed - 1.1.0 (hash-stable-1.1.0) + stable-[HOST_TUPLE] installed - 1.1.0 (hash-stable-1.1.0) ... "#]]) .with_stderr(snapbox::str![[r#" ... -info: syncing channel updates for stable-[HOST_TRIPLE] +info: syncing channel updates for stable-[HOST_TUPLE] 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_TUPLE] "#]]) .is_ok(); @@ -110,16 +110,16 @@ async fn proxies_are_relative_symlinks() { .await .with_stdout(snapbox::str![[r#" ... - stable-[HOST_TRIPLE] installed - 1.1.0 (hash-stable-1.1.0) + stable-[HOST_TUPLE] installed - 1.1.0 (hash-stable-1.1.0) ... "#]]) .with_stderr(snapbox::str![[r#" ... -info: syncing channel updates for stable-[HOST_TRIPLE] +info: syncing channel updates for stable-[HOST_TUPLE] 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_TUPLE] ... "#]]) .is_ok(); @@ -490,7 +490,7 @@ async fn update_download_404() { .await .is_ok(); - let trip = this_host_triple(); + let trip = this_host_tuple(); let dist_dir = cx.path().join(format!("archive/{TEST_VERSION}/{trip}")); let dist_exe = dist_dir.join(format!("rustup-init{EXE_SUFFIX}")); @@ -687,12 +687,12 @@ async fn rustup_self_update_exact() { .extend_redactions([("[TEST_VERSION]", TEST_VERSION)]) .with_stdout(snapbox::str![[r#" - stable-[HOST_TRIPLE] unchanged - 1.1.0 (hash-stable-1.1.0) + stable-[HOST_TUPLE] unchanged - 1.1.0 (hash-stable-1.1.0) "#]]) .with_stderr(snapbox::str![[r#" -info: syncing channel updates for stable-[HOST_TRIPLE] +info: syncing channel updates for stable-[HOST_TUPLE] info: checking for self-update (current version: [CURRENT_VERSION]) info: downloading self-update (new version: [TEST_VERSION]) info: cleaning up downloads & tmp directories @@ -857,7 +857,7 @@ async fn reinstall_specifying_toolchain() { .await .with_stdout(snapbox::str![[r#" ... - stable-[HOST_TRIPLE] unchanged - 1.1.0 (hash-stable-1.1.0) + stable-[HOST_TUPLE] unchanged - 1.1.0 (hash-stable-1.1.0) ... "#]]) .is_ok(); @@ -880,7 +880,7 @@ async fn reinstall_specifying_component() { .await .with_stdout(snapbox::str![[r#" ... - stable-[HOST_TRIPLE] unchanged - 1.1.0 (hash-stable-1.1.0) + stable-[HOST_TUPLE] unchanged - 1.1.0 (hash-stable-1.1.0) ... "#]]) .is_ok(); @@ -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_TUPLE] ... "#]]) .is_ok(); @@ -955,8 +955,8 @@ async fn install_sets_up_stable_unless_there_is_already_a_default() { .expect(["rustup", "run", "stable", "rustc", "--version"]) .await .with_stderr(snapbox::str![[r#" -error: toolchain 'stable-[HOST_TRIPLE]' is not installed -help: run `rustup toolchain install stable-[HOST_TRIPLE]` to install it +error: toolchain 'stable-[HOST_TUPLE]' is not installed +help: run `rustup toolchain install stable-[HOST_TUPLE]` to install it "#]]) .is_err(); @@ -1007,7 +1007,7 @@ async fn rls_proxy_set_up_after_install() { .expect(["rls", "--version"]) .await .with_stderr(snapbox::str![[r#" -error: 'rls[EXE]' is not installed for the toolchain 'stable-[HOST_TRIPLE]'. +error: 'rls[EXE]' is not installed for the toolchain 'stable-[HOST_TUPLE]'. help: run `rustup component add rls` to install it "#]]) @@ -1128,7 +1128,7 @@ async fn install_with_components_and_targets() { .await .with_stdout(snapbox::str![[r#" ... -rls-[HOST_TRIPLE] (installed) +rls-[HOST_TUPLE] (installed) ... "#]]) .is_ok(); diff --git a/tests/suite/cli_v1.rs b/tests/suite/cli_v1.rs index 3374d9e74a..465b26b59e 100644 --- a/tests/suite/cli_v1.rs +++ b/tests/suite/cli_v1.rs @@ -147,7 +147,7 @@ async fn default_existing_toolchain() { .await .with_stderr(snapbox::str![[r#" ... -info: using existing install for nightly-[HOST_TRIPLE] +info: using existing install for nightly-[HOST_TUPLE] ... "#]]) .is_ok(); @@ -199,8 +199,8 @@ async fn list_toolchains() { .expect(["rustup", "toolchain", "list"]) .await .with_stdout(snapbox::str![[r#" -beta-2015-01-01-[HOST_TRIPLE] -nightly-[HOST_TRIPLE] (active, default) +beta-2015-01-01-[HOST_TUPLE] +nightly-[HOST_TUPLE] (active, default) "#]]) .is_ok(); @@ -208,8 +208,8 @@ nightly-[HOST_TRIPLE] (active, default) .expect(["rustup", "toolchain", "list", "-v"]) .await .with_stdout(snapbox::str![[r#" -beta-2015-01-01-[HOST_TRIPLE] [..]/toolchains/beta-2015-01-01-[HOST_TRIPLE] -nightly-[HOST_TRIPLE] (active, default) [..]/toolchains/nightly-[HOST_TRIPLE] +beta-2015-01-01-[HOST_TUPLE] [..]/toolchains/beta-2015-01-01-[HOST_TUPLE] +nightly-[HOST_TUPLE] (active, default) [..]/toolchains/nightly-[HOST_TUPLE] "#]]) .is_ok(); @@ -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_TUPLE] ... "#]]) .is_ok(); @@ -664,7 +664,7 @@ async fn no_update_on_channel_when_date_has_not_changed() { .await .with_stdout(snapbox::str![[r#" - nightly-[HOST_TRIPLE] unchanged - 1.3.0 (hash-nightly-2) + nightly-[HOST_TUPLE] unchanged - 1.3.0 (hash-nightly-2) "#]]) diff --git a/tests/suite/cli_v2.rs b/tests/suite/cli_v2.rs index edcef673a6..7828d01c0c 100644 --- a/tests/suite/cli_v2.rs +++ b/tests/suite/cli_v2.rs @@ -5,10 +5,10 @@ use std::fs; use std::io::Write; use std::path::PathBuf; -use rustup::dist::TargetTriple; +use rustup::dist::TargetTuple; use rustup::dist::manifest::Manifest; use rustup::test::{ - CROSS_ARCH1, CROSS_ARCH2, CliTestContext, Config, Scenario, create_hash, this_host_triple, + CROSS_ARCH1, CROSS_ARCH2, CliTestContext, Config, Scenario, create_hash, this_host_tuple, }; #[tokio::test] @@ -196,7 +196,7 @@ async fn default_existing_toolchain() { .await .with_stderr(snapbox::str![[r#" ... -info: using existing install for nightly-[HOST_TRIPLE] +info: using existing install for nightly-[HOST_TUPLE] ... "#]]) .is_ok(); @@ -248,8 +248,8 @@ async fn list_toolchains() { .expect(["rustup", "toolchain", "list"]) .await .with_stdout(snapbox::str![[r#" -beta-2015-01-01-[HOST_TRIPLE] -nightly-[HOST_TRIPLE] (active, default) +beta-2015-01-01-[HOST_TUPLE] +nightly-[HOST_TUPLE] (active, default) "#]]) .is_ok(); @@ -257,8 +257,8 @@ nightly-[HOST_TRIPLE] (active, default) .expect(["rustup", "toolchain", "list", "-v"]) .await .with_stdout(snapbox::str![[r#" -beta-2015-01-01-[HOST_TRIPLE] [..]/toolchains/beta-2015-01-01-[HOST_TRIPLE] -nightly-[HOST_TRIPLE] (active, default) [..]/toolchains/nightly-[HOST_TRIPLE] +beta-2015-01-01-[HOST_TUPLE] [..]/toolchains/beta-2015-01-01-[HOST_TUPLE] +nightly-[HOST_TUPLE] (active, default) [..]/toolchains/nightly-[HOST_TUPLE] "#]]) .is_ok(); @@ -280,7 +280,7 @@ async fn list_toolchains_with_bogus_file() { .expect(["rustup", "toolchain", "list"]) .await .with_stdout(snapbox::str![[r#" -nightly-[HOST_TRIPLE] (active, default) +nightly-[HOST_TUPLE] (active, default) "#]]) .is_ok(); @@ -353,7 +353,7 @@ warn: removing the active toolchain; a toolchain override will be required for r .expect(["rustup", "toolchain", "list"]) .await .with_stdout(snapbox::str![[r#" -nightly-[HOST_TRIPLE] (default) +nightly-[HOST_TUPLE] (default) "#]]) .is_ok(); @@ -392,12 +392,12 @@ info: toolchain dev uninstalled "rustup", "toolchain", "remove", - &format!("nightly-{}/", this_host_triple()), + &format!("nightly-{}/", this_host_tuple()), ]) .await .with_stderr(snapbox::str![[r#" ... -info: toolchain nightly-[HOST_TRIPLE] uninstalled +info: toolchain nightly-[HOST_TUPLE] uninstalled ... "#]]) .is_ok(); @@ -422,8 +422,8 @@ async fn add_remove_multiple_toolchains() { .expect(["rustup", "toolchain", "list"]) .await .with_stdout(snapbox::str![[r#" -beta-[HOST_TRIPLE] (active, default) -nightly-[HOST_TRIPLE] +beta-[HOST_TUPLE] (active, default) +nightly-[HOST_TUPLE] "#]]) .is_ok(); @@ -485,7 +485,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_TUPLE] info: latest update on 2015-01-02 for version 1.2.0 (hash-beta-1.2.0) info: downloading component[..] ... @@ -496,10 +496,10 @@ info: downloading component[..] .await .is_ok() .with_stdout(snapbox::str![[r#" -cargo-[HOST_TRIPLE] -rust-docs-[HOST_TRIPLE] -rust-std-[HOST_TRIPLE] -rustc-[HOST_TRIPLE] +cargo-[HOST_TUPLE] +rust-docs-[HOST_TUPLE] +rust-std-[HOST_TUPLE] +rustc-[HOST_TUPLE] "#]]); } @@ -518,7 +518,7 @@ async fn file_override_toolchain_err_handling() { "#]]) .with_stderr(snapbox::str![[r#" -info: syncing channel updates for beta-[HOST_TRIPLE] +info: syncing channel updates for beta-[HOST_TUPLE] info: latest update on 2015-01-02 for version 1.2.0 (hash-beta-1.2.0) info: downloading component[..] ... @@ -529,10 +529,10 @@ info: downloading component[..] .await .is_ok() .with_stdout(snapbox::str![[r#" -cargo-[HOST_TRIPLE] -rust-docs-[HOST_TRIPLE] -rust-std-[HOST_TRIPLE] -rustc-[HOST_TRIPLE] +cargo-[HOST_TUPLE] +rust-docs-[HOST_TUPLE] +rust-std-[HOST_TUPLE] +rustc-[HOST_TUPLE] "#]]); } @@ -548,7 +548,7 @@ async fn plus_override_toolchain_err_handling() { .await .with_stderr(snapbox::str![[r#" ... -error: toolchain 'beta-[HOST_TRIPLE]' is not installed +error: toolchain 'beta-[HOST_TUPLE]' is not installed ... "#]]) .is_err(); @@ -601,7 +601,7 @@ async fn bad_manifest() { let path = [ "toolchains", - &format!("nightly-{}", this_host_triple()), + &format!("nightly-{}", this_host_tuple()), "lib", "rustlib", "multirust-channel-manifest.toml", @@ -653,7 +653,7 @@ async fn bad_sha_on_installer() { .await .with_stderr(snapbox::str![[r#" ... -error: component download failed for cargo-[HOST_TRIPLE]: checksum failed for '[..]', expected: '[..]', calculated: '[..]' +error: component download failed for cargo-[HOST_TUPLE]: checksum failed for '[..]', expected: '[..]', calculated: '[..]' ... "#]]) .is_err(); @@ -1043,7 +1043,7 @@ async fn no_update_on_channel_when_date_has_not_changed() { .is_ok() .with_stdout(snapbox::str![[r#" - nightly-[HOST_TRIPLE] unchanged - 1.3.0 (hash-nightly-2) + nightly-[HOST_TUPLE] unchanged - 1.3.0 (hash-nightly-2) "#]]); @@ -1196,7 +1196,7 @@ async fn list_targets_no_toolchain() { .await .with_stderr(snapbox::str![[r#" ... -error: toolchain 'nightly-[HOST_TRIPLE]' is not installed +error: toolchain 'nightly-[HOST_TUPLE]' is not installed ... "#]]) .is_err(); @@ -1214,7 +1214,7 @@ async fn set_auto_install_disable() { .await .with_stderr(snapbox::str![[r#" ... -error: toolchain 'nightly-[HOST_TRIPLE]' is not installed +error: toolchain 'nightly-[HOST_TUPLE]' is not installed ... "#]]) .is_err(); @@ -1226,7 +1226,7 @@ error: toolchain 'nightly-[HOST_TRIPLE]' is not installed .await .with_stderr(snapbox::str![[r#" ... -error: toolchain 'nightly-[HOST_TRIPLE]' is not installed +error: toolchain 'nightly-[HOST_TUPLE]' is not installed ... "#]]) .is_err(); @@ -1251,7 +1251,7 @@ async fn list_targets_v1_toolchain() { .expect(["rustup", "target", "list", "--toolchain=nightly"]) .await .with_stderr(snapbox::str![[r#" -error: toolchain 'nightly-[HOST_TRIPLE]' does not support components (v1 manifest) +error: toolchain 'nightly-[HOST_TUPLE]' does not support components (v1 manifest) "#]]) .is_err(); @@ -1268,7 +1268,7 @@ async fn list_targets_custom_toolchain() { .config .rustupdir .join("toolchains") - .join(format!("stable-{}", this_host_triple())); + .join(format!("stable-{}", this_host_tuple())); cx.config .expect([ "rustup", @@ -1284,7 +1284,7 @@ async fn list_targets_custom_toolchain() { .await .is_ok() .with_stdout(snapbox::str![[r#" -[HOST_TRIPLE] +[HOST_TUPLE] "#]]); cx.config @@ -1292,7 +1292,7 @@ async fn list_targets_custom_toolchain() { .await .is_ok() .with_stdout(snapbox::str![[r#" -[HOST_TRIPLE] (installed) +[HOST_TUPLE] (installed) "#]]); } @@ -1337,7 +1337,7 @@ async fn list_installed_targets() { .await .is_ok() .with_stdout(snapbox::str![[r#" -[HOST_TRIPLE] +[HOST_TUPLE] "#]]); } @@ -1355,7 +1355,7 @@ async fn add_target1() { .is_ok(); let path = format!( "toolchains/nightly-{}/lib/rustlib/{}/lib/libstd.rlib", - this_host_triple(), + this_host_tuple(), CROSS_ARCH1 ); assert!(cx.config.rustupdir.has(path)); @@ -1374,7 +1374,7 @@ async fn add_target2() { .is_ok(); let path = format!( "toolchains/nightly-{}/lib/rustlib/{}/lib/libstd.rlib", - this_host_triple(), + this_host_tuple(), CROSS_ARCH2 ); assert!(cx.config.rustupdir.has(path)); @@ -1393,13 +1393,13 @@ async fn add_all_targets() { .is_ok(); let path = format!( "toolchains/nightly-{}/lib/rustlib/{}/lib/libstd.rlib", - this_host_triple(), + this_host_tuple(), CROSS_ARCH1 ); assert!(cx.config.rustupdir.has(path)); let path = format!( "toolchains/nightly-{}/lib/rustlib/{}/lib/libstd.rlib", - this_host_triple(), + this_host_tuple(), CROSS_ARCH2 ); assert!(cx.config.rustupdir.has(path)); @@ -1507,7 +1507,7 @@ async fn add_target_no_toolchain() { .await .with_stderr(snapbox::str![[r#" ... -error: toolchain 'nightly-[HOST_TRIPLE]' is not installed +error: toolchain 'nightly-[HOST_TUPLE]' is not installed ... "#]]) .is_err(); @@ -1525,7 +1525,7 @@ async fn add_target_bogus() { .await .with_stderr(snapbox::str![[r#" ... -error: toolchain 'nightly-[HOST_TRIPLE]' does not support target 'bogus' +error: toolchain 'nightly-[HOST_TUPLE]' does not support target 'bogus' note: you can see a list of supported targets with `rustc --print=target-list` note: if you are adding support for a new target to rustc itself, see https://rustc-dev-guide.rust-lang.org/building/new-target.html @@ -1545,7 +1545,7 @@ async fn add_target_unavailable() { .await .with_stderr(snapbox::str![[r#" ... -error: toolchain 'nightly-[HOST_TRIPLE]' has no prebuilt artifacts available for target 'mipsel-sony-psp' +error: toolchain 'nightly-[HOST_TUPLE]' has no prebuilt artifacts available for target 'mipsel-sony-psp' note: this may happen to a low-tier target as per https://doc.rust-lang.org/nightly/rustc/platform-support.html note: you can find instructions on that page to build the target support from source @@ -1570,7 +1570,7 @@ async fn add_target_v1_toolchain() { ]) .await .with_stderr(snapbox::str![[r#" -error: toolchain 'nightly-[HOST_TRIPLE]' does not support components (v1 manifest) +error: toolchain 'nightly-[HOST_TUPLE]' does not support components (v1 manifest) "#]]) .is_err(); @@ -1636,7 +1636,7 @@ info: component rust-std for target [CROSS_ARCH_I] is up to date .is_ok(); let path = format!( "toolchains/nightly-{}/lib/rustlib/{}/lib/libstd.rlib", - this_host_triple(), + this_host_tuple(), CROSS_ARCH1 ); assert!(cx.config.rustupdir.has(path)); @@ -1645,7 +1645,7 @@ info: component rust-std for target [CROSS_ARCH_I] is up to date #[tokio::test] async fn add_target_host() { let cx = CliTestContext::new(Scenario::SimpleV2).await; - let trip = this_host_triple(); + let trip = this_host_tuple(); cx.config .expect(["rustup", "default", "nightly"]) .await @@ -1673,19 +1673,19 @@ async fn remove_target() { .is_ok(); let path = format!( "toolchains/nightly-{}/lib/rustlib/{}/lib/libstd.rlib", - this_host_triple(), + this_host_tuple(), CROSS_ARCH1 ); assert!(!cx.config.rustupdir.has(path)); let path = format!( "toolchains/nightly-{}/lib/rustlib/{}/lib", - this_host_triple(), + this_host_tuple(), CROSS_ARCH1 ); assert!(!cx.config.rustupdir.has(path)); let path = format!( "toolchains/nightly-{}/lib/rustlib/{}", - this_host_triple(), + this_host_tuple(), CROSS_ARCH1 ); assert!(!cx.config.rustupdir.has(path)); @@ -1702,12 +1702,12 @@ async fn remove_target_not_installed() { .expect(["rustup", "target", "remove", CROSS_ARCH1]) .await .extend_redactions([ - ("[HOST_TRIPLE]", this_host_triple().to_string()), + ("[HOST_TUPLE]", this_host_tuple().to_string()), ("[CROSS_ARCH_I]", CROSS_ARCH1.to_string()), ]) .with_stderr(snapbox::str![[r#" ... -error: toolchain 'nightly-[HOST_TRIPLE]' does not have target '[CROSS_ARCH_I]' installed +error: toolchain 'nightly-[HOST_TUPLE]' does not have target '[CROSS_ARCH_I]' installed ... "#]]) .is_err(); @@ -1730,7 +1730,7 @@ async fn remove_target_no_toolchain() { .await .with_stderr(snapbox::str![[r#" ... -error: toolchain 'nightly-[HOST_TRIPLE]' is not installed +error: toolchain 'nightly-[HOST_TUPLE]' is not installed ... "#]]) .is_err(); @@ -1748,7 +1748,7 @@ async fn remove_target_bogus() { .await .with_stderr(snapbox::str![[r#" ... -error: toolchain 'nightly-[HOST_TRIPLE]' does not have target 'bogus' installed +error: toolchain 'nightly-[HOST_TUPLE]' does not have target 'bogus' installed ... "#]]) .is_err(); @@ -1771,7 +1771,7 @@ async fn remove_target_v1_toolchain() { ]) .await .with_stderr(snapbox::str![[r#" -error: toolchain 'nightly-[HOST_TRIPLE]' does not support components (v1 manifest) +error: toolchain 'nightly-[HOST_TUPLE]' does not support components (v1 manifest) "#]]) .is_err(); @@ -1819,12 +1819,12 @@ async fn remove_target_again() { .expect(["rustup", "target", "remove", CROSS_ARCH1]) .await .extend_redactions([ - ("[HOST_TRIPLE]", this_host_triple().to_string()), + ("[HOST_TUPLE]", this_host_tuple().to_string()), ("[CROSS_ARCH_I]", CROSS_ARCH1.to_string()), ]) .with_stderr(snapbox::str![[r#" ... -error: toolchain 'nightly-[HOST_TRIPLE]' does not have target '[CROSS_ARCH_I]' installed +error: toolchain 'nightly-[HOST_TUPLE]' does not have target '[CROSS_ARCH_I]' installed ... "#]]) .is_err(); @@ -1833,7 +1833,7 @@ error: toolchain 'nightly-[HOST_TRIPLE]' does not have target '[CROSS_ARCH_I]' i #[tokio::test] async fn remove_target_host() { let cx = CliTestContext::new(Scenario::SimpleV2).await; - let host = this_host_triple(); + let host = this_host_tuple(); cx.config .expect(["rustup", "default", "nightly"]) .await @@ -1862,7 +1862,7 @@ warn: removing the default host target; proc-macros and build scripts might no l #[tokio::test] async fn remove_target_last() { let cx = CliTestContext::new(Scenario::SimpleV2).await; - let host = this_host_triple(); + let host = this_host_tuple(); cx.config .expect(["rustup", "default", "nightly"]) .await @@ -1887,7 +1887,7 @@ async fn remove_target_missing_update_hash() { .await .is_ok(); - let file_name = format!("nightly-{}", this_host_triple()); + let file_name = format!("nightly-{}", this_host_tuple()); fs::remove_file(cx.config.rustupdir.join("update-hashes").join(file_name)).unwrap(); cx.config @@ -1902,7 +1902,7 @@ async fn warn_about_and_remove_stray_hash() { let mut cx = CliTestContext::new(Scenario::None).await; let mut hash_path = cx.config.rustupdir.join("update-hashes"); fs::create_dir_all(&hash_path).expect("Unable to make the update-hashes directory"); - hash_path.push(format!("nightly-{}", this_host_triple())); + hash_path.push(format!("nightly-{}", this_host_tuple())); let mut file = fs::File::create(&hash_path).expect("Unable to open update-hash file"); file.write_all(b"LEGITHASH") .expect("Unable to write update-hash"); @@ -1914,7 +1914,7 @@ async fn warn_about_and_remove_stray_hash() { .await .with_stderr(snapbox::str![[r#" ... -warn: removing stray hash file in order to continue: [..]/update-hashes/nightly-[HOST_TRIPLE] +warn: removing stray hash file in order to continue: [..]/update-hashes/nightly-[HOST_TUPLE] ... "#]]) .is_ok(); @@ -1930,7 +1930,7 @@ fn make_component_unavailable(config: &Config, name: &str, target: String) { let mut manifest = Manifest::parse(&manifest_str).unwrap(); { let std_pkg = manifest.packages.get_mut(name).unwrap(); - let target = TargetTriple::new(target); + let target = TargetTuple::new(target); let target_pkg = std_pkg.targets.get_mut(&target).unwrap(); target_pkg.bins = Vec::new(); } @@ -1946,13 +1946,13 @@ fn make_component_unavailable(config: &Config, name: &str, target: String) { #[tokio::test] async fn update_unavailable_std() { let cx = CliTestContext::new(Scenario::SimpleV2).await; - make_component_unavailable(&cx.config, "rust-std", this_host_triple()); + make_component_unavailable(&cx.config, "rust-std", this_host_tuple()); cx.config .expect(["rustup", "update", "nightly"]) .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_TUPLE]' is unavailable for download for channel 'nightly' ... "#]]) .is_err(); @@ -1961,7 +1961,7 @@ error: component 'rust-std' for target '[HOST_TRIPLE]' is unavailable for downlo #[tokio::test] async fn add_missing_component() { let cx = CliTestContext::new(Scenario::SimpleV2).await; - make_component_unavailable(&cx.config, "rls-preview", this_host_triple()); + make_component_unavailable(&cx.config, "rls-preview", this_host_tuple()); cx.config .expect(["rustup", "toolchain", "add", "nightly"]) .await @@ -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_TUPLE]' is unavailable for download for channel 'nightly' (sometimes not all components are available in any given nightly) ... "#]]) @@ -1988,13 +1988,13 @@ error: component 'rls' for target '[HOST_TRIPLE]' is unavailable for download fo #[tokio::test] async fn add_missing_component_toolchain() { let cx = CliTestContext::new(Scenario::SimpleV2).await; - make_component_unavailable(&cx.config, "rust-std", this_host_triple()); + make_component_unavailable(&cx.config, "rust-std", this_host_tuple()); cx.config .expect(["rustup", "toolchain", "add", "nightly"]) .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_TUPLE]' is unavailable for download for channel 'nightly' Sometimes not all components are available in any given nightly. If you don't need these components, you could try a minimal installation with: @@ -2048,7 +2048,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_TUPLE]' is unavailable for download for channel 'stable' One or many components listed above might have been permanently removed from newer versions of the official Rust distribution due to deprecation. ... @@ -2070,7 +2070,7 @@ of the official Rust distribution due to deprecation. #[tokio::test] async fn update_unavailable_force() { let cx = CliTestContext::new(Scenario::SimpleV2).await; - let trip = this_host_triple(); + let trip = this_host_tuple(); cx.config .expect(["rustup", "update", "nightly"]) .await @@ -2092,7 +2092,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_TUPLE]' is unavailable for download for channel 'nightly' ... "#]]) .is_err(); @@ -2113,7 +2113,7 @@ async fn add_component_suggest_best_match() { .expect(["rustup", "component", "add", "rsl"]) .await .with_stderr(snapbox::str![[r#" -error: toolchain 'nightly-[HOST_TRIPLE]' does not contain component 'rsl' for target '[HOST_TRIPLE]'; did you mean 'rls'? +error: toolchain 'nightly-[HOST_TUPLE]' does not contain component 'rsl' for target '[HOST_TUPLE]'; did you mean 'rls'? "#]]) .is_err(); @@ -2121,7 +2121,7 @@ error: toolchain 'nightly-[HOST_TRIPLE]' does not contain component 'rsl' for ta .expect(["rustup", "component", "add", "rsl-preview"]) .await .with_stderr(snapbox::str![[r#" -error: toolchain 'nightly-[HOST_TRIPLE]' does not contain component 'rsl-preview' for target '[HOST_TRIPLE]'; did you mean 'rls-preview'? +error: toolchain 'nightly-[HOST_TUPLE]' does not contain component 'rsl-preview' for target '[HOST_TUPLE]'; did you mean 'rls-preview'? "#]]) .is_err(); @@ -2129,7 +2129,7 @@ error: toolchain 'nightly-[HOST_TRIPLE]' does not contain component 'rsl-preview .expect(["rustup", "component", "add", "rustd"]) .await .with_stderr(snapbox::str![[r#" -error: toolchain 'nightly-[HOST_TRIPLE]' does not contain component 'rustd' for target '[HOST_TRIPLE]'; did you mean 'rustc'? +error: toolchain 'nightly-[HOST_TUPLE]' does not contain component 'rustd' for target '[HOST_TUPLE]'; did you mean 'rustc'? "#]]) .is_err(); @@ -2160,7 +2160,7 @@ async fn remove_component_suggest_best_match() { .expect(["rustup", "component", "remove", "rsl"]) .await .with_stderr(snapbox::str![[r#" -error: toolchain 'nightly-[HOST_TRIPLE]' does not contain component 'rsl' for target '[HOST_TRIPLE]'; did you mean 'rls'? +error: toolchain 'nightly-[HOST_TUPLE]' does not contain component 'rsl' for target '[HOST_TUPLE]'; did you mean 'rls'? "#]]) .is_err(); @@ -2172,7 +2172,7 @@ error: toolchain 'nightly-[HOST_TRIPLE]' does not contain component 'rsl' for ta .expect(["rustup", "component", "add", "rsl-preview"]) .await .with_stderr(snapbox::str![[r#" -error: toolchain 'nightly-[HOST_TRIPLE]' does not contain component 'rsl-preview' for target '[HOST_TRIPLE]'; did you mean 'rls-preview'? +error: toolchain 'nightly-[HOST_TUPLE]' does not contain component 'rsl-preview' for target '[HOST_TUPLE]'; did you mean 'rls-preview'? "#]]) .is_err(); @@ -2180,7 +2180,7 @@ error: toolchain 'nightly-[HOST_TRIPLE]' does not contain component 'rsl-preview .expect(["rustup", "component", "remove", "rustd"]) .await .with_stderr(snapbox::str![[r#" -error: toolchain 'nightly-[HOST_TRIPLE]' does not contain component 'rustd' for target '[HOST_TRIPLE]'; did you mean 'rustc'? +error: toolchain 'nightly-[HOST_TUPLE]' does not contain component 'rustd' for target '[HOST_TUPLE]'; did you mean 'rustc'? "#]]) .is_err(); @@ -2198,7 +2198,7 @@ async fn add_target_suggest_best_match() { .await .with_stderr(snapbox::str![[r#" ... -error: toolchain 'nightly-[HOST_TRIPLE]' does not support target '[CROSS_ARCH_I]a'; did you mean '[CROSS_ARCH_I]'? +error: toolchain 'nightly-[HOST_TUPLE]' does not support target '[CROSS_ARCH_I]a'; did you mean '[CROSS_ARCH_I]'? ... "#]]) .is_err(); @@ -2229,7 +2229,7 @@ async fn remove_target_suggest_best_match() { .expect(["rustup", "target", "remove", &format!("{CROSS_ARCH1}a")[..]]) .await .with_stderr(snapbox::str![[r#" -error: toolchain 'nightly-[HOST_TRIPLE]' does not have target '[CROSS_ARCH_I]a' installed; did you mean '[CROSS_ARCH_I]'? +error: toolchain 'nightly-[HOST_TUPLE]' does not have target '[CROSS_ARCH_I]a' installed; did you mean '[CROSS_ARCH_I]'? "#]]) @@ -2287,7 +2287,7 @@ rust-src (installed) .await .with_stdout(snapbox::str![[r#" ... -rust-analysis-[HOST_TRIPLE] (installed) +rust-analysis-[HOST_TUPLE] (installed) ... "#]]) .is_ok(); @@ -2354,7 +2354,7 @@ async fn install_with_component_and_target() { .await .with_stdout(snapbox::str![[r#" ... -rls-[HOST_TRIPLE] (installed) +rls-[HOST_TUPLE] (installed) ... "#]]) .is_ok(); @@ -2409,7 +2409,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_TUPLE]' is unavailable for download for channel 'nightly' ... "#]]) .is_err(); @@ -2430,9 +2430,9 @@ warn: skipping unavailable component rls .await .with_stdout(snapbox::str![[r#" ... -cargo-[HOST_TRIPLE] (installed) +cargo-[HOST_TUPLE] (installed) ... -rust-docs-[HOST_TRIPLE] (installed) +rust-docs-[HOST_TUPLE] (installed) ... "#]]) .is_ok(); @@ -2441,7 +2441,7 @@ rust-docs-[HOST_TRIPLE] (installed) #[tokio::test] async fn run_with_install_flag_against_unavailable_component() { let cx = CliTestContext::new(Scenario::SimpleV2).await; - let trip = this_host_triple(); + let trip = this_host_tuple(); make_component_unavailable(&cx.config, "rust-std", trip); cx.config .expect([ @@ -2458,7 +2458,7 @@ async fn run_with_install_flag_against_unavailable_component() { "#]]) .with_stderr(snapbox::str![[r#" -info: syncing channel updates for nightly-[HOST_TRIPLE] +info: syncing channel updates for nightly-[HOST_TUPLE] info: latest update on 2015-01-02 for version 1.3.0 (hash-nightly-2) warn: skipping unavailable component rust-std info: downloading component[..] @@ -2470,9 +2470,9 @@ info: downloading component[..] .await .is_ok() .with_stdout(snapbox::str![[r#" -cargo-[HOST_TRIPLE] -rust-docs-[HOST_TRIPLE] -rustc-[HOST_TRIPLE] +cargo-[HOST_TUPLE] +rust-docs-[HOST_TUPLE] +rustc-[HOST_TUPLE] "#]]); } @@ -2502,7 +2502,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_TUPLE]' is unavailable for download for channel 'nightly' ... "#]]) .is_err(); diff --git a/tests/suite/known_tuples.rs b/tests/suite/known_tuples.rs index fd0b7385cc..f0e226525c 100644 --- a/tests/suite/known_tuples.rs +++ b/tests/suite/known_tuples.rs @@ -4,11 +4,11 @@ use platforms::Platform; #[test] fn gen_known_tuples() { - let out_path = "src/dist/triple/known.rs"; + let out_path = "src/dist/target_tuple/known.rs"; let existing = std::fs::read_to_string(out_path).unwrap(); let (mut archs, mut oses, mut envs) = (BTreeSet::new(), BTreeSet::new(), BTreeSet::new()); - for (arch, os, env) in Platform::ALL.iter().map(|p| parse_triple(p.target_triple)) { + for (arch, os, env) in Platform::ALL.iter().map(|p| parse_tuple(p.target_triple)) { archs.insert(arch); oses.insert(os); if !env.is_empty() { @@ -50,12 +50,12 @@ fn gen_known_tuples() { } } -/// Parses the given triple into 3 parts (target architecture, OS and environment). +/// Parses the given tuple into 3 parts (target architecture, OS and environment). /// /// # Discussion /// /// The current model of target tuples in Rustup requires some non-code knowledge to correctly generate the list. -/// For example, the parsing results of two 2-dash triples can be different: +/// For example, the parsing results of two 2-dash tuples can be different: /// /// ```jsonc /// { arch: aarch64, os: linux, env: android } @@ -79,18 +79,18 @@ fn gen_known_tuples() { /// // for `x-y-z-w` /// { arch: x, os: y-z, env: w } /// ``` -fn parse_triple(triple: &str) -> (&str, &str, &str) { - match triple.split('-').collect::>()[..] { +fn parse_tuple(tuple: &str) -> (&str, &str, &str) { + match tuple.split('-').collect::>()[..] { [arch, os] => (arch, os, ""), [arch, os @ ("none" | "linux"), env] => (arch, os, env), - [arch, _, _] => (arch, &triple[(arch.len() + 1)..], ""), + [arch, _, _] => (arch, &tuple[(arch.len() + 1)..], ""), [arch, _, _, env] => ( arch, - &triple[(arch.len() + 1)..(triple.len() - env.len() - 1)], + &tuple[(arch.len() + 1)..(tuple.len() - env.len() - 1)], env, ), _ => panic!( - "Internal error while parsing target tuple `{triple}`, please file an issue at https://github.com/rust-lang/rustup/issues" + "Internal error while parsing target tuple `{tuple}`, please file an issue at https://github.com/rust-lang/rustup/issues" ), } }