Repository navigation
halide-cache: Create the output directory on a hit - #12
Merged
Merged
Conversation
A hit wrote the outputs without creating their directory, which only the builder does. In a fresh build directory, a hit that came before any miss had created the directory failed the build with "No such file or directory". A remote hit was instead discarded as corrupt and rebuilt. This broke SDK code analysis builds in CI. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
johningve
approved these changes
Oct 12, 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.
A cache hit wrote the generated object and header with
File::create, which does not create their parent directory. Only the builder creates it, and on a hit the builder never runs. So in a fresh build directory, any hit that came before a miss had created the directory failed:This is what broke
gcc-makecode analysis in zivid-sdk CI, for example:https://github.com/zivid/zivid-sdk/actions/runs/38124963660/job/114427640810
https://github.com/zivid/zivid-sdk/actions/runs/38213690282/job/114694617460
A remote hit hit the same error, but there it was caught: the entry was labelled corrupt, removed from the local cache and rebuilt. The build passed, but the cache did nothing.
Changes
unpackcreates each output's parent directory before writing it.Testing
cargo test --workspace: all passcargo fmt --all --checkandcargo clippy --workspace --all-targets -- -D warnings: cleanOnce this is merged, CI needs a new release (e.g. 1.0.1) deployed to pick up the fix.
🤖 Generated with Claude Code