swiftly icon indicating copy to clipboard operation
swiftly copied to clipboard

list-available gives results that are not available to install

Open patricktcoakley opened this issue 8 months ago • 5 comments

I haven't checked every version, but if I do swiftly list-available 2 I get

Available Swift 2 release toolchains
------------------------------------
Swift 2.2.1
Swift 2.2.0

but when I run swiftly install 2.2.1 I get

Installing Swift 2.2.1
Error: Swift 2.2.1 does not exist at URL /swift-2.2.1-release/xcode/swift-2.2.1-RELEASE/swift-2.2.1-RELEASE-osx.pkg, exiting

It would also be nice if the error posted the full URL of the release it's failing on.

patricktcoakley avatar Apr 06 '25 22:04 patricktcoakley

@patricktcoakley swiftly relying entirely on the swift.org API for this. If there's a discrepancy in the API then I think that this issue belongs on the swift-org-website repository.

cmcgee1024 avatar Apr 07 '25 12:04 cmcgee1024

Ok, feel free to close and I'll make an issue there.

patricktcoakley avatar Apr 07 '25 12:04 patricktcoakley

I will say though that the Swift API seems to give us:

 {
    "name": "2.2.1",
    "tag": "swift-2.2.1-RELEASE",
    "xcode": "Xcode 7.3.1",
    "xcode_release": true,
    "xcode_toolchain": false,
    "date": "2016-05-03",
    "platforms": [
      {
        "name": "Ubuntu 14.04",
        "platform": "Linux",
        "archs": [
          "x86_64"
        ]
      },
      {
        "name": "Ubuntu 15.10",
        "platform": "Linux",
        "archs": [
          "x86_64"
        ]
      }
    ]
  }

which to me indicates that Swiftly is not taking into account the architecture/platforms when displaying the available toolchains and would argue that it is more on the Swifty side than the Swift website since it may very well be that those releases do have downloads, just not for the platform I was running at the time.

patricktcoakley avatar Apr 07 '25 13:04 patricktcoakley

@patricktcoakley when you ran the above list-available command, I'm assuming that you were on macOS at the time? This JSON does seem to indicate that there is a macOS toolchain from 2016 available, it's just that the download URL couldn't be figured out for it, for possibly historical reasons. As a default, all swift releases have a macOS toolchain, so there's no need for swiftly to inspect the platforms list when running on macOS.

cmcgee1024 avatar Apr 07 '25 16:04 cmcgee1024

Now I see what you mean now, thanks. Yeah I used the Swift OpenAPI docs to get the releases JSON, but I didn't notice the Xcode property that determines it, but I can go ahead and log an issue on the site repo, just wanted to make sure I didn't miss something.

patricktcoakley avatar Apr 07 '25 16:04 patricktcoakley