Skip to content

Commit 22d43d0

Browse files
authored
Merge pull request #2695 from rbtcollins/bug-2672
bug-2672
2 parents 6fccc01 + 7a2d525 commit 22d43d0

File tree

1 file changed

+9
-2
lines changed

1 file changed

+9
-2
lines changed

src/cli/rustup_mode.rs

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -316,7 +316,12 @@ pub fn cli() -> App<'static, 'static> {
316316
.help("Force an update, even if some components are missing")
317317
.long("force")
318318
.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)),
320325
)
321326
.subcommand(SubCommand::with_name("check").about("Check for updates to Rust toolchains and rustup"))
322327
.subcommand(
@@ -918,6 +923,7 @@ fn check_updates(cfg: &Cfg) -> Result<utils::ExitCode> {
918923

919924
fn update(cfg: &mut Cfg, m: &ArgMatches<'_>) -> Result<utils::ExitCode> {
920925
let self_update = !m.is_present("no-self-update") && !self_update::NEVER_SELF_UPDATE;
926+
let forced = m.is_present("force-non-host");
921927
if let Some(p) = m.value_of("profile") {
922928
let p = Profile::from_str(p)?;
923929
cfg.set_profile_override(p);
@@ -939,7 +945,8 @@ fn update(cfg: &mut Cfg, m: &ArgMatches<'_>) -> Result<utils::ExitCode> {
939945
let host_arch = TargetTriple::from_host_or_build();
940946
if let Ok(toolchain_desc) = ToolchainDesc::from_str(name) {
941947
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.");
943950
warn!(
944951
"toolchain '{}' may not be able to run on this system.",
945952
name

0 commit comments

Comments
 (0)