From b2afe07e2ba1cd20740ffe46a4e860f4aea92efb Mon Sep 17 00:00:00 2001 From: Manuel Drehwald Date: Thu, 23 Oct 2025 14:31:17 +0200 Subject: [PATCH] experimental shipping of more CMake files for Enzyme --- src/bootstrap/download-ci-llvm-stamp | 2 +- src/bootstrap/src/core/build_steps/dist.rs | 8 ++++++++ 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/src/bootstrap/download-ci-llvm-stamp b/src/bootstrap/download-ci-llvm-stamp index b70d452b427c8..b262a2b7e79b3 100644 --- a/src/bootstrap/download-ci-llvm-stamp +++ b/src/bootstrap/download-ci-llvm-stamp @@ -1,4 +1,4 @@ Change this file to make users of the `download-ci-llvm` configuration download a new version of LLVM from CI, even if the LLVM submodule hasn’t changed. -Last change is for: https://github.com/rust-lang/rust/pull/139931 +Last change is for: https://github.com/rust-lang/rust/pull/148027 diff --git a/src/bootstrap/src/core/build_steps/dist.rs b/src/bootstrap/src/core/build_steps/dist.rs index 411d42962644d..1e366e8d1d988 100644 --- a/src/bootstrap/src/core/build_steps/dist.rs +++ b/src/bootstrap/src/core/build_steps/dist.rs @@ -2582,6 +2582,14 @@ impl Step for RustDev { } } } + // The Enzyme(autodiff) cmake requires the LLVMConfig.cmake file to find tablegen + // and other utilities. We therefore also add all cmake files + // so that you can use the downloadable LLVM as if you’ve just run a full source build. + let cmake_dir = PathBuf::new().join("lib").join("cmake").join("llvm"); + let cmake_src_dir = builder.llvm_out(target).join(&cmake_dir); + if cmake_src_dir.exists() { + tarball.add_dir(cmake_src_dir, cmake_dir); + } if builder.config.lld_enabled { // We want to package `lld` to use it with `download-ci-llvm`.