fix(cache): invalidate cache for .include and .incbin directives - #1
Merged
Conversation
tycho
approved these changes
Aug 5, 2026
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.
This fixes a really nasty bug with (upstream) sccache where
.incbinand.includedirectives weren't fully checked for cache consistency before being returned in the build cache.This led to a case where our kmods actually got signed with the wrong signing key, because the kernel's
certs/system_certificates.Sembeds the cert via assembler .incbin, andsccachewould mistakenly return a stale key from a previous build 🙃Depending on what @tycho thinks I might upstream this because of the nastiness, but either way our fork needs the fix.
Tested with a kernel build using this SHA, mismatch issue goes away. Also added some more unit tests.
EDIT: I also did a pass against
ccachevssccacheto see if there are other similarly-shaped problems where the cache hashing/keying might be broken and return the wrong thing and found a few more minor ones, mostly around plugins/specs/struct layout randomization, those are fixed in the second commit. None of these are directly relevant for us, but are incorrect.