Skip to content

test(keep): the copy test makes the .zig-cache it writes into - #14

Merged
HaoZeke merged 1 commit into
mainfrom
fix/scratch-dir
Nov 16, 2026
Merged

HaoZeke merged 1 commit into
mainfrom
fix/scratch-dir

Conversation

@HaoZeke

@HaoZeke HaoZeke commented Nov 16, 2026

Copy link
Copy Markdown
Collaborator

The test "a failed copy does not replace a log already kept" made its scratch directory in .zig-cache under the directory zig build was started in, and dropped the result of the mkdirat. When that directory has no .zig-cache, the test fails with NotFound at fsx.openDir.

This is what keeps stackhands/zig-common#16 red. Its tools job builds this repository from $GITHUB_WORKSPACE/tool, while setup-zig puts the cache at $GITHUB_WORKSPACE/.zig-cache. Running zig build test from src/ fails the same way, against zig-common 0.8.1 and against its main. This repository's own CI passes only because its checkout sits where the cache is.

The test now makes the directory with atomic.makedirs, as the eb-local tests do, stops on any other error, and removes the directory even when it cannot open it.

With an empty tool/.zig-cache added and nothing else changed, the old test passes 15/15 in the zig-common CI layout, so the zig-common error mapping is not involved.

After this merges, re-run the tools (stackhands/eb-keep-logs) jobs on stackhands/zig-common#16.

The unit test of a failed copy made its scratch directory in .zig-cache
under the directory it runs in, with a mkdirat whose result it dropped.
zig build runs a test in the directory zig build was started in, and
that directory has no .zig-cache when the cache is elsewhere.
zig-common's CI builds this repository from $GITHUB_WORKSPACE/tool
while setup-zig sets ZIG_LOCAL_CACHE_DIR to $GITHUB_WORKSPACE/.zig-cache:
the mkdirat failed with ENOENT and the test failed at fsx.openDir with
NotFound, with zig-common 0.8.1 as with its main. `zig build test`
started in src/ fails the same way. This repository's CI passed only
because its checkout is $GITHUB_WORKSPACE, where the cache is.

The test now makes the directory with atomic.makedirs, parents and all,
as eb-local's tests do, stops on any other error, and removes the
directory even when it cannot open it.
@HaoZeke
HaoZeke merged commit 10f8e9c into main Nov 16, 2026
8 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.

1 participant