Skip to content

Commit

Permalink
remove sccache from CI (#1132)
Browse files Browse the repository at this point in the history
CI jobs were running out of space and failing. Recent example:

https://github.com/NomicFoundation/slang/actions/runs/11488369511/job/32017344957

This is an intrim solution to disable `sccache`, which occupies a lot of
space.
Long term, we should look into splitting our testing into multiple jobs,
and only set up the required toolchains for each job as needed.
  • Loading branch information
OmarTawfik authored Oct 25, 2024
1 parent 14edad7 commit 0affc78
Show file tree
Hide file tree
Showing 6 changed files with 22 additions and 6 deletions.
1 change: 0 additions & 1 deletion bin/.sccache-0.8.2.pkg

This file was deleted.

2 changes: 0 additions & 2 deletions bin/hermit.hcl
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,6 @@ env = {
"RUST_BACKTRACE": "full",
"RUST_STABLE_VERSION": "1.79.0", // __RUST_STABLE_VERSION_MARKER__ (keep in sync)
"RUST_NIGHTLY_VERSION": "nightly-2024-06-17", // __RUST_NIGHTLY_VERSION_MARKER__ (keep in sync)
"RUSTC_WRAPPER": "${HERMIT_ENV}/bin/sccache",
"SCCACHE_DIR": "${HERMIT_ENV}/.hermit/sccache",

// TypeScript:
"TS_NODE_PROJECT": "${HERMIT_ENV}/tsconfig.json",
Expand Down
1 change: 0 additions & 1 deletion bin/sccache

This file was deleted.

2 changes: 1 addition & 1 deletion crates/infra/cli/src/commands/perf/benchmark/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ impl BenchmarkController {
.property("--project", "slang")
.property("--adapter", "rust_iai_callgrind")
.property("--testbed", testbed)
.env("BENCHER_API_TOKEN", token);
.secret("BENCHER_API_TOKEN", token);

if dry_run {
command = command.flag("--dry-run");
Expand Down
2 changes: 2 additions & 0 deletions crates/infra/utils/src/cargo/workspace.rs
Original file line number Diff line number Diff line change
Expand Up @@ -145,5 +145,7 @@ impl CargoWorkspaceCommands for Command {
.unwrap(),
),
)
// Print extra logs when build cache is invalidated:
.env("CARGO_LOG", "cargo::core::compiler::fingerprint=info")
}
}
20 changes: 19 additions & 1 deletion crates/infra/utils/src/commands/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,10 @@ use crate::paths::{PathExtensions, PrivatePathExtensions};
pub struct Command {
name: String,
args: Vec<String>,

environment: HashMap<String, String>,
secrets: HashMap<String, String>,

current_dir: Option<PathBuf>,
}

Expand All @@ -27,7 +30,10 @@ impl Command {
Self {
name: name.into(),
args: vec![],

environment: HashMap::new(),
secrets: HashMap::new(),

current_dir: None,
}
}
Expand Down Expand Up @@ -70,6 +76,13 @@ impl Command {
self
}

#[must_use]
pub fn secret(mut self, key: impl Into<String>, value: impl Into<String>) -> Self {
self.secrets.insert(key.into(), value.into());

self
}

#[must_use]
pub fn current_dir(mut self, current_dir: impl Into<PathBuf>) -> Self {
let current_dir = current_dir.into();
Expand Down Expand Up @@ -155,6 +168,7 @@ fn spawn_with_defaults(command: &Command, stdio: impl Fn() -> Stdio) -> Result<C
.envs(vars())
// Then apply any user provided overrides:
.envs(&command.environment)
.envs(&command.secrets)
// Set up stdio:
.stdin(stdio())
.stdout(stdio())
Expand Down Expand Up @@ -222,7 +236,11 @@ impl Display for Command {
parts.push("&&".to_owned());
}

for key in self.environment.keys() {
for (key, value) in &self.environment {
parts.push(format!("{key}='{value}'"));
}

for key in self.secrets.keys() {
// Note: GitHub CI might not be able to obfuscate all secrets. Let's err on the side of caution:
parts.push(format!("{key}='XXX'"));
}
Expand Down

0 comments on commit 0affc78

Please sign in to comment.