From 0f128d1316d0ba2d3e2cb8d40b19f4567c5006e1 Mon Sep 17 00:00:00 2001 From: Kornel Date: Mon, 15 Dec 2025 18:33:50 +0000 Subject: [PATCH 1/6] Avoid unused structs with dist-server disabled --- src/dist/http.rs | 27 +++++++++++++++------------ 1 file changed, 15 insertions(+), 12 deletions(-) diff --git a/src/dist/http.rs b/src/dist/http.rs index 059aac62a8..566b30224f 100644 --- a/src/dist/http.rs +++ b/src/dist/http.rs @@ -25,7 +25,6 @@ mod common { use serde::{Deserialize, Serialize}; #[cfg(feature = "dist-server")] use std::collections::HashMap; - use std::fmt; use crate::dist; @@ -93,13 +92,6 @@ mod common { } } - #[derive(Clone, Debug, Serialize, Deserialize, Eq, PartialEq)] - #[serde(deny_unknown_fields)] - pub struct JobJwt { - pub exp: u64, - pub job_id: dist::JobId, - } - #[derive(Clone, Debug, Serialize, Deserialize)] #[serde(deny_unknown_fields)] pub enum AllocJobHttpResponse { @@ -150,6 +142,7 @@ mod common { pub cert_pem: Vec, } + #[cfg(feature = "dist-server")] #[derive(Clone, Serialize, Deserialize)] #[serde(deny_unknown_fields)] pub struct HeartbeatServerHttpRequest { @@ -159,9 +152,11 @@ mod common { pub cert_digest: Vec, pub cert_pem: Vec, } + + #[cfg(feature = "dist-server")] // cert_pem is quite long so elide it (you can retrieve it by hitting the server url anyway) - impl fmt::Debug for HeartbeatServerHttpRequest { - fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result { + impl std::fmt::Debug for HeartbeatServerHttpRequest { + fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { let HeartbeatServerHttpRequest { jwt_key, num_cpus, @@ -256,7 +251,7 @@ mod server { use flate2::read::ZlibDecoder as ZlibReadDecoder; use rand::{RngCore, rngs::OsRng}; use rouille::accept; - use serde::Serialize; + use serde::{Deserialize, Serialize}; use std::collections::HashMap; use std::convert::Infallible; use std::io::Read; @@ -268,7 +263,7 @@ mod server { use std::time::Duration; use super::common::{ - AllocJobHttpResponse, HeartbeatServerHttpRequest, JobJwt, ReqwestRequestBuilderExt, + AllocJobHttpResponse, HeartbeatServerHttpRequest, ReqwestRequestBuilderExt, RunJobHttpRequest, ServerCertificateHttpResponse, }; use super::urls; @@ -598,6 +593,14 @@ mod server { } }}; } + + #[derive(Clone, Debug, Serialize, Deserialize, Eq, PartialEq)] + #[serde(deny_unknown_fields)] + struct JobJwt { + pub exp: u64, + pub job_id: dist::JobId, + } + // Generation and verification of job auth struct JWTJobAuthorizer { server_key: Vec, From 6d36447446fd7a85d1890321df5130edd5444a2a Mon Sep 17 00:00:00 2001 From: Kornel Date: Mon, 15 Dec 2025 18:50:41 +0000 Subject: [PATCH 2/6] Proper function pointer to int cast --- src/util.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/util.rs b/src/util.rs index 888c28f86d..fbff5ce410 100644 --- a/src/util.rs +++ b/src/util.rs @@ -883,7 +883,7 @@ pub fn daemonize() -> Result<()> { PREV_SIGBUS = Box::into_raw(Box::new(mem::zeroed::())); PREV_SIGILL = Box::into_raw(Box::new(mem::zeroed::())); let mut new: libc::sigaction = mem::zeroed(); - new.sa_sigaction = handler as usize; + new.sa_sigaction = (handler as *const libc::c_void).expose_provenance(); new.sa_flags = libc::SA_SIGINFO | libc::SA_RESTART; libc::sigaction(libc::SIGSEGV, &new, &mut *PREV_SIGSEGV); libc::sigaction(libc::SIGBUS, &new, &mut *PREV_SIGBUS); From f04b7f5c609c01455eb62727f1c4356f2e42694c Mon Sep 17 00:00:00 2001 From: Kornel Date: Mon, 15 Dec 2025 19:09:04 +0000 Subject: [PATCH 3/6] GitHub dropped macos-13 runners --- .github/workflows/ci.yml | 5 ----- 1 file changed, 5 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index bac2fd755e..dde321a053 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -96,8 +96,6 @@ jobs: # Oldest supported version, keep in sync with README.md rustc: "1.85.0" extra_desc: cuda12.8 - - os: macos-13 - no_coverage: true # # M1 CPU - os: macos-14 - os: windows-2022 @@ -249,9 +247,6 @@ jobs: - os: ubuntu-22.04 target: i686-unknown-linux-musl container: '{"image": "messense/rust-musl-cross:i686-musl"}' - - os: macos-13 - target: x86_64-apple-darwin - macosx_deployment_target: 10.13 - os: macos-14 target: aarch64-apple-darwin macosx_deployment_target: 11.0 From 36e84d0c0476461f1be143cad2f0387a245d2d99 Mon Sep 17 00:00:00 2001 From: Kornel Date: Mon, 15 Dec 2025 19:06:21 +0000 Subject: [PATCH 4/6] Avoid 'No space left on device' errors in CI --- .github/workflows/ci.yml | 1 + Cargo.toml | 3 +++ 2 files changed, 4 insertions(+) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index dde321a053..f8a469ece3 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -126,6 +126,7 @@ jobs: GRCOV_IGNORE_OPTION: '--ignore build.rs --ignore "/*" --ignore "[a-zA-Z]:/*"' GRCOV_EXCLUDE_OPTION: '--excl-br-line "^\s*((debug_)?assert(_eq|_ne)?!|#\[derive\()"' NOTEST_CUDA_COMPILERS: ${{ matrix.notest_cuda_compilers || '' }} + CARGO_PROFILE_DEV_DEBUG: '0' # save disk space steps: - uses: ilammy/msvc-dev-cmd@v1 diff --git a/Cargo.toml b/Cargo.toml index 9699c79fb3..330748c627 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -18,6 +18,9 @@ name = "sccache" name = "sccache-dist" required-features = ["dist-server"] +[profile.test] +debug = false # save disk space + [profile.release] codegen-units = 1 lto = true From 27c1f712ed82b9718e8d72d35fe1845e99d5b56f Mon Sep 17 00:00:00 2001 From: Kornel Date: Mon, 15 Dec 2025 19:28:05 +0000 Subject: [PATCH 5/6] MSVC on Windows only --- .github/workflows/ci.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index f8a469ece3..e1f439008d 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -128,7 +128,8 @@ jobs: NOTEST_CUDA_COMPILERS: ${{ matrix.notest_cuda_compilers || '' }} CARGO_PROFILE_DEV_DEBUG: '0' # save disk space steps: - - uses: ilammy/msvc-dev-cmd@v1 + - if: ${{ contains(matrix.os, 'windows') }} + uses: ilammy/msvc-dev-cmd@v1 - name: Clone repository uses: actions/checkout@v5 From 336788f8eb36b2e53584271f35ad231b23b1f3ea Mon Sep 17 00:00:00 2001 From: Kornel Date: Mon, 15 Dec 2025 19:39:49 +0000 Subject: [PATCH 6/6] Free up disk space in CI --- .github/workflows/ci.yml | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index e1f439008d..542b8e13dd 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -157,7 +157,7 @@ jobs: echo 'clang version:' clang --version - - if: matrix.cuda != '' && contains(fromJSON('["Linux", "Windows"]'), runner.os) + - if: ${{ matrix.cuda != '' && (runner.os == 'Linux' || runner.os == 'Windows') }} name: Install nvcc uses: ./.github/actions/nvcc-toolchain with: @@ -174,6 +174,11 @@ jobs: echo '[env] LLVM_PROFILE_FILE = { value = "target/debug/coverage/default-%p-%8m.profraw", relative = true }' >> .cargo/config.toml + - if: ${{ matrix.cuda != '' && runner.os == 'Linux' }} + name: Free disk space for CUDA tests + run: | + apt clean + rm -rf /usr/share/dotnet /opt/ghc /usr/local/lib/android /usr/local/share/boost /usr/share/swift /var/lib/apt/lists/* - name: Execute tests run: cargo test --locked --all-targets ${{ matrix.extra_args }}