-
Notifications
You must be signed in to change notification settings - Fork 302
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
internal/ci: fix up modified times for all directories
Our recent change in https://cuelang.org/cl/551227 did indeed cause more packages to start hitting the test cache properly, but some of the heavier ones like ./cmd/cue/cmd were still causing misses. After some debugging, it turns out that git-restore-mtime does not properly update the modified time for directories which themselves only contain other directories. This happens with cmd/cue/cmd/testdata, for example, which explains the case above. Since Go currently hashes the modified time as well as the entire content for every file that is opened, including directories, we don't actually need the modified timestamps to be perfect; we just need them to be stable enough to allow test cache hits. For that reason, reset all directory timestamps to a dummy static timestamp before we run git-restore-mtime, to act as a fallback for those directories affected by the bug. We could use a static timestamp for all files and directories, removing git-restore-mtime from the equation entirely, but that could potentially lead to false test cache hits if any of our caching does rely only on modified times. For that reason, be conservative and keep both. Fixing up the modified times now uses two steps, so refactor #checkoutCode into a list of three steps to be embedded, per Paul's suggestion to keep the config easy to compose. Signed-off-by: Daniel Martí <mvdan@mvdan.cc> Change-Id: I69aba918965ce31fb27fd95ef0bc13c742735e57 Reviewed-on: https://review.gerrithub.io/c/cue-lang/cue/+/551230 Reviewed-by: Paul Jolly <paul@myitcv.io> TryBot-Result: CUEcueckoo <cueckoo@cuelang.org>
- Loading branch information
Showing
5 changed files
with
43 additions
and
29 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters