ryph: round source mtimes down instead of to the commit time

On an incremental image build, setting a changed file to the commit
time can make it older than its stale build output, so cargo would skip
the rebuild. Rounding down to the whole second still survives the image
layer and never moves a file back past its outputs.
This commit is contained in:
Georgios Jason Efstathiou
2026-10-05 15:31:19 +02:00
parent 3af6160515
commit 244c5711df
+6 -6
View File
@@ -1,11 +1,11 @@
steps: steps:
# An image layer keeps whole-second mtimes, but cargo fingerprints the # An image layer keeps whole-second mtimes, but cargo fingerprints the
# nanoseconds it saw at build time, so every crate with a build script # nanoseconds it saw at build time. Rounding tracked files down to the
# rebuilt on every run. Building from whole-second mtimes keeps the warm # second before building keeps the warm target/ fresh at run time. Never
# target/ fresh. Image builds only: at run time this would hide the files # set them to the commit time: on an incremental image build that can make
# the run's checkout changed. # a changed file older than its stale build output.
- name: pin source mtimes to the commit time (image builds only) - name: round source mtimes down to whole seconds (image builds only)
run: '[ "$RYPH_SETUP_PHASE" != image ] || git ls-files -z | xargs -0 touch -d "@$(git log -1 --format=%ct)"' run: '[ "$RYPH_SETUP_PHASE" != image ] || git ls-files -z | xargs -0 perl -e ''for (@ARGV) { next if -l; my $m = (lstat)[9]; utime $m, $m, $_ }'''
- name: install npm dependencies - name: install npm dependencies
run: npm install --prefer-offline run: npm install --prefer-offline
- name: install the pinned Radicle binaries for http-client and e2e tests - name: install the pinned Radicle binaries for http-client and e2e tests