@@ -316,7 +316,12 @@ pub fn cli() -> App<'static, 'static> {
316
316
. help ( "Force an update, even if some components are missing" )
317
317
. long ( "force" )
318
318
. takes_value ( false ) ,
319
- ) ,
319
+ )
320
+ . arg (
321
+ Arg :: with_name ( "force-non-host" )
322
+ . help ( "Install toolchains that require an emulator. See https://github.com/rust-lang/rustup/wiki/Non-host-toolchains" )
323
+ . long ( "force-non-host" )
324
+ . takes_value ( false ) ) ,
320
325
)
321
326
. subcommand ( SubCommand :: with_name ( "check" ) . about ( "Check for updates to Rust toolchains and rustup" ) )
322
327
. subcommand (
@@ -918,6 +923,7 @@ fn check_updates(cfg: &Cfg) -> Result<utils::ExitCode> {
918
923
919
924
fn update ( cfg : & mut Cfg , m : & ArgMatches < ' _ > ) -> Result < utils:: ExitCode > {
920
925
let self_update = !m. is_present ( "no-self-update" ) && !self_update:: NEVER_SELF_UPDATE ;
926
+ let forced = m. is_present ( "force-non-host" ) ;
921
927
if let Some ( p) = m. value_of ( "profile" ) {
922
928
let p = Profile :: from_str ( p) ?;
923
929
cfg. set_profile_override ( p) ;
@@ -939,7 +945,8 @@ fn update(cfg: &mut Cfg, m: &ArgMatches<'_>) -> Result<utils::ExitCode> {
939
945
let host_arch = TargetTriple :: from_host_or_build ( ) ;
940
946
if let Ok ( toolchain_desc) = ToolchainDesc :: from_str ( name) {
941
947
let target_triple = toolchain_desc. target ;
942
- if host_arch. ne ( & target_triple) {
948
+ if !forced && host_arch. ne ( & target_triple) {
949
+ err ! ( "DEPRECATED: future versions of rustup will require --force-non-host to install a non-host toolchain as the default." ) ;
943
950
warn ! (
944
951
"toolchain '{}' may not be able to run on this system." ,
945
952
name
0 commit comments