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 9f274ba

Browse files
committedMar 15, 2025
Auto merge of #137665 - Kobzol:update-sccache, r=marcoieni
Update sccache to 0.10.0 This time, does it also for Windows and macOS. This unifies the sccache version across all OSes that we use. 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 try-job: dist-x86_64-linux try-job: dist-x86_64-netbsd
2 parents 4d30011 + 7d141dc commit 9f274ba

File tree

7 files changed

+17
-103
lines changed

7 files changed

+17
-103
lines changed
 

‎src/bootstrap/Cargo.toml

-5
Original file line numberDiff line numberDiff line change
@@ -28,11 +28,6 @@ name = "rustdoc"
2828
path = "src/bin/rustdoc.rs"
2929
test = false
3030

31-
[[bin]]
32-
name = "sccache-plus-cl"
33-
path = "src/bin/sccache-plus-cl.rs"
34-
test = false
35-
3631
[dependencies]
3732
# Most of the time updating these dependencies requires modifications to the
3833
# bootstrap codebase(e.g., https://github.com/rust-lang/rust/issues/124565);

‎src/bootstrap/src/bin/sccache-plus-cl.rs

-43
This file was deleted.

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

+1-1
Original file line numberDiff line numberDiff line change
@@ -2378,7 +2378,7 @@ impl Step for Bootstrap {
23782378
let tarball = Tarball::new(builder, "bootstrap", &target.triple);
23792379

23802380
let bootstrap_outdir = &builder.bootstrap_out;
2381-
for file in &["bootstrap", "rustc", "rustdoc", "sccache-plus-cl"] {
2381+
for file in &["bootstrap", "rustc", "rustdoc"] {
23822382
tarball.add_file(bootstrap_outdir.join(exe(file, target)), "bootstrap/bin", 0o755);
23832383
}
23842384

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

+9-49
Original file line numberDiff line numberDiff line change
@@ -735,57 +735,17 @@ fn configure_cmake(
735735
None => (builder.cc(target), builder.cxx(target).unwrap()),
736736
};
737737

738-
// 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-
}
738+
// If ccache is configured we inform the build a little differently how
739+
// to invoke ccache while also invoking our compilers.
740+
if use_compiler_launcher {
741+
if let Some(ref ccache) = builder.config.ccache {
742+
cfg.define("CMAKE_C_COMPILER_LAUNCHER", ccache)
743+
.define("CMAKE_CXX_COMPILER_LAUNCHER", ccache);
784744
}
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));
788745
}
746+
cfg.define("CMAKE_C_COMPILER", sanitize_cc(&cc))
747+
.define("CMAKE_CXX_COMPILER", sanitize_cc(&cxx))
748+
.define("CMAKE_ASM_COMPILER", sanitize_cc(&cc));
789749

790750
cfg.build_arg("-j").build_arg(builder.jobs().to_string());
791751
// 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/run.sh

+1-1
Original file line numberDiff line numberDiff line change
@@ -261,5 +261,5 @@ else
261261
fi
262262

263263
echo "::group::sccache stats"
264-
sccache --show-stats || true
264+
sccache --show-adv-stats || true
265265
echo "::endgroup::"

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

+4-2
Original file line numberDiff line numberDiff line change
@@ -8,11 +8,13 @@ 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 \
12+
"${MIRRORS_BASE}/2025-02-24-sccache-v0.10.0-x86_64-apple-darwin"
1213
chmod +x /usr/local/bin/sccache
1314
elif isWindows; then
1415
mkdir -p sccache
15-
curl -fo sccache/sccache.exe "${MIRRORS_BASE}/2018-04-26-sccache-x86_64-pc-windows-msvc"
16+
curl -fo sccache/sccache.exe \
17+
"${MIRRORS_BASE}/2025-02-24-sccache-v0.10.0-x86_64-pc-windows-msvc.exe"
1618
ciCommandAddPath "$(pwd)/sccache"
1719
fi
1820

0 commit comments

Comments
 (0)
Failed to load comments.