Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 9 additions & 7 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -128,8 +126,10 @@ 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
- if: ${{ contains(matrix.os, 'windows') }}
uses: ilammy/msvc-dev-cmd@v1

- name: Clone repository
uses: actions/checkout@v5
Expand Down Expand Up @@ -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:
Expand All @@ -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 }}
Expand Down Expand Up @@ -249,9 +254,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
Expand Down
3 changes: 3 additions & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
27 changes: 15 additions & 12 deletions src/dist/http.rs
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,6 @@ mod common {
use serde::{Deserialize, Serialize};
#[cfg(feature = "dist-server")]
use std::collections::HashMap;
use std::fmt;

use crate::dist;

Expand Down Expand Up @@ -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 {
Expand Down Expand Up @@ -150,6 +142,7 @@ mod common {
pub cert_pem: Vec<u8>,
}

#[cfg(feature = "dist-server")]
#[derive(Clone, Serialize, Deserialize)]
#[serde(deny_unknown_fields)]
pub struct HeartbeatServerHttpRequest {
Expand All @@ -159,9 +152,11 @@ mod common {
pub cert_digest: Vec<u8>,
pub cert_pem: Vec<u8>,
}

#[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,
Expand Down Expand Up @@ -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;
Expand All @@ -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;
Expand Down Expand Up @@ -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<u8>,
Expand Down
2 changes: 1 addition & 1 deletion src/util.rs
Original file line number Diff line number Diff line change
Expand Up @@ -883,7 +883,7 @@ pub fn daemonize() -> Result<()> {
PREV_SIGBUS = Box::into_raw(Box::new(mem::zeroed::<libc::sigaction>()));
PREV_SIGILL = Box::into_raw(Box::new(mem::zeroed::<libc::sigaction>()));
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);
Expand Down
Loading