@@ -247,9 +247,11 @@ pub struct Link;
247247impl Step for Link {
248248 type Output = ( ) ;
249249 const DEFAULT : bool = true ;
250+
250251 fn should_run ( run : ShouldRun < ' _ > ) -> ShouldRun < ' _ > {
251252 run. alias ( "link" )
252253 }
254+
253255 fn make_run ( run : RunConfig < ' _ > ) {
254256 if run. builder . config . dry_run ( ) {
255257 return ;
@@ -262,21 +264,30 @@ impl Step for Link {
262264 }
263265 fn run ( self , builder : & Builder < ' _ > ) -> Self :: Output {
264266 let config = & builder. config ;
267+
265268 if config. dry_run ( ) {
266269 return ;
267270 }
271+
272+ if !rustup_installed ( builder) {
273+ println ! ( "WARNING: `rustup` is not installed; Skipping `stage1` toolchain linking." ) ;
274+ return ;
275+ }
276+
268277 let stage_path =
269278 [ "build" , config. build . rustc_target_arg ( ) , "stage1" ] . join ( MAIN_SEPARATOR_STR ) ;
270- if !rustup_installed ( builder) {
271- eprintln ! ( "`rustup` is not installed; cannot link `stage1` toolchain" ) ;
272- } else if stage_dir_exists ( & stage_path[ ..] ) && !config. dry_run ( ) {
279+
280+ if stage_dir_exists ( & stage_path[ ..] ) && !config. dry_run ( ) {
273281 attempt_toolchain_link ( builder, & stage_path[ ..] ) ;
274282 }
275283 }
276284}
277285
278286fn rustup_installed ( builder : & Builder < ' _ > ) -> bool {
279- command ( "rustup" ) . arg ( "--version" ) . run_capture_stdout ( builder) . is_success ( )
287+ let mut rustup = command ( "rustup" ) ;
288+ rustup. arg ( "--version" ) ;
289+
290+ rustup. allow_failure ( ) . run_always ( ) . run_capture_stdout ( builder) . is_success ( )
280291}
281292
282293fn stage_dir_exists ( stage_path : & str ) -> bool {
0 commit comments