File tree Expand file tree Collapse file tree 1 file changed +9
-5
lines changed
src/tools/build-manifest/src Expand file tree Collapse file tree 1 file changed +9
-5
lines changed Original file line number Diff line number Diff line change 44//! via `x.py dist hash-and-sign`; the cmdline arguments are set up
55//! by rustbuild (in `src/bootstrap/dist.rs`).
66
7+ #![ feature( try_blocks) ]
78#![ deny( warnings) ]
89
910use toml;
@@ -380,11 +381,14 @@ impl Builder {
380381 /// If a tool does not pass its tests, don't ship it.
381382 /// Right now, we do this only for Miri.
382383 fn check_toolstate ( & mut self ) {
383- // Get the toolstate for this rust revision.
384- let toolstates = File :: open ( self . input . join ( "toolstates-linux.json" ) )
385- . expect ( "failed to open toolstates file" ) ;
386- let toolstates: HashMap < String , String > = serde_json:: from_reader ( & toolstates)
387- . expect ( "toolstates file contains malformed JSON" ) ;
384+ let toolstates: Option < HashMap < String , String > > = try {
385+ let toolstates = File :: open ( self . input . join ( "toolstates-linux.json" ) ) . ok ( ) ?;
386+ serde_json:: from_reader ( & toolstates) . ok ( ) ?
387+ } ;
388+ let toolstates = toolstates. unwrap_or_else ( || {
389+ println ! ( "WARNING: `toolstates-linux.json` missing; assuming all tools failed" ) ;
390+ HashMap :: default ( ) // Use empty map if anything went wrong.
391+ } ) ;
388392 // Mark some tools as missing based on toolstate.
389393 if toolstates. get ( "miri" ) . map ( |s| & * s as & str ) != Some ( "test-pass" ) {
390394 println ! ( "Miri tests are not passing, removing component" ) ;
You can’t perform that action at this time.
0 commit comments