Skip to content

Commit b890254

Browse files
committed
feat: enable sccache
1 parent d756e40 commit b890254

File tree

3 files changed

+33
-1
lines changed

3 files changed

+33
-1
lines changed

deno.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@fluentci/rust",
3-
"version": "0.9.2",
3+
"version": "0.9.3",
44
"exports": "./mod.ts",
55
"importMap": "import_map.json",
66
"tasks": {

example/.fluentci/src/dagger/jobs.ts

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -180,8 +180,24 @@ export async function build(
180180
.pipeline(Job.build)
181181
.container()
182182
.from("rust:latest")
183+
.withExec([
184+
"wget",
185+
"https://github.com/mozilla/sccache/releases/download/v0.7.7/sccache-v0.7.7-x86_64-unknown-linux-musl.tar.gz",
186+
])
187+
.withExec([
188+
"tar",
189+
"-xvf",
190+
"sccache-v0.7.7-x86_64-unknown-linux-musl.tar.gz",
191+
])
192+
.withExec([
193+
"mv",
194+
"sccache-v0.7.7-x86_64-unknown-linux-musl/sccache",
195+
"/usr/local/bin",
196+
])
197+
.withEnvVariable("RUSTC_WRAPPER", "/usr/local/bin/sccache")
183198
.withDirectory("/app", context, { exclude })
184199
.withWorkdir("/app")
200+
.withMountedCache("/root/.cache/sccache", dag.cacheVolume("sccache"))
185201
.withMountedCache("/app/target", dag.cacheVolume("target"))
186202
.withMountedCache("/root/cargo/registry", dag.cacheVolume("registry"))
187203
.withExec(

src/dagger/jobs.ts

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -180,8 +180,24 @@ export async function build(
180180
.pipeline(Job.build)
181181
.container()
182182
.from("rust:latest")
183+
.withExec([
184+
"wget",
185+
"https://github.com/mozilla/sccache/releases/download/v0.7.7/sccache-v0.7.7-x86_64-unknown-linux-musl.tar.gz",
186+
])
187+
.withExec([
188+
"tar",
189+
"-xvf",
190+
"sccache-v0.7.7-x86_64-unknown-linux-musl.tar.gz",
191+
])
192+
.withExec([
193+
"mv",
194+
"sccache-v0.7.7-x86_64-unknown-linux-musl/sccache",
195+
"/usr/local/bin",
196+
])
197+
.withEnvVariable("RUSTC_WRAPPER", "/usr/local/bin/sccache")
183198
.withDirectory("/app", context, { exclude })
184199
.withWorkdir("/app")
200+
.withMountedCache("/root/.cache/sccache", dag.cacheVolume("sccache"))
185201
.withMountedCache("/app/target", dag.cacheVolume("target"))
186202
.withMountedCache("/root/cargo/registry", dag.cacheVolume("registry"))
187203
.withExec(

0 commit comments

Comments
 (0)