feat(dist): stage fresh toolchains before atomic publication#4965
Draft
cachebag wants to merge 4 commits into
Draft
feat(dist): stage fresh toolchains before atomic publication#4965cachebag wants to merge 4 commits into
cachebag wants to merge 4 commits into
Conversation
cachebag
force-pushed
the
poc/staged-toolchain-install
branch
2 times, most recently
from
July 20, 2026 01:30
6189268 to
0611f4c
Compare
rami3l
self-requested a review
July 20, 2026 08:46
cachebag
marked this pull request as draft
July 20, 2026 10:35
cachebag
force-pushed
the
poc/staged-toolchain-install
branch
from
July 23, 2026 12:37
0611f4c to
888bd54
Compare
…g dir Fresh dist installs now stage under `toolchains/+rustup-staging-<name>`, so interrupted installs of the same toolchain reuse a single staging directory instead of accumulating abandoned ones. The stage is guarded by an exclusive advisory file lock held for its lifetime: a dead owner's stage is reclaimed on the next attempt, while a live owner makes the contending install fail fast with a clear error. Blocking instead of failing, and serializing whole operations, is left to the locking work tracked in rust-lang#988. Publication failures are classified: if the destination appeared while the install was staging, the error now says so instead of surfacing a bare rename failure. The staged dispatch moves into `InstallMethod::run`, checkpoint names become exported constants co-located with their checkpoint sites, and the stray-hash removal in `install_into` is dropped as unreachable: staged installs never read the alias-scoped hash and rewrite it after publication.
Interrupted installs are asserted to reuse one deterministic staging path; a stale stage left by a dead process is reclaimed without leaking its contents into the published toolchain; and a stray update hash is ignored during a staged install and refreshed after publication.
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.
WIP do not merge
This PR employs the second point of the plan discussed in #4663 (details in my design notes), addressing #4400 and #4724 for fresh installs.
The idea is that now a fresh toolchain builds in its own "staging" directory and is then published to
toolchains/<name>with a rename being done at the same time as well as the update hash only being written after it is published. In the case of an interrupted install, this now allows for no partial toolchain to be emitted as well as the ability to retry.Updates still modify toolchains in place, and blocking instead of failing is deferred to the locking work in #988.
I am going to rebase onto #4966 once is merged.