From 7d70079105120510c9ba743d514179f9b6319c5f Mon Sep 17 00:00:00 2001 From: Georgios Jason Efstathiou Date: Mon, 5 Oct 2026 14:26:56 +0200 Subject: [PATCH] ryph: keep the baked Rust build warm, and smaller Pin source mtimes to the commit time at image build, so cargo's fingerprints survive the image layer and the warm build stays fresh. Build with line-tables-only debug info and drop the incremental cache to shrink the baked target/. --- .ryph/Dockerfile | 5 +++++ .ryph/environment.md | 3 +++ .ryph/setup.yml | 11 +++++++++++ 3 files changed, 19 insertions(+) diff --git a/.ryph/Dockerfile b/.ryph/Dockerfile index db07eaefe..6068b206d 100644 --- a/.ryph/Dockerfile +++ b/.ryph/Dockerfile @@ -32,3 +32,8 @@ USER runner # Without this, mise reads that line as a pin and tries to download Go 1.25.0 # instead of using the image's newer Go. ENV MISE_IDIOMATIC_VERSION_FILE_ENABLE_TOOLS=node,python,deno,bun + +# Debug info is most of a warm target/ (8 GB of radicle-desktop's 13). Line +# tables keep file:line in panics and backtraces. Set for the whole machine, +# so the image's warm build and every run's builds use the same profile. +ENV CARGO_PROFILE_DEV_DEBUG=line-tables-only diff --git a/.ryph/environment.md b/.ryph/environment.md index 8d667a575..640217f20 100644 --- a/.ryph/environment.md +++ b/.ryph/environment.md @@ -10,6 +10,9 @@ workspace. On top of the universal image it adds: - `golangci-lint` v2.14.0 in `/usr/local/bin`, for garden-broker; - `MISE_IDIOMATIC_VERSION_FILE_ENABLE_TOOLS=node,python,deno,bun`, so mise does not read a `go.mod` `go` line as a pin: Go is the image's own. +- `CARGO_PROFILE_DEV_DEBUG=line-tables-only`: dev and test builds carry + line tables, not full debug info. Backtraces keep file and line. Do not + override it, or every crate rebuilds. `.ryph/setup.yml` installs the npm dependencies, Playwright's WebKit and the pinned Radicle binaries (`tests/tmp/bin`), and warms clippy, the test build diff --git a/.ryph/setup.yml b/.ryph/setup.yml index 258b6ef76..3bf5e00b6 100644 --- a/.ryph/setup.yml +++ b/.ryph/setup.yml @@ -1,4 +1,11 @@ steps: + # An image layer keeps whole-second mtimes, but cargo fingerprints the + # nanoseconds it saw at build time, so every crate with a build script + # rebuilt on every run. Building from whole-second mtimes keeps the warm + # target/ fresh. Image builds only: at run time this would hide the files + # the run's checkout changed. + - name: pin source mtimes to the commit time (image builds only) + run: '[ "$RYPH_SETUP_PHASE" != image ] || git ls-files -z | xargs -0 touch -d "@$(git log -1 --format=%ct)"' - name: install npm dependencies run: npm install --prefer-offline - name: install Playwright WebKit @@ -11,3 +18,7 @@ steps: run: cargo test --workspace --no-run --locked - name: warm the e2e backend (tests/support/globalSetup.ts) run: cargo build --manifest-path ./crates/test-http-api/Cargo.toml --locked && cargo build -p radicle-job --bin rad-job --locked + # rustc's incremental cache only speeds up rebuilding this repo's own + # crates after an edit, and it is gigabytes. Image builds only. + - name: drop the incremental cache (image builds only) + run: '[ "$RYPH_SETUP_PHASE" != image ] || rm -rf target/debug/incremental'