diff --git a/deno.json b/deno.json index 606be8f..9b1285a 100644 --- a/deno.json +++ b/deno.json @@ -1,6 +1,6 @@ { "name": "@fluentci/rust", - "version": "0.9.2", + "version": "0.9.3", "exports": "./mod.ts", "importMap": "import_map.json", "tasks": { diff --git a/example/.fluentci/src/dagger/jobs.ts b/example/.fluentci/src/dagger/jobs.ts index 94c8c9b..b93c15f 100644 --- a/example/.fluentci/src/dagger/jobs.ts +++ b/example/.fluentci/src/dagger/jobs.ts @@ -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( diff --git a/src/dagger/jobs.ts b/src/dagger/jobs.ts index 94c8c9b..b93c15f 100644 --- a/src/dagger/jobs.ts +++ b/src/dagger/jobs.ts @@ -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(