Skip to content
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.

Commit 4c13ee2

Browse files
committedFeb 26, 2025
Auto merge of #137665 - Kobzol:update-sccache, r=<try>
Update sccache to 0.10.0 This time, does it also for Windows and macOS. r? `@ghost` try-job: dist-aarch64-apple try-job: dist-x86_64-apple try-job: dist-x86_64-msvc try-job: dist-x86_64-msvc-alt try-job: dist-i686-msvc try-job: dist-aarch64-msvc
2 parents ac91805 + e21ce6e commit 4c13ee2

File tree

3 files changed

+52
-52
lines changed

3 files changed

+52
-52
lines changed
 

‎src/bootstrap/src/core/build_steps/llvm.rs

+48-48
Original file line numberDiff line numberDiff line change
@@ -736,56 +736,56 @@ fn configure_cmake(
736736
};
737737

738738
// Handle msvc + ninja + ccache specially (this is what the bots use)
739-
if target.is_msvc() && builder.ninja() && builder.config.ccache.is_some() {
740-
let mut wrap_cc = env::current_exe().expect("failed to get cwd");
741-
wrap_cc.set_file_name("sccache-plus-cl.exe");
742-
743-
cfg.define("CMAKE_C_COMPILER", sanitize_cc(&wrap_cc))
744-
.define("CMAKE_CXX_COMPILER", sanitize_cc(&wrap_cc));
745-
cfg.env("SCCACHE_PATH", builder.config.ccache.as_ref().unwrap())
746-
.env("SCCACHE_TARGET", target.triple)
747-
.env("SCCACHE_CC", &cc)
748-
.env("SCCACHE_CXX", &cxx);
749-
750-
// Building LLVM on MSVC can be a little ludicrous at times. We're so far
751-
// off the beaten path here that I'm not really sure this is even half
752-
// supported any more. Here we're trying to:
753-
//
754-
// * Build LLVM on MSVC
755-
// * Build LLVM with `clang-cl` instead of `cl.exe`
756-
// * Build a project with `sccache`
757-
// * Build for 32-bit as well
758-
// * Build with Ninja
759-
//
760-
// For `cl.exe` there are different binaries to compile 32/64 bit which
761-
// we use but for `clang-cl` there's only one which internally
762-
// multiplexes via flags. As a result it appears that CMake's detection
763-
// of a compiler's architecture and such on MSVC **doesn't** pass any
764-
// custom flags we pass in CMAKE_CXX_FLAGS below. This means that if we
765-
// use `clang-cl.exe` it's always diagnosed as a 64-bit compiler which
766-
// definitely causes problems since all the env vars are pointing to
767-
// 32-bit libraries.
768-
//
769-
// To hack around this... again... we pass an argument that's
770-
// unconditionally passed in the sccache shim. This'll get CMake to
771-
// correctly diagnose it's doing a 32-bit compilation and LLVM will
772-
// internally configure itself appropriately.
773-
if builder.config.llvm_clang_cl.is_some() && target.contains("i686") {
774-
cfg.env("SCCACHE_EXTRA_ARGS", "-m32");
775-
}
776-
} else {
777-
// If ccache is configured we inform the build a little differently how
778-
// to invoke ccache while also invoking our compilers.
779-
if use_compiler_launcher {
780-
if let Some(ref ccache) = builder.config.ccache {
781-
cfg.define("CMAKE_C_COMPILER_LAUNCHER", ccache)
782-
.define("CMAKE_CXX_COMPILER_LAUNCHER", ccache);
783-
}
739+
// if target.is_msvc() && builder.ninja() && builder.config.ccache.is_some() {
740+
// let mut wrap_cc = env::current_exe().expect("failed to get cwd");
741+
// wrap_cc.set_file_name("sccache-plus-cl.exe");
742+
//
743+
// cfg.define("CMAKE_C_COMPILER", sanitize_cc(&wrap_cc))
744+
// .define("CMAKE_CXX_COMPILER", sanitize_cc(&wrap_cc));
745+
// cfg.env("SCCACHE_PATH", builder.config.ccache.as_ref().unwrap())
746+
// .env("SCCACHE_TARGET", target.triple)
747+
// .env("SCCACHE_CC", &cc)
748+
// .env("SCCACHE_CXX", &cxx);
749+
//
750+
// // Building LLVM on MSVC can be a little ludicrous at times. We're so far
751+
// // off the beaten path here that I'm not really sure this is even half
752+
// // supported any more. Here we're trying to:
753+
// //
754+
// // * Build LLVM on MSVC
755+
// // * Build LLVM with `clang-cl` instead of `cl.exe`
756+
// // * Build a project with `sccache`
757+
// // * Build for 32-bit as well
758+
// // * Build with Ninja
759+
// //
760+
// // For `cl.exe` there are different binaries to compile 32/64 bit which
761+
// // we use but for `clang-cl` there's only one which internally
762+
// // multiplexes via flags. As a result it appears that CMake's detection
763+
// // of a compiler's architecture and such on MSVC **doesn't** pass any
764+
// // custom flags we pass in CMAKE_CXX_FLAGS below. This means that if we
765+
// // use `clang-cl.exe` it's always diagnosed as a 64-bit compiler which
766+
// // definitely causes problems since all the env vars are pointing to
767+
// // 32-bit libraries.
768+
// //
769+
// // To hack around this... again... we pass an argument that's
770+
// // unconditionally passed in the sccache shim. This'll get CMake to
771+
// // correctly diagnose it's doing a 32-bit compilation and LLVM will
772+
// // internally configure itself appropriately.
773+
// if builder.config.llvm_clang_cl.is_some() && target.contains("i686") {
774+
// cfg.env("SCCACHE_EXTRA_ARGS", "-m32");
775+
// }
776+
// } else {
777+
// If ccache is configured we inform the build a little differently how
778+
// to invoke ccache while also invoking our compilers.
779+
if use_compiler_launcher {
780+
if let Some(ref ccache) = builder.config.ccache {
781+
cfg.define("CMAKE_C_COMPILER_LAUNCHER", ccache)
782+
.define("CMAKE_CXX_COMPILER_LAUNCHER", ccache);
784783
}
785-
cfg.define("CMAKE_C_COMPILER", sanitize_cc(&cc))
786-
.define("CMAKE_CXX_COMPILER", sanitize_cc(&cxx))
787-
.define("CMAKE_ASM_COMPILER", sanitize_cc(&cc));
788784
}
785+
cfg.define("CMAKE_C_COMPILER", sanitize_cc(&cc))
786+
.define("CMAKE_CXX_COMPILER", sanitize_cc(&cxx))
787+
.define("CMAKE_ASM_COMPILER", sanitize_cc(&cc));
788+
// }
789789

790790
cfg.build_arg("-j").build_arg(builder.jobs().to_string());
791791
// FIXME(madsmtm): Allow `cmake-rs` to select flags by itself by passing

‎src/ci/docker/scripts/sccache.sh

+2-2
Original file line numberDiff line numberDiff line change
@@ -6,10 +6,10 @@ set -ex
66

77
case "$(uname -m)" in
88
x86_64)
9-
url="https://ci-mirrors.rust-lang.org/rustc/2025-01-07-sccache-v0.9.1-x86_64-unknown-linux-musl"
9+
url="https://ci-mirrors.rust-lang.org/rustc/2025-02-24-sccache-v0.10.0-x86_64-unknown-linux-musl"
1010
;;
1111
aarch64)
12-
url="https://ci-mirrors.rust-lang.org/rustc/2025-01-07-sccache-v0.9.1-aarch64-unknown-linux-musl"
12+
url="https://ci-mirrors.rust-lang.org/rustc/2025-02-24-sccache-v0.10.0-aarch64-unknown-linux-musl"
1313
;;
1414
*)
1515
echo "unsupported architecture: $(uname -m)"

‎src/ci/scripts/install-sccache.sh

+2-2
Original file line numberDiff line numberDiff line change
@@ -8,11 +8,11 @@ IFS=$'\n\t'
88
source "$(cd "$(dirname "$0")" && pwd)/../shared.sh"
99

1010
if isMacOS; then
11-
curl -fo /usr/local/bin/sccache "${MIRRORS_BASE}/2021-08-25-sccache-v0.2.15-x86_64-apple-darwin"
11+
curl -fo /usr/local/bin/sccache "${MIRRORS_BASE}/2025-02-24-sccache-v0.10.0-x86_64-apple-darwin"
1212
chmod +x /usr/local/bin/sccache
1313
elif isWindows; then
1414
mkdir -p sccache
15-
curl -fo sccache/sccache.exe "${MIRRORS_BASE}/2018-04-26-sccache-x86_64-pc-windows-msvc"
15+
curl -fo sccache/sccache.exe "${MIRRORS_BASE}/2025-02-24-sccache-v0.10.0-x86_64-pc-windows-msvc.exe"
1616
ciCommandAddPath "$(pwd)/sccache"
1717
fi
1818

0 commit comments

Comments
 (0)
Failed to load comments.