@@ -1663,10 +1663,26 @@ impl Config {
16631663 let mut debuginfo_level_tools = None ;
16641664 let mut debuginfo_level_tests = None ;
16651665 let mut optimize = None ;
1666- let mut omit_git_hash = None ;
16671666 let mut lld_enabled = None ;
16681667 let mut std_features = None ;
16691668
1669+ let default = config. channel == "dev" ;
1670+ config. omit_git_hash = toml. rust . as_ref ( ) . and_then ( |r| r. omit_git_hash ) . unwrap_or ( default) ;
1671+
1672+ config. rust_info = GitInfo :: new ( config. omit_git_hash , & config. src ) ;
1673+ config. cargo_info = GitInfo :: new ( config. omit_git_hash , & config. src . join ( "src/tools/cargo" ) ) ;
1674+ config. rust_analyzer_info =
1675+ GitInfo :: new ( config. omit_git_hash , & config. src . join ( "src/tools/rust-analyzer" ) ) ;
1676+ config. clippy_info =
1677+ GitInfo :: new ( config. omit_git_hash , & config. src . join ( "src/tools/clippy" ) ) ;
1678+ config. miri_info = GitInfo :: new ( config. omit_git_hash , & config. src . join ( "src/tools/miri" ) ) ;
1679+ config. rustfmt_info =
1680+ GitInfo :: new ( config. omit_git_hash , & config. src . join ( "src/tools/rustfmt" ) ) ;
1681+ config. enzyme_info =
1682+ GitInfo :: new ( config. omit_git_hash , & config. src . join ( "src/tools/enzyme" ) ) ;
1683+ config. in_tree_llvm_info = GitInfo :: new ( false , & config. src . join ( "src/llvm-project" ) ) ;
1684+ config. in_tree_gcc_info = GitInfo :: new ( false , & config. src . join ( "src/gcc" ) ) ;
1685+
16701686 let mut is_user_configured_rust_channel = false ;
16711687
16721688 if let Some ( rust) = toml. rust {
@@ -1697,7 +1713,7 @@ impl Config {
16971713 verbose_tests,
16981714 optimize_tests,
16991715 codegen_tests,
1700- omit_git_hash : omit_git_hash_toml ,
1716+ omit_git_hash : _ , // already handled above
17011717 dist_src,
17021718 save_toolstates,
17031719 codegen_backends,
@@ -1748,7 +1764,6 @@ impl Config {
17481764 std_features = std_features_toml;
17491765
17501766 optimize = optimize_toml;
1751- omit_git_hash = omit_git_hash_toml;
17521767 config. rust_new_symbol_mangling = new_symbol_mangling;
17531768 set ( & mut config. rust_optimize_tests , optimize_tests) ;
17541769 set ( & mut config. codegen_tests , codegen_tests) ;
@@ -1824,24 +1839,6 @@ impl Config {
18241839
18251840 config. reproducible_artifacts = flags. reproducible_artifact ;
18261841
1827- // rust_info must be set before is_ci_llvm_available() is called.
1828- let default = config. channel == "dev" ;
1829- config. omit_git_hash = omit_git_hash. unwrap_or ( default) ;
1830- config. rust_info = GitInfo :: new ( config. omit_git_hash , & config. src ) ;
1831-
1832- config. cargo_info = GitInfo :: new ( config. omit_git_hash , & config. src . join ( "src/tools/cargo" ) ) ;
1833- config. rust_analyzer_info =
1834- GitInfo :: new ( config. omit_git_hash , & config. src . join ( "src/tools/rust-analyzer" ) ) ;
1835- config. clippy_info =
1836- GitInfo :: new ( config. omit_git_hash , & config. src . join ( "src/tools/clippy" ) ) ;
1837- config. miri_info = GitInfo :: new ( config. omit_git_hash , & config. src . join ( "src/tools/miri" ) ) ;
1838- config. rustfmt_info =
1839- GitInfo :: new ( config. omit_git_hash , & config. src . join ( "src/tools/rustfmt" ) ) ;
1840- config. enzyme_info =
1841- GitInfo :: new ( config. omit_git_hash , & config. src . join ( "src/tools/enzyme" ) ) ;
1842- config. in_tree_llvm_info = GitInfo :: new ( false , & config. src . join ( "src/llvm-project" ) ) ;
1843- config. in_tree_gcc_info = GitInfo :: new ( false , & config. src . join ( "src/gcc" ) ) ;
1844-
18451842 // We need to override `rust.channel` if it's manually specified when using the CI rustc.
18461843 // This is because if the compiler uses a different channel than the one specified in config.toml,
18471844 // tests may fail due to using a different channel than the one used by the compiler during tests.
0 commit comments