@@ -254,24 +254,26 @@ impl Builder {
254
254
t ! ( self . checksums. store_cache( ) ) ;
255
255
}
256
256
257
- /// If a tool does not pass its tests, don't ship it.
257
+ /// If a tool does not pass its tests on *any* of Linux and Windows, don't ship
258
+ /// it on *all* targets, because tools like Miri can "cross-run" programs for
259
+ /// different targets, for example, run a program for `x86_64-pc-windows-msvc`
260
+ /// on `x86_64-unknown-linux-gnu`.
258
261
/// Right now, we do this only for Miri.
259
262
fn check_toolstate ( & mut self ) {
260
- let toolstates : Option < HashMap < String , String > > =
261
- File :: open ( self . input . join ( "toolstates-linux.json" ) )
263
+ for file in & [ "toolstates-linux.json" , "toolstates-windows.json" ] {
264
+ let toolstates : Option < HashMap < String , String > > = File :: open ( self . input . join ( file ) )
262
265
. ok ( )
263
266
. and_then ( |f| serde_json:: from_reader ( & f) . ok ( ) ) ;
264
- let toolstates = toolstates. unwrap_or_else ( || {
265
- println ! (
266
- "WARNING: `toolstates-linux.json` missing/malformed; \
267
- assuming all tools failed"
268
- ) ;
269
- HashMap :: default ( ) // Use empty map if anything went wrong.
270
- } ) ;
271
- // Mark some tools as missing based on toolstate.
272
- if toolstates. get ( "miri" ) . map ( |s| & * s as & str ) != Some ( "test-pass" ) {
273
- println ! ( "Miri tests are not passing, removing component" ) ;
274
- self . versions . disable_version ( & PkgType :: Miri ) ;
267
+ let toolstates = toolstates. unwrap_or_else ( || {
268
+ println ! ( "WARNING: `{}` missing/malformed; assuming all tools failed" , file) ;
269
+ HashMap :: default ( ) // Use empty map if anything went wrong.
270
+ } ) ;
271
+ // Mark some tools as missing based on toolstate.
272
+ if toolstates. get ( "miri" ) . map ( |s| & * s as & str ) != Some ( "test-pass" ) {
273
+ println ! ( "Miri tests are not passing, removing component" ) ;
274
+ self . versions . disable_version ( & PkgType :: Miri ) ;
275
+ break ;
276
+ }
275
277
}
276
278
}
277
279
0 commit comments