Skip to content

Commit

Permalink
feat: enable sccache
Browse files Browse the repository at this point in the history
  • Loading branch information
tsirysndr committed Mar 25, 2024
1 parent d756e40 commit b890254
Show file tree
Hide file tree
Showing 3 changed files with 33 additions and 1 deletion.
2 changes: 1 addition & 1 deletion deno.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@fluentci/rust",
"version": "0.9.2",
"version": "0.9.3",
"exports": "./mod.ts",
"importMap": "import_map.json",
"tasks": {
Expand Down
16 changes: 16 additions & 0 deletions example/.fluentci/src/dagger/jobs.ts
Original file line number Diff line number Diff line change
Expand Up @@ -180,8 +180,24 @@ export async function build(
.pipeline(Job.build)
.container()
.from("rust:latest")
.withExec([
"wget",
"https://github.com/mozilla/sccache/releases/download/v0.7.7/sccache-v0.7.7-x86_64-unknown-linux-musl.tar.gz",
])
.withExec([
"tar",
"-xvf",
"sccache-v0.7.7-x86_64-unknown-linux-musl.tar.gz",
])
.withExec([
"mv",
"sccache-v0.7.7-x86_64-unknown-linux-musl/sccache",
"/usr/local/bin",
])
.withEnvVariable("RUSTC_WRAPPER", "/usr/local/bin/sccache")
.withDirectory("/app", context, { exclude })
.withWorkdir("/app")
.withMountedCache("/root/.cache/sccache", dag.cacheVolume("sccache"))
.withMountedCache("/app/target", dag.cacheVolume("target"))
.withMountedCache("/root/cargo/registry", dag.cacheVolume("registry"))
.withExec(
Expand Down
16 changes: 16 additions & 0 deletions src/dagger/jobs.ts
Original file line number Diff line number Diff line change
Expand Up @@ -180,8 +180,24 @@ export async function build(
.pipeline(Job.build)
.container()
.from("rust:latest")
.withExec([
"wget",
"https://github.com/mozilla/sccache/releases/download/v0.7.7/sccache-v0.7.7-x86_64-unknown-linux-musl.tar.gz",
])
.withExec([
"tar",
"-xvf",
"sccache-v0.7.7-x86_64-unknown-linux-musl.tar.gz",
])
.withExec([
"mv",
"sccache-v0.7.7-x86_64-unknown-linux-musl/sccache",
"/usr/local/bin",
])
.withEnvVariable("RUSTC_WRAPPER", "/usr/local/bin/sccache")
.withDirectory("/app", context, { exclude })
.withWorkdir("/app")
.withMountedCache("/root/.cache/sccache", dag.cacheVolume("sccache"))
.withMountedCache("/app/target", dag.cacheVolume("target"))
.withMountedCache("/root/cargo/registry", dag.cacheVolume("registry"))
.withExec(
Expand Down

0 comments on commit b890254

Please sign in to comment.