1.2馃崚: Init: Improve resilience on new platforms - #588
Open
etcwilde wants to merge 1 commit into
Open
Conversation
Swiftly init on platforms that don't have a release toolchain would fail and leave Swiftly in an inconsistent state. This is a quick patch to fall back on a `main-snapshot` toolchain if the latest toolchain doesn't exist. Init will still attempt to find the latest toolchain, but if no latest toolchain exists, it will emit a warning saying so, and ask the user if they want to install a new toolchain. If they decline, swiftly will continue with the swiftly installation, but not attempt to install anything. To make the code a little more resilient and target only cases where Swiftly failed to resolve a toolchain, I've added a new `ResolveError` type that tracks the reason for the failure and what the requested Toolchain selector was. That is used to construct the error message or to extract info about what failed. Added tests to verify the behavior when the main snapshot install is accepted and rejected, verifying that we install the snapshot or continue to not have any installed toolchains. (cherry picked from commit 198fc23)
etcwilde
requested review from
cmcgee1024,
justice-adams-apple and
shahmishal
as code owners
August 20, 2026 20:18
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.
Swiftly init on platforms that don't have a release toolchain would fail and leave Swiftly in an inconsistent state. This is a quick patch to fall back on a
main-snapshottoolchain if the latest toolchain doesn't exist.Init will still attempt to find the latest toolchain, but if no latest toolchain exists, it will emit a warning saying so, and ask the user if they want to install a new toolchain. If they decline, swiftly will continue with the swiftly installation, but not attempt to install anything.
To make the code a little more resilient and target only cases where Swiftly failed to resolve a toolchain, I've added a new
ResolveErrortype that tracks the reason for the failure and what the requested Toolchain selector was. That is used to construct the error message or to extract info about what failed.Added tests to verify the behavior when the main snapshot install is accepted and rejected, verifying that we install the snapshot or continue to not have any installed toolchains.
(cherry picked from commit 198fc23)
Cherry-Pick PR: #587