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/.
This commit is contained in:
Georgios Jason Efstathiou
2026-10-05 14:51:32 +02:00
parent c70467c75b
commit 7d70079105
3 changed files with 19 additions and 0 deletions
+5
View File
@@ -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
+3
View File
@@ -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
+11
View File
@@ -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'