Skip to content

halide-cache: Create the output directory on a hit - #12

Merged
RMPR merged 1 commit into
masterfrom
fix-hit-into-missing-output-dir
Oct 12, 2026
Merged

RMPR merged 1 commit into
masterfrom
fix-hit-into-missing-output-dir

Conversation

@RMPR

@RMPR RMPR commented Oct 12, 2026

Copy link
Copy Markdown
Member

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:

Error: Io

Caused by:
    No such file or directory (os error 2)

This is what broke gcc-make code 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

  • unpack creates each output's parent directory before writing it.
  • Two e2e tests, one for a local hit and one for a remote hit, each into a checkout with no output directory. Both failed before the fix.
  • Changelog entry under Unreleased.

Testing

  • cargo test --workspace: all pass
  • cargo fmt --all --check and cargo clippy --workspace --all-targets -- -D warnings: clean

Once this is merged, CI needs a new release (e.g. 1.0.1) deployed to pick up the fix.

🤖 Generated with Claude Code

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>
@RMPR
RMPR merged commit acb6499 into master Oct 12, 2026
18 checks passed
@RMPR
RMPR deleted the fix-hit-into-missing-output-dir branch October 12, 2026 11:47
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