@@ -16,11 +16,8 @@ use std::{
16
16
17
17
use enum_map:: { enum_map, Enum , EnumMap } ;
18
18
use once_cell:: sync:: Lazy ;
19
- use tokio:: runtime:: Builder ;
20
19
use url:: Url ;
21
20
22
- use crate :: cli:: rustup_mode;
23
- use crate :: currentprocess;
24
21
use crate :: test as rustup_test;
25
22
use crate :: test:: const_dist_dir;
26
23
use crate :: test:: this_host_triple;
@@ -679,13 +676,8 @@ impl Config {
679
676
I : IntoIterator < Item = A > + Clone + Debug ,
680
677
A : AsRef < OsStr > ,
681
678
{
682
- let inprocess = allow_inprocess ( name, args. clone ( ) ) ;
683
679
let start = Instant :: now ( ) ;
684
- let out = if inprocess {
685
- self . run_inprocess ( name, args. clone ( ) , env)
686
- } else {
687
- self . run_subprocess ( name, args. clone ( ) , env)
688
- } ;
680
+ let out = self . run_subprocess ( name, args. clone ( ) , env) ;
689
681
let duration = Instant :: now ( ) - start;
690
682
let output = SanitizedOutput {
691
683
ok : matches ! ( out. status, Some ( 0 ) ) ,
@@ -694,7 +686,6 @@ impl Config {
694
686
} ;
695
687
696
688
println ! ( "ran: {} {:?}" , name, args) ;
697
- println ! ( "inprocess: {inprocess}" ) ;
698
689
println ! ( "status: {:?}" , out. status) ;
699
690
println ! ( "duration: {:.3}s" , duration. as_secs_f32( ) ) ;
700
691
println ! ( "stdout:\n ====\n {}\n ====\n " , output. stdout) ;
@@ -703,54 +694,6 @@ impl Config {
703
694
output
704
695
}
705
696
706
- #[ cfg_attr( feature = "otel" , tracing:: instrument( skip_all) ) ]
707
- pub ( crate ) fn run_inprocess < I , A > ( & self , name : & str , args : I , env : & [ ( & str , & str ) ] ) -> Output
708
- where
709
- I : IntoIterator < Item = A > ,
710
- A : AsRef < OsStr > ,
711
- {
712
- // should we use vars_os, or skip over non-stringable vars? This is test
713
- // code after all...
714
- let mut vars: HashMap < String , String > = HashMap :: default ( ) ;
715
- self :: env ( self , & mut vars) ;
716
- vars. extend ( env. iter ( ) . map ( |( k, v) | ( k. to_string ( ) , v. to_string ( ) ) ) ) ;
717
- let mut arg_strings: Vec < Box < str > > = Vec :: new ( ) ;
718
- arg_strings. push ( name. to_owned ( ) . into_boxed_str ( ) ) ;
719
- for arg in args {
720
- arg_strings. push (
721
- arg. as_ref ( )
722
- . to_os_string ( )
723
- . into_string ( )
724
- . unwrap ( )
725
- . into_boxed_str ( ) ,
726
- ) ;
727
- }
728
- let tp = currentprocess:: TestProcess :: new ( & * self . workdir . borrow ( ) , & arg_strings, vars, "" ) ;
729
- let mut builder = Builder :: new_multi_thread ( ) ;
730
- builder
731
- . enable_all ( )
732
- . worker_threads ( 2 )
733
- . max_blocking_threads ( 2 ) ;
734
- let process_res = currentprocess:: with_runtime (
735
- tp. clone ( ) . into ( ) ,
736
- builder,
737
- rustup_mode:: main ( tp. cwd . clone ( ) ) ,
738
- ) ;
739
- // convert Err's into an ec
740
- let ec = match process_res {
741
- Ok ( process_res) => process_res,
742
- Err ( e) => {
743
- currentprocess:: with ( tp. clone ( ) . into ( ) , || crate :: cli:: common:: report_error ( & e) ) ;
744
- utils:: ExitCode ( 1 )
745
- }
746
- } ;
747
- Output {
748
- status : Some ( ec. 0 ) ,
749
- stderr : tp. get_stderr ( ) ,
750
- stdout : tp. get_stdout ( ) ,
751
- }
752
- }
753
-
754
697
#[ track_caller]
755
698
pub fn run_subprocess < I , A > ( & self , name : & str , args : I , env : & [ ( & str , & str ) ] ) -> Output
756
699
where
@@ -854,43 +797,6 @@ pub fn env<E: rustup_test::Env>(config: &Config, cmd: &mut E) {
854
797
config. env ( cmd)
855
798
}
856
799
857
- fn allow_inprocess < I , A > ( name : & str , args : I ) -> bool
858
- where
859
- I : IntoIterator < Item = A > ,
860
- A : AsRef < OsStr > ,
861
- {
862
- // Only the rustup alias is currently ready for in-process testing:
863
- // - -init performs self-update which monkey with global external state.
864
- // - proxies themselves behave appropriately the proxied output needs to be
865
- // collected for assertions to be made on it as our tests traverse layers.
866
- // - self update executions cannot run in-process because on windows the
867
- // process replacement dance would replace the test process.
868
- // - any command with --version in it is testing to see something was
869
- // installed properly, so we have to shell out to it to be sure
870
- if name != "rustup" {
871
- return false ;
872
- }
873
- let mut is_update = false ;
874
- let mut no_self_update = false ;
875
- let mut self_cmd = false ;
876
- let mut run = false ;
877
- let mut version = false ;
878
- for arg in args {
879
- if arg. as_ref ( ) == "update" {
880
- is_update = true ;
881
- } else if arg. as_ref ( ) == "--no-self-update" {
882
- no_self_update = true ;
883
- } else if arg. as_ref ( ) == "self" {
884
- self_cmd = true ;
885
- } else if arg. as_ref ( ) == "run" {
886
- run = true ;
887
- } else if arg. as_ref ( ) == "--version" {
888
- version = true ;
889
- }
890
- }
891
- !( run || self_cmd || version || ( is_update && !no_self_update) )
892
- }
893
-
894
800
#[ derive( Copy , Clone , Eq , PartialEq ) ]
895
801
enum RlsStatus {
896
802
Available ,
0 commit comments