File tree 1 file changed +13
-0
lines changed
1 file changed +13
-0
lines changed Original file line number Diff line number Diff line change @@ -150,6 +150,19 @@ pub(crate) fn maybe_download_ci_llvm(builder: &Builder<'_>) {
150
150
for binary in [ "llvm-config" , "FileCheck" ] {
151
151
builder. fix_bin_or_dylib ( & llvm_root. join ( "bin" ) . join ( binary) ) ;
152
152
}
153
+
154
+ // Update the timestamp of llvm-config to force rustc_llvm to be
155
+ // rebuilt. This is a hacky workaround for a deficiency in Cargo where
156
+ // the rerun-if-changed directive doesn't handle changes very well.
157
+ // https://github.com/rust-lang/cargo/issues/10791
158
+ // Cargo only compares the timestamp of the file relative to the last
159
+ // time `rustc_llvm` build script ran. However, the timestamps of the
160
+ // files in the tarball are in the past, so it doesn't trigger a
161
+ // rebuild.
162
+ let now = filetime:: FileTime :: from_system_time ( std:: time:: SystemTime :: now ( ) ) ;
163
+ let llvm_config = llvm_root. join ( "bin/llvm-config" ) ;
164
+ t ! ( filetime:: set_file_times( & llvm_config, now, now) ) ;
165
+
153
166
let llvm_lib = llvm_root. join ( "lib" ) ;
154
167
for entry in t ! ( fs:: read_dir( & llvm_lib) ) {
155
168
let lib = t ! ( entry) . path ( ) ;
You can’t perform that action at this time.
0 commit comments