@@ -1663,10 +1663,26 @@ impl Config {
1663
1663
let mut debuginfo_level_tools = None ;
1664
1664
let mut debuginfo_level_tests = None ;
1665
1665
let mut optimize = None ;
1666
- let mut omit_git_hash = None ;
1667
1666
let mut lld_enabled = None ;
1668
1667
let mut std_features = None ;
1669
1668
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
+
1670
1686
let mut is_user_configured_rust_channel = false ;
1671
1687
1672
1688
if let Some ( rust) = toml. rust {
@@ -1697,7 +1713,7 @@ impl Config {
1697
1713
verbose_tests,
1698
1714
optimize_tests,
1699
1715
codegen_tests,
1700
- omit_git_hash : omit_git_hash_toml ,
1716
+ omit_git_hash : _ , // already handled above
1701
1717
dist_src,
1702
1718
save_toolstates,
1703
1719
codegen_backends,
@@ -1748,7 +1764,6 @@ impl Config {
1748
1764
std_features = std_features_toml;
1749
1765
1750
1766
optimize = optimize_toml;
1751
- omit_git_hash = omit_git_hash_toml;
1752
1767
config. rust_new_symbol_mangling = new_symbol_mangling;
1753
1768
set ( & mut config. rust_optimize_tests , optimize_tests) ;
1754
1769
set ( & mut config. codegen_tests , codegen_tests) ;
@@ -1824,24 +1839,6 @@ impl Config {
1824
1839
1825
1840
config. reproducible_artifacts = flags. reproducible_artifact ;
1826
1841
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
-
1845
1842
// We need to override `rust.channel` if it's manually specified when using the CI rustc.
1846
1843
// This is because if the compiler uses a different channel than the one specified in config.toml,
1847
1844
// tests may fail due to using a different channel than the one used by the compiler during tests.
0 commit comments