@@ -15,7 +15,6 @@ use std::path::{Path, PathBuf};
15
15
use std:: process:: Stdio ;
16
16
use std:: { env, fs, str} ;
17
17
18
- use build_helper:: git:: get_closest_merge_commit;
19
18
use serde_derive:: Deserialize ;
20
19
21
20
use crate :: core:: build_steps:: tool:: SourceType ;
@@ -27,7 +26,7 @@ use crate::core::builder::{
27
26
use crate :: core:: config:: { DebuginfoLevel , LlvmLibunwind , RustcLto , TargetSelection } ;
28
27
use crate :: utils:: exec:: command;
29
28
use 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,
31
30
} ;
32
31
use crate :: { CLang , Compiler , DependencyType , GitRepo , LLVM_TOOLS , Mode } ;
33
32
@@ -125,23 +124,9 @@ impl Step for Std {
125
124
// Force compilation of the standard library from source if the `library` is modified. This allows
126
125
// library team to compile the standard library without needing to compile the compiler with
127
126
// 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( builder. src. join( "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 ( ) ;
145
130
146
131
run. builder . ensure ( Std {
147
132
compiler : run. builder . compiler ( run. builder . top_stage , run. build_triple ( ) ) ,
0 commit comments