@@ -742,6 +742,7 @@ impl<'a> Cfg<'a> {
742
742
#[ tracing:: instrument( level = "trace" , skip_all) ]
743
743
pub ( crate ) async fn find_or_install_active_toolchain (
744
744
& self ,
745
+ force_non_host : bool ,
745
746
verbose : bool ,
746
747
) -> Result < ( LocalToolchainName , ActiveReason ) > {
747
748
if let Some ( ( override_config, reason) ) = self . find_override_config ( ) ? {
@@ -753,16 +754,23 @@ impl<'a> Cfg<'a> {
753
754
profile,
754
755
} = override_config
755
756
{
756
- self . ensure_installed ( & toolchain, components, targets, profile, verbose)
757
- . await ?;
757
+ self . ensure_installed (
758
+ & toolchain,
759
+ components,
760
+ targets,
761
+ profile,
762
+ force_non_host,
763
+ verbose,
764
+ )
765
+ . await ?;
758
766
} else {
759
767
Toolchain :: with_reason ( self , toolchain. clone ( ) , & reason) ?;
760
768
}
761
769
Ok ( ( toolchain, reason) )
762
770
} else if let Some ( toolchain) = self . get_default ( ) ? {
763
771
let reason = ActiveReason :: Default ;
764
772
if let ToolchainName :: Official ( desc) = & toolchain {
765
- self . ensure_installed ( desc, vec ! [ ] , vec ! [ ] , None , verbose)
773
+ self . ensure_installed ( desc, vec ! [ ] , vec ! [ ] , None , force_non_host , verbose)
766
774
. await ?;
767
775
} else {
768
776
Toolchain :: with_reason ( self , toolchain. clone ( ) . into ( ) , & reason) ?;
@@ -782,13 +790,14 @@ impl<'a> Cfg<'a> {
782
790
components : Vec < String > ,
783
791
targets : Vec < String > ,
784
792
profile : Option < Profile > ,
793
+ force_non_host : bool ,
785
794
verbose : bool ,
786
795
) -> Result < ( UpdateStatus , Toolchain < ' _ > ) > {
787
796
common:: warn_if_host_is_incompatible (
788
797
toolchain,
789
798
& TargetTriple :: from_host_or_build ( self . process ) ,
790
799
& toolchain. target ,
791
- false ,
800
+ force_non_host ,
792
801
) ?;
793
802
if verbose {
794
803
( self . notify_handler ) ( Notification :: LookingForToolchain ( toolchain) ) ;
0 commit comments