@@ -15,7 +15,6 @@ use std::path::{Path, PathBuf};
1515use std:: process:: Stdio ;
1616use std:: { env, fs, str} ;
1717
18- use build_helper:: git:: get_closest_merge_commit;
1918use serde_derive:: Deserialize ;
2019
2120use crate :: core:: build_steps:: tool:: SourceType ;
@@ -27,7 +26,7 @@ use crate::core::builder::{
2726use crate :: core:: config:: { DebuginfoLevel , LlvmLibunwind , RustcLto , TargetSelection } ;
2827use crate :: utils:: exec:: command;
2928use crate :: utils:: helpers:: {
30- self , exe, get_clang_cl_resource_dir, is_debug_info, is_dylib, symlink_dir, t, up_to_date,
29+ exe, get_clang_cl_resource_dir, is_debug_info, is_dylib, symlink_dir, t, up_to_date,
3130} ;
3231use crate :: { CLang , Compiler , DependencyType , GitRepo , LLVM_TOOLS , Mode } ;
3332
@@ -125,23 +124,9 @@ impl Step for Std {
125124 // Force compilation of the standard library from source if the `library` is modified. This allows
126125 // library team to compile the standard library without needing to compile the compiler with
127126 // the `rust.download-rustc=true` option.
128- let force_recompile =
129- if builder. rust_info ( ) . is_managed_git_subrepository ( ) && builder. download_rustc ( ) {
130- let closest_merge_commit =
131- get_closest_merge_commit ( Some ( & builder. src ) , & builder. config . git_config ( ) , & [ ] )
132- . unwrap ( ) ;
133-
134- // Check if `library` has changes (returns false otherwise)
135- !t ! ( helpers:: git( Some ( & builder. src) )
136- . args( [ "diff-index" , "--quiet" , & closest_merge_commit] )
137- . arg( "--" )
138- . arg( "library" )
139- . as_command_mut( )
140- . status( ) )
141- . success ( )
142- } else {
143- false
144- } ;
127+ let force_recompile = builder. rust_info ( ) . is_managed_git_subrepository ( )
128+ && builder. download_rustc ( )
129+ && builder. config . last_modified_commit ( & [ "library" ] , "download-rustc" , true ) . is_none ( ) ;
145130
146131 run. builder . ensure ( Std {
147132 compiler : run. builder . compiler ( run. builder . top_stage , run. build_triple ( ) ) ,
0 commit comments