@@ -15,7 +15,9 @@ use std::{cmp, env, fs};
1515
1616use build_helper:: ci:: CiEnv ;
1717use build_helper:: exit;
18- use build_helper:: git:: { GitConfig , PathFreshness , check_path_modifications, output_result} ;
18+ use build_helper:: git:: {
19+ GitConfig , PathFreshness , check_path_modifications, get_closest_merge_commit, output_result,
20+ } ;
1921use serde:: { Deserialize , Deserializer } ;
2022use serde_derive:: Deserialize ;
2123#[ cfg( feature = "tracing" ) ]
@@ -1910,6 +1912,7 @@ impl Config {
19101912 debug_assertions_requested,
19111913 config. llvm_assertions ,
19121914 ) ;
1915+ panic ! ( "DOWNLOAD_CI_RUSTC: {:?}" , config. download_rustc_commit) ;
19131916
19141917 debug = debug_toml;
19151918 rustc_debug_assertions = rustc_debug_assertions_toml;
@@ -2974,12 +2977,22 @@ impl Config {
29742977 // options.
29752978 if !CiEnv :: is_ci ( ) {
29762979 allowed_paths. push ( ":!library" ) ;
2980+ } else {
2981+ allowed_paths. push ( ":!src/bootstrap" ) ;
2982+ allowed_paths. push ( ":!.github" ) ;
2983+ allowed_paths. push ( ":!Cargo.lock" ) ;
2984+ allowed_paths. push ( ":!config.example.toml" ) ;
2985+ allowed_paths. push ( ":!license-metadata.json" ) ;
2986+ allowed_paths. push ( ":!triagebot.toml" ) ;
2987+ allowed_paths. push ( ":!src" ) ;
29772988 }
29782989
29792990 let commit = if self . rust_info . is_managed_git_subrepository ( ) {
29802991 // Look for a version to compare to based on the current commit.
29812992 // Only commits merged by bors will have CI artifacts.
2982- match self . check_modifications ( & allowed_paths) {
2993+ let modifications = self . check_modifications ( & allowed_paths) ;
2994+ eprintln ! ( "DOWNLOAD_CI_RUSTC freshness: {modifications:?}" ) ;
2995+ match modifications {
29832996 PathFreshness :: LastModifiedUpstream { upstream } => upstream,
29842997 PathFreshness :: HasLocalModifications { upstream } => {
29852998 if if_unchanged {
@@ -3020,6 +3033,35 @@ impl Config {
30203033 asserts : bool ,
30213034 ) -> bool {
30223035 let download_ci_llvm = download_ci_llvm. unwrap_or ( StringOrBool :: Bool ( true ) ) ;
3036+ let freshness = self . check_modifications ( & [
3037+ "src/llvm-project" ,
3038+ "src/bootstrap/download-ci-llvm-stamp" ,
3039+ "src/version" ,
3040+ ] ) ;
3041+ let sha = get_closest_merge_commit (
3042+ Some ( & self . src ) ,
3043+ & self . git_config ( ) ,
3044+ & [
3045+ self . src . join ( "src/llvm-project" ) ,
3046+ self . src . join ( "src/bootstrap/download-ci-llvm-stamp" ) ,
3047+ // the LLVM shared object file is named `LLVM-12-rust-{version}-nightly`
3048+ self . src . join ( "src/version" ) ,
3049+ ] ,
3050+ )
3051+ . unwrap ( ) ;
3052+ let head = String :: from_utf8 (
3053+ Command :: new ( "git" )
3054+ . current_dir ( & self . src )
3055+ . arg ( "rev-parse" )
3056+ . arg ( "HEAD" )
3057+ . output ( )
3058+ . unwrap ( )
3059+ . stdout ,
3060+ )
3061+ . unwrap ( )
3062+ . trim ( )
3063+ . to_string ( ) ;
3064+ eprintln ! ( "LLVM FRESHNESS: {freshness:?}\n Old git SHA: {sha}\n HEAD: {head}" ) ;
30233065
30243066 let if_unchanged = || {
30253067 if self . rust_info . is_from_tarball ( ) {
0 commit comments