JamitLabs / Accio

A dependency manager driven by SwiftPM that works for iOS/tvOS/watchOS/macOS projects.
MIT License
664 stars 32 forks source link

Error with dependencies with higher Swift tools version #85

Closed fredpi closed 4 years ago

fredpi commented 4 years ago

The Setup

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-version5.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:

Accio_Bug

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.

fredpi commented 4 years ago

Closing this, as Accio is now deprecated.