added sccache

This commit is contained in:
2025-03-24 16:58:01 +08:00
parent 2cd390176f
commit ced38a9191
3 changed files with 9 additions and 5 deletions

View File

@@ -78,9 +78,12 @@ WORKDIR /home/luser
FROM base AS rust
RUN mkdir -p /etc/cargo
COPY config.toml /.cargo/
COPY --chown=1000:1000 config.toml /home/luser/.cargo/config.toml
COPY --chown=1000:1000 sccache_config.toml /home/luser/.config/sccache/config
RUN --mount=type=cache,target=/var/cache/pacman pacman -S --noconfirm --needed \
rustup \
trunk \
sccache \
llvm \
clang
@@ -90,7 +93,6 @@ RUN --mount=type=cache,target=/var/cache/pacman pacman -S --noconfirm --needed \
protobuf
USER luser
WORKDIR /home/luser
RUN mkdir .cargo
RUN rustup toolchain install stable-x86_64-unknown-linux-gnu --profile minimal
RUN rustup target add \
x86_64-unknown-linux-musl \
@@ -101,7 +103,6 @@ RUN rustup target add \
aarch64-unknown-linux-gnu \
wasm32-unknown-unknown \
wasm32-wasip2
RUN --mount=type=cache,target=/home/luser/.cargo/registry/,uid=1000,gid=1000 cargo install --locked trunk
FROM base AS gitea_act_runner
RUN --mount=type=cache,target=/var/cache/pacman pacman -S --noconfirm --needed nodejs npm docker docker-buildx btrfs-progs hidapi protobuf rustup llvm clang

View File

@@ -20,5 +20,5 @@ codegen-units = 4
lto = true
strip = true
#[build]
#rustc-wrapper = "/usr/bin/sccache"
[build]
rustc-wrapper = "/home/luser/.cargo/bin/sccache"

View File

@@ -0,0 +1,3 @@
[cache.disk]
dir = "/home/luser/.cache/sccache"
size = 12884901888 # 12 GiBytes