Skip to content

fix(cache): invalidate cache for .include and .incbin directives - #1

Merged
bleggett merged 2 commits into
mainfrom
bleggett/incbin-cachebust
Aug 5, 2026
Merged

fix(cache): invalidate cache for .include and .incbin directives#1
bleggett merged 2 commits into
mainfrom
bleggett/incbin-cachebust

Conversation

@bleggett

@bleggett bleggett commented Aug 5, 2026

Copy link
Copy Markdown

This fixes a really nasty bug with (upstream) sccache where .incbin and .include directives 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.S embeds the cert via assembler .incbin, and sccache would 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 ccache vs sccache to 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.

@bleggett
bleggett merged commit f0c3e74 into main Aug 5, 2026
35 of 36 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants