@@ -503,7 +503,15 @@ fn setup_rustc(env: &mut Env, args: &TestArg) -> Result<(), String> {
503
503
Some ( commit_hash) => commit_hash,
504
504
None => return Err ( "Couldn't retrieve rustc commit hash" . to_string ( ) ) ,
505
505
} ;
506
- run_command_with_output_and_env ( & [ & "git" , & "checkout" , & rustc_commit] , rust_dir, Some ( env) ) ?;
506
+ if rustc_commit != "unknown" {
507
+ run_command_with_output_and_env (
508
+ & [ & "git" , & "checkout" , & rustc_commit] ,
509
+ rust_dir,
510
+ Some ( env) ,
511
+ ) ?;
512
+ } else {
513
+ run_command_with_output_and_env ( & [ & "git" , & "checkout" ] , rust_dir, Some ( env) ) ?;
514
+ }
507
515
let cargo = String :: from_utf8 (
508
516
run_command_with_env ( & [ & "rustup" , & "which" , & "cargo" ] , rust_dir, Some ( env) ) ?. stdout ,
509
517
)
@@ -516,23 +524,25 @@ fn setup_rustc(env: &mut Env, args: &TestArg) -> Result<(), String> {
516
524
Ok ( cargo)
517
525
}
518
526
} ) ?;
519
- let llvm_filecheck = String :: from_utf8 (
520
- run_command_with_env (
521
- & [
522
- & "bash" ,
523
- & "-c" ,
524
- & "which FileCheck-10 || \
527
+ let llvm_filecheck = match run_command_with_env (
528
+ & [
529
+ & "bash" ,
530
+ & "-c" ,
531
+ & "which FileCheck-10 || \
525
532
which FileCheck-11 || \
526
533
which FileCheck-12 || \
527
534
which FileCheck-13 || \
528
535
which FileCheck-14",
529
- ] ,
530
- rust_dir,
531
- Some ( env) ,
532
- ) ?
533
- . stdout ,
534
- )
535
- . map_err ( |error| format ! ( "Failed to retrieve LLVM FileCheck: {:?}" , error) ) ?;
536
+ ] ,
537
+ rust_dir,
538
+ Some ( env) ,
539
+ ) {
540
+ Ok ( cmd) => String :: from_utf8_lossy ( & cmd. stdout ) . to_string ( ) ,
541
+ Err ( _) => {
542
+ eprintln ! ( "Failed to retrieve LLVM FileCheck, ignoring..." ) ;
543
+ String :: new ( )
544
+ }
545
+ } ;
536
546
std:: fs:: write (
537
547
"rust/config.toml" ,
538
548
& format ! (
0 commit comments