Eureka/tools/stopgap/rust.Dockerfile
Meta Vens c17cf6bf80 ygg-verify: rust image caches compiled crates with sccache
sccache 0.18.0 as RUSTC_WRAPPER with a shared eureka-sccache volume.
Idunn lib test build: 51 s cold, 29 s warm (83/83 hits). Slot wait, not
compilation, is the larger cost.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-09-30 20:14:43 +02:00

22 lines
1.2 KiB
Docker

# STOPGAP image for ygg-verify.sh: Rust plus cargo-mutants, the ecosystem
# mutation tool Soul runs on a cut's diff, plus the Windows GNU std so a job can
# `cargo check --target x86_64-pc-windows-gnu` without downloading it. It dies
# with ygg-verify.sh (see that file's deletion line). ygg-verify.sh tags the
# image by this file's hash, so an edit here rebuilds it.
#
# sccache (2026-09-30): every job clones fresh and builds into an empty
# /src/target, so a job cannot pick up another checkout's stale output (cargo
# decides by mtime). That made every run, rerun, Soul pass and mutant a cold
# build. sccache caches rustc outputs by the hash of their inputs, not by mtime,
# so sharing its cache between checkouts cannot hand one tree another's build.
# ygg-verify.sh mounts the shared cache at /sccache. Incremental compilation is
# off because sccache does not cache incremental crates.
FROM rust:1.95-bookworm
RUN rustup target add x86_64-pc-windows-gnu
RUN cargo install --locked cargo-mutants \
&& cargo install --locked --no-default-features sccache --version 0.18.0 \
&& rm -rf /usr/local/cargo/registry
ENV RUSTC_WRAPPER=/usr/local/cargo/bin/sccache \
SCCACHE_DIR=/sccache \
SCCACHE_CACHE_SIZE=60G \
CARGO_INCREMENTAL=0