.circleci/config.yml: hash all blobs files in cache key to prevent dirty builds - #2183
Merged
Merged
Conversation
… dirty builds PR linuxboot#2165 changed blobs/m900/README.md and blobs/xx80/README.md, but the cache key only hashed *.sh files under blobs/. The stale cache contained old README content, and workspace attachment overwrote the fresh checkout, making git diff detect modifications and set GIT_STATUS=dirty. This caused all subsequent CircleCI builds to produce -dirty ROM artifacts. Fix: hash all files under blobs/ for the cache key, not just *.sh, so the cache invalidates whenever any tracked blob file changes. Signed-off-by: Thierry Laurion <insurgo@riseup.net>
There was a problem hiding this comment.
Pull request overview
Updates the CircleCI “x86_blobs” cache key generation so blob cache invalidation reflects any change under blobs/, preventing stale cached blob content from being restored and causing subsequent builds to be marked -dirty.
Changes:
- Expand the blobs cache-key digest input from
blobs/**/*.shto all files underblobs/. - Ensure README (and other non-
.sh) updates underblobs/invalidate the cache and avoid dirty workspace overwrites.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
10 tasks
This file contains hidden or 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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes #2182.
Bug
Since PR #2165 (July 31), every CircleCI build produces ROM artifacts with
the
-dirtysuffix. The ROM filename includes-dirtybecauseGIT_STATUS(Makefile line 4) evaluates todirtyviagit diff --exit-code.Root cause
CircleCI caches the
blobs/directory in a workspace. The cache key iscomputed from only
*.shfiles underblobs/:find ./blobs -type f -name "*.sh" | sort -h | xargs sha256sumPR #2165 changed two tracked files (
blobs/m900/README.mdandblobs/xx80/README.md) but the cache key did not change because theREADMEs are not
*.sh. The stale workspace containing old READMEcontent was restored on top of the fresh checkout.
attach_workspaceoverwrites tracked files, so
git diffdetects modifications andsets
GIT_STATUS=dirty.Pipeline 1397 (commit
7f00d9b9aaa, pre-#2165) was the last cleanbuild. Pipeline 1400 (commit
a605d043030, #2165 merge) is thefirst dirty build. All subsequent pipelines inherited the stale cache.
Fix
Hash all files under
blobs/for the cache key, not just*.sh. Any tracked blob file change now invalidates the cache,preventing stale workspace content from overwriting fresh checkouts.