File tree 2 files changed +10
-5
lines changed 2 files changed +10
-5
lines changed Original file line number Diff line number Diff line change @@ -105,13 +105,15 @@ pub fn prebuilt_llvm_config(
105
105
let llvm_cmake_dir = out_dir. join ( "lib/cmake/llvm" ) ;
106
106
let res = LlvmResult { llvm_config : build_llvm_config, llvm_cmake_dir } ;
107
107
108
- let smart_stamp_hash = generate_smart_stamp_hash (
109
- & builder. config . src . join ( "src/llvm-project" ) ,
110
- & builder. in_tree_llvm_info . sha ( ) . unwrap_or_default ( ) ,
111
- ) ;
108
+ let smart_stamp_hash = builder. llvm_stamp_hash . get_or_init ( || {
109
+ generate_smart_stamp_hash (
110
+ & builder. config . src . join ( "src/llvm-project" ) ,
111
+ & builder. in_tree_llvm_info . sha ( ) . unwrap_or_default ( ) ,
112
+ )
113
+ } ) ;
112
114
113
115
let stamp = out_dir. join ( "llvm-finished-building" ) ;
114
- let stamp = HashStamp :: new ( stamp, Some ( & smart_stamp_hash) ) ;
116
+ let stamp = HashStamp :: new ( stamp, Some ( smart_stamp_hash) ) ;
115
117
116
118
if stamp. is_done ( ) {
117
119
if stamp. hash . is_none ( ) {
Original file line number Diff line number Diff line change @@ -10,6 +10,7 @@ use std::io::{BufRead, BufReader};
10
10
use std:: ops:: Deref ;
11
11
use std:: path:: { Path , PathBuf } ;
12
12
use std:: process:: Command ;
13
+ use std:: sync:: OnceLock ;
13
14
use std:: time:: { Duration , Instant } ;
14
15
15
16
use crate :: core:: build_steps:: llvm;
@@ -44,6 +45,7 @@ pub struct Builder<'a> {
44
45
stack : RefCell < Vec < Box < dyn Any > > > ,
45
46
time_spent_on_dependencies : Cell < Duration > ,
46
47
pub paths : Vec < PathBuf > ,
48
+ pub ( crate ) llvm_stamp_hash : OnceLock < String > ,
47
49
}
48
50
49
51
impl < ' a > Deref for Builder < ' a > {
@@ -917,6 +919,7 @@ impl<'a> Builder<'a> {
917
919
stack : RefCell :: new ( Vec :: new ( ) ) ,
918
920
time_spent_on_dependencies : Cell :: new ( Duration :: new ( 0 , 0 ) ) ,
919
921
paths,
922
+ llvm_stamp_hash : OnceLock :: new ( ) ,
920
923
}
921
924
}
922
925
You can’t perform that action at this time.
0 commit comments