Skip to content

Commit db3b43d

Browse files
committed
move llvm_enzyme out of rust config, so that llvm_config initialization is preferred
1 parent d7c77e8 commit db3b43d

File tree

3 files changed

+8
-5
lines changed

3 files changed

+8
-5
lines changed

src/bootstrap/src/core/config/config.rs

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -718,7 +718,7 @@ impl Config {
718718
config.in_tree_llvm_info = config.git_info(false, &config.src.join("src/llvm-project"));
719719
config.in_tree_gcc_info = config.git_info(false, &config.src.join("src/gcc"));
720720

721-
toml.rust.as_ref().map(|rust| {
721+
if let Some(rust) = toml.rust.as_ref() {
722722
// FIXME(#133381): alt rustc builds currently do *not* have rustc debug assertions
723723
// enabled. We should not download a CI alt rustc if we need rustc to have debug
724724
// assertions (e.g. for crashes test suite). This can be changed once something like
@@ -749,7 +749,7 @@ impl Config {
749749
debug_assertions_requested,
750750
config.llvm_assertions,
751751
);
752-
});
752+
};
753753

754754
if !is_user_configured_rust_channel && config.rust_info.is_from_tarball() {
755755
config.channel = ci_channel.into();
@@ -795,9 +795,14 @@ impl Config {
795795
.collect::<Vec<PathBuf>>(),
796796
);
797797

798+
// Though we are applying it here, but the enzyme from llvm should get preference.
799+
config.llvm_enzyme =
800+
config.llvm_enzyme || config.channel == "dev" || config.channel == "nightly";
801+
798802
config.apply_install_config(toml.install);
799803
config.apply_gcc_config(toml.gcc);
800804
config.apply_dist_config(toml.dist);
805+
config.apply_llvm_config(toml.llvm);
801806

802807
config.apply_build_config(
803808
toml.build,
@@ -809,7 +814,6 @@ impl Config {
809814
);
810815
config.apply_target_config(toml.target);
811816
config.apply_rust_config(toml.rust, flags_warnings);
812-
config.apply_llvm_config(toml.llvm);
813817

814818
if config.llvm_from_ci {
815819
let triple = &config.host_target.triple;

src/bootstrap/src/core/config/toml/build.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -247,7 +247,7 @@ impl Config {
247247
.or_else(|| {
248248
host.map(|h| h.into_iter().map(|s| TargetSelection::from_user(&s)).collect())
249249
})
250-
.unwrap_or_else(|| vec![self.host_target.clone()]);
250+
.unwrap_or_else(|| vec![self.host_target]);
251251

252252
self.targets = flags_target
253253
.map(|TargetSelectionList(list)| list)

src/bootstrap/src/core/config/toml/rust.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -619,7 +619,6 @@ impl Config {
619619
self.rust_randomize_layout = randomize_layout.unwrap_or_default();
620620
self.llvm_tools_enabled = llvm_tools.unwrap_or(true);
621621

622-
self.llvm_enzyme = self.channel == "dev" || self.channel == "nightly";
623622
self.rustc_default_linker = default_linker;
624623
self.musl_root = musl_root.map(PathBuf::from);
625624
self.save_toolstates = save_toolstates.map(PathBuf::from);

0 commit comments

Comments
 (0)