@@ -2767,25 +2767,32 @@ impl Config {
27672767 }
27682768 } ;
27692769
2770- let files_to_track =
2771- & [ "compiler" , "library" , "src/version" , "src/stage0" , "src/ci/channel" ] ;
2770+ let mut files_to_track = vec ! [ "compiler" , "src/version" , "src/stage0" , "src/ci/channel" ] ;
2771+
2772+ // In CI, disable ci-rustc if there are changes in the library tree. But for non-CI, ignore
2773+ // these changes to speed up the build process for library developers. This provides consistent
2774+ // functionality for library developers between `download-rustc=true` and `download-rustc="if-unchanged"`
2775+ // options.
2776+ if CiEnv :: is_ci ( ) {
2777+ files_to_track. push ( "library" ) ;
2778+ }
27722779
27732780 // Look for a version to compare to based on the current commit.
27742781 // Only commits merged by bors will have CI artifacts.
2775- let commit = match self . last_modified_commit ( files_to_track, "download-rustc" , if_unchanged)
2776- {
2777- Some ( commit) => commit,
2778- None => {
2779- if if_unchanged {
2780- return None ;
2782+ let commit =
2783+ match self . last_modified_commit ( & files_to_track, "download-rustc" , if_unchanged) {
2784+ Some ( commit) => commit,
2785+ None => {
2786+ if if_unchanged {
2787+ return None ;
2788+ }
2789+ println ! ( "ERROR: could not find commit hash for downloading rustc" ) ;
2790+ println ! ( "HELP: maybe your repository history is too shallow?" ) ;
2791+ println ! ( "HELP: consider disabling `download-rustc`" ) ;
2792+ println ! ( "HELP: or fetch enough history to include one upstream commit" ) ;
2793+ crate :: exit!( 1 ) ;
27812794 }
2782- println ! ( "ERROR: could not find commit hash for downloading rustc" ) ;
2783- println ! ( "HELP: maybe your repository history is too shallow?" ) ;
2784- println ! ( "HELP: consider disabling `download-rustc`" ) ;
2785- println ! ( "HELP: or fetch enough history to include one upstream commit" ) ;
2786- crate :: exit!( 1 ) ;
2787- }
2788- } ;
2795+ } ;
27892796
27902797 if CiEnv :: is_ci ( ) && {
27912798 let head_sha =
0 commit comments