Skip to content

1.2馃崚: Init: Improve resilience on new platforms - #588

Open
etcwilde wants to merge 1 commit into
swiftlang:release/1.2from
etcwilde:ewilde/1.2/unreleased-toolchain-init
Open

1.2馃崚: Init: Improve resilience on new platforms#588
etcwilde wants to merge 1 commit into
swiftlang:release/1.2from
etcwilde:ewilde/1.2/unreleased-toolchain-init

Conversation

@etcwilde

Copy link
Copy Markdown
Member

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)
Cherry-Pick PR: #587

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)
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