Repository navigation
test(keep): the copy test makes the .zig-cache it writes into - #14
Merged
Merged
Conversation
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.
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.
The test "a failed copy does not replace a log already kept" made its scratch directory in
.zig-cacheunder the directoryzig buildwas started in, and dropped the result of themkdirat. When that directory has no.zig-cache, the test fails withNotFoundatfsx.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. Runningzig build testfromsrc/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-cacheadded 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.