File tree Expand file tree Collapse file tree 1 file changed +9
-1
lines changed
src/bootstrap/src/core/build_steps Expand file tree Collapse file tree 1 file changed +9
-1
lines changed Original file line number Diff line number Diff line change @@ -2047,7 +2047,15 @@ fn install_llvm_file(
20472047 // projects like miri link against librustc_driver.so. We don't use a symlink, as
20482048 // these are not allowed inside rustup components.
20492049 let link = t ! ( fs:: read_link( source) ) ;
2050- t ! ( std:: fs:: write( full_dest, format!( "INPUT({})\n " , link. display( ) ) ) ) ;
2050+ let mut linker_script = t ! ( fs:: File :: create( full_dest) ) ;
2051+ t ! ( write!( linker_script, "INPUT({})\n " , link. display( ) ) ) ;
2052+
2053+ // We also want the linker script to have the same mtime as the source, otherwise it
2054+ // can trigger rebuilds.
2055+ let meta = t ! ( fs:: metadata( source) ) ;
2056+ if let Ok ( mtime) = meta. modified ( ) {
2057+ t ! ( linker_script. set_modified( mtime) ) ;
2058+ }
20512059 }
20522060 } else {
20532061 builder. install ( & source, destination, 0o644 ) ;
You can’t perform that action at this time.
0 commit comments