Repository navigation
Replace a damaged prepared tool runtime - #132
Merged
Merged
Conversation
prepare_local treated <root>/<cache key> as prepared as soon as the directory existed. A runtime whose executables were missing failed with a pathless Io(NotFound) on every later run, and an altered one failed with Integrity forever. An invalid runtime (an executable missing, not a regular file, with the wrong digest or permissions) is now replaced by a freshly staged one and verified once; a missing executable is reported as InvalidCache(path). Creating or replacing a runtime runs under an exclusive lock on <root>/.<cache key>.lock with a re-check after acquiring it, so concurrent preparers never move aside a runtime another one just installed. A valid runtime is reused without taking the lock or writing anything. Closes #131
|
Codecov Report❌ Patch coverage is
📢 Thoughts on this report? Let us know! |
Preparation marks executables read-only on every platform, but only unix verified it, so a writable executable passed verification on Windows.
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.
prepare_localtreated<root>/<cache key>as prepared as soon as the directory existed, so a runtime with missing executables failed with a pathlessIo(NotFound)on every later run (seen in May's CI after a cache tool restored the directories without their files), and an altered one failed withIntegrityforever.InvalidCache(path).fd-locklock on<root>/.<cache key>.lock, re-checked after acquisition, so two preparers cannot move aside a runtime the other just installed. A valid runtime is reused without the lock and without writes. (std::fs::File::lockneeds Rust 1.89; the workspace MSRV is 1.88.)tampered_cache_fails_closedbecame the replacement test.Tests: missing executable reports its path; empty
bin/skeleton, altered bytes and writable executable are each replaced; a valid runtime is reused with inode and mtime unchanged; eight concurrent preparations of one broken root all succeed with nothing left behind.aither-sandbox: 169 passed (withHEEL_BIN), fmt and clippy-D warningsclean.Closes #131