mozilla / sccache

Sccache is a ccache-like tool. It is used as a compiler wrapper and avoids compilation when possible. Sccache has the capability to utilize caching in remote storage environments, including various cloud storage options, or alternatively, in local storage.
Apache License 2.0
5.74k stars 542 forks source link

Auto Release Docker image to docker registry in CI #1763

Open DCjanus opened 1 year ago

DCjanus commented 1 year ago

I attempted to use sccache in CI, but was constrained by external network access limitations, preventing me from directly downloading the executable file from GitHub. I'm hoping to leverage Docker's multi-stage build capability to obtain the necessary executable from an existing sccache Docker image (which is available on our company's internal Docker registry).

Just like this

FROM debian:11
COPY --from=sccache:1.4.2 /usr/local/bin/sccache /usr/local/bin/sccache
ENV RUSTC_WRAPPER /usr/local/bin/sccache

In addition, in order to support different platforms such as linux/amd64 and /linux/arm64, we now have to write a very complicated script to select the corresponding pre-built package URL based on the current platform, which is really painful.

ajschmidt8 commented 1 year ago

+1 for this.

Installing via a Docker image would be great.