Let's assume I have a local setup with Swift version 5.0 and a remote framework that has a 1.1 release with a Package.swift that specifies a swift-tools-version ≤ 5.0 and a 1.2 release with a swift-tools-version > 5.0.
The Issue
If I reference the framework from my local machine running Swift 5.0 using the upToNextMajor(from: "1.1") specification, it won't download the 1.2 release because the Swift version of that release is higher than the one run locally. Instead it will download the 1.1 release. That's fine.
Now I upgrade to Swift 5.1 on my local machine and perform the accio update command. This will cause the 1.2 release to be chosen.
Now, let's downgrade the local machine back to Swift 5.0. Performing accio update will now result in an error, because it finds the checked out 1.2 release with an incompatible swift-tools-version:
The Fix
Currently, the only fix is to delete the checkout manually. I propose that Accio should do this itself.
The Example
An example for this is https://github.com/onevcat/Kingfisher. It has a 5.7.1 release with a swift-tools-version of 4.2. and from then on, the swift-tools-version is 5.1.
The Setup
Let's assume I have a local setup with Swift version
5.0
and a remote framework that has a1.1
release with aPackage.swift
that specifies aswift-tools-version
≤5.0
and a1.2
release with aswift-tools-version
>5.0
.The Issue
If I reference the framework from my local machine running Swift
5.0
using theupToNextMajor(from: "1.1")
specification, it won't download the1.2
release because the Swift version of that release is higher than the one run locally. Instead it will download the1.1
release. That's fine.Now I upgrade to Swift
5.1
on my local machine and perform theaccio update
command. This will cause the1.2
release to be chosen.Now, let's downgrade the local machine back to Swift
5.0
. Performingaccio update
will now result in an error, because it finds the checked out1.2
release with an incompatibleswift-tools-version
:The Fix
Currently, the only fix is to delete the checkout manually. I propose that Accio should do this itself.
The Example
An example for this is https://github.com/onevcat/Kingfisher. It has a
5.7.1
release with aswift-tools-version
of4.2.
and from then on, theswift-tools-version
is5.1
.