@@ -123,7 +123,9 @@ impl Std {
123123}
124124
125125impl Step for Std {
126- type Output = ( ) ;
126+ /// Build stamp of std, if it was indeed built or uplifted.
127+ type Output = Option < BuildStamp > ;
128+
127129 const DEFAULT : bool = true ;
128130
129131 fn should_run ( run : ShouldRun < ' _ > ) -> ShouldRun < ' _ > {
@@ -160,15 +162,15 @@ impl Step for Std {
160162 /// This will build the standard library for a particular stage of the build
161163 /// using the `compiler` targeting the `target` architecture. The artifacts
162164 /// created will also be linked into the sysroot directory.
163- fn run ( self , builder : & Builder < ' _ > ) {
165+ fn run ( self , builder : & Builder < ' _ > ) -> Self :: Output {
164166 let target = self . target ;
165167
166168 // We already have std ready to be used for stage 0.
167169 if self . build_compiler . stage == 0 {
168170 let compiler = self . build_compiler ;
169171 builder. ensure ( StdLink :: from_std ( self , compiler) ) ;
170172
171- return ;
173+ return None ;
172174 }
173175
174176 let build_compiler = if builder. download_rustc ( ) && self . force_recompile {
@@ -193,7 +195,7 @@ impl Step for Std {
193195 & sysroot,
194196 builder. config . ci_rust_std_contents ( ) ,
195197 ) ;
196- return ;
198+ return None ;
197199 }
198200
199201 if builder. config . keep_stage . contains ( & build_compiler. stage )
@@ -209,7 +211,7 @@ impl Step for Std {
209211 self . copy_extra_objects ( builder, & build_compiler, target) ;
210212
211213 builder. ensure ( StdLink :: from_std ( self , build_compiler) ) ;
212- return ;
214+ return Some ( build_stamp :: libstd_stamp ( builder , build_compiler , target ) ) ;
213215 }
214216
215217 let mut target_deps = builder. ensure ( StartupObjects { compiler : build_compiler, target } ) ;
@@ -219,7 +221,7 @@ impl Step for Std {
219221
220222 if Self :: should_be_uplifted_from_stage_1 ( builder, build_compiler. stage , target) {
221223 let build_compiler_for_std_to_uplift = builder. compiler ( 1 , builder. host_target ) ;
222- builder. std ( build_compiler_for_std_to_uplift, target) ;
224+ let stage_1_stamp = builder. std ( build_compiler_for_std_to_uplift, target) ;
223225
224226 let msg = if build_compiler_for_std_to_uplift. host == target {
225227 format ! (
@@ -240,7 +242,7 @@ impl Step for Std {
240242 self . copy_extra_objects ( builder, & build_compiler, target) ;
241243
242244 builder. ensure ( StdLink :: from_std ( self , build_compiler_for_std_to_uplift) ) ;
243- return ;
245+ return stage_1_stamp ;
244246 }
245247
246248 target_deps. extend ( self . copy_extra_objects ( builder, & build_compiler, target) ) ;
@@ -293,11 +295,13 @@ impl Step for Std {
293295 build_compiler,
294296 target,
295297 ) ;
298+
299+ let stamp = build_stamp:: libstd_stamp ( builder, build_compiler, target) ;
296300 run_cargo (
297301 builder,
298302 cargo,
299303 vec ! [ ] ,
300- & build_stamp :: libstd_stamp ( builder , build_compiler , target ) ,
304+ & stamp ,
301305 target_deps,
302306 self . is_for_mir_opt_tests , // is_check
303307 false ,
@@ -307,6 +311,7 @@ impl Step for Std {
307311 self ,
308312 builder. compiler ( build_compiler. stage , builder. config . host_target ) ,
309313 ) ) ;
314+ Some ( stamp)
310315 }
311316
312317 fn metadata ( & self ) -> Option < StepMetadata > {
0 commit comments