File tree Expand file tree Collapse file tree 5 files changed +21
-6
lines changed Expand file tree Collapse file tree 5 files changed +21
-6
lines changed Original file line number Diff line number Diff line change @@ -2022,6 +2022,7 @@ impl Step for Assemble {
20222022
20232023 let host_llvm_bin_dir = command ( & host_llvm_config)
20242024 . arg ( "--bindir" )
2025+ . cached ( )
20252026 . run_capture_stdout ( builder)
20262027 . stdout ( )
20272028 . trim ( )
Original file line number Diff line number Diff line change @@ -2269,6 +2269,7 @@ fn maybe_install_llvm(
22692269 {
22702270 trace ! ( "LLVM already built, installing LLVM files" ) ;
22712271 let mut cmd = command ( host_llvm_config) ;
2272+ cmd. cached ( ) ;
22722273 cmd. arg ( "--libfiles" ) ;
22732274 builder. verbose ( || println ! ( "running {cmd:?}" ) ) ;
22742275 let files = cmd. run_capture_stdout ( builder) . stdout ( ) ;
Original file line number Diff line number Diff line change @@ -486,8 +486,11 @@ impl Step for Llvm {
486486 let LlvmResult { host_llvm_config, .. } =
487487 builder. ensure ( Llvm { target : builder. config . host_target } ) ;
488488 if !builder. config . dry_run ( ) {
489- let llvm_bindir =
490- command ( & host_llvm_config) . arg ( "--bindir" ) . run_capture_stdout ( builder) . stdout ( ) ;
489+ let llvm_bindir = command ( & host_llvm_config)
490+ . arg ( "--bindir" )
491+ . cached ( )
492+ . run_capture_stdout ( builder)
493+ . stdout ( ) ;
491494 let host_bin = Path :: new ( llvm_bindir. trim ( ) ) ;
492495 cfg. define (
493496 "LLVM_TABLEGEN" ,
@@ -593,7 +596,13 @@ impl Step for Llvm {
593596}
594597
595598pub fn get_llvm_version ( builder : & Builder < ' _ > , llvm_config : & Path ) -> String {
596- command ( llvm_config) . arg ( "--version" ) . run_capture_stdout ( builder) . stdout ( ) . trim ( ) . to_owned ( )
599+ command ( llvm_config)
600+ . arg ( "--version" )
601+ . cached ( )
602+ . run_capture_stdout ( builder)
603+ . stdout ( )
604+ . trim ( )
605+ . to_owned ( )
597606}
598607
599608pub fn get_llvm_version_major ( builder : & Builder < ' _ > , llvm_config : & Path ) -> u8 {
Original file line number Diff line number Diff line change @@ -2043,6 +2043,7 @@ HELP: You can add it into `bootstrap.toml` in `rust.codegen-backends = [{name:?}
20432043 if !builder. config . dry_run ( ) {
20442044 let llvm_version = get_llvm_version ( builder, & host_llvm_config) ;
20452045 let llvm_components = command ( & host_llvm_config)
2046+ . cached ( )
20462047 . arg ( "--components" )
20472048 . run_capture_stdout ( builder)
20482049 . stdout ( ) ;
@@ -2062,8 +2063,11 @@ HELP: You can add it into `bootstrap.toml` in `rust.codegen-backends = [{name:?}
20622063 // separate compilations. We can add LLVM's library path to the
20632064 // rustc args as a workaround.
20642065 if !builder. config . dry_run ( ) && suite. ends_with ( "fulldeps" ) {
2065- let llvm_libdir =
2066- command ( & host_llvm_config) . arg ( "--libdir" ) . run_capture_stdout ( builder) . stdout ( ) ;
2066+ let llvm_libdir = command ( & host_llvm_config)
2067+ . cached ( )
2068+ . arg ( "--libdir" )
2069+ . run_capture_stdout ( builder)
2070+ . stdout ( ) ;
20672071 let link_llvm = if target. is_msvc ( ) {
20682072 format ! ( "-Clink-arg=-LIBPATH:{llvm_libdir}" )
20692073 } else {
Original file line number Diff line number Diff line change @@ -1082,7 +1082,7 @@ impl Builder<'_> {
10821082 && let Some ( llvm_config) = self . llvm_config ( target)
10831083 {
10841084 let llvm_libdir =
1085- command ( llvm_config) . arg ( "--libdir" ) . run_capture_stdout ( self ) . stdout ( ) ;
1085+ command ( llvm_config) . cached ( ) . arg ( "--libdir" ) . run_capture_stdout ( self ) . stdout ( ) ;
10861086 if target. is_msvc ( ) {
10871087 rustflags. arg ( & format ! ( "-Clink-arg=-LIBPATH:{llvm_libdir}" ) ) ;
10881088 } else {
You can’t perform that action at this time.
0 commit comments