swiftly icon indicating copy to clipboard operation
swiftly copied to clipboard

Use swift.org metadata instead of GitHub API's for toolchain selection

Open cmcgee1024 opened this issue 1 year ago • 5 comments

There are some comments in the code about using swift.org metadata about toolchain versions in toolchain search and selection instead of the GitHub API's. This would reduce the site dependencies of swiftly and help to make it dependent on one source of truth. This issue exists to track what is only mentioned in the code.

cmcgee1024 avatar Aug 06 '24 12:08 cmcgee1024

The swift.org website now has this metadata available since it was merged here: https://github.com/swiftlang/swift-org-website/pull/720

For example, you can fetch this URL to get the 6.0 snapshot toolchains for Amazon Linux 2:

curl -L swift.org/api/v1/install/dev/6.0/amazonlinux2.json

cmcgee1024 avatar Aug 07 '24 13:08 cmcgee1024

That PR referenced doesn't include the new platforms eg ubuntu2404

Do you know if since then these platforms are included?

adam-fowler avatar Aug 07 '24 13:08 adam-fowler

I'm not sure about the PR that added it, but ubuntu2204 seems to be working:

curl -L swift.org/api/v1/install/dev/6.0/ubuntu2204.json

cmcgee1024 avatar Aug 07 '24 13:08 cmcgee1024

What about ubuntu2404? I know swiftly doesn't yet support it but the swift.org site has downloads for them

adam-fowler avatar Aug 07 '24 13:08 adam-fowler

Yes, it appears that there are some release downloads that show up in the metadata:

curl -L swift.org/api/v1/install/dev/releases.json
...
    "tag": "swift-5.10.1-RELEASE",
    "xcode": "Xcode 15.3",
    "xcode_release": false,
    "date": "2024-06-05",
    "platforms": [
...
      {
        "name": "Ubuntu 22.04",
        "platform": "Linux",
        "docker": "5.10.1-jammy",
        "archs": [
          "x86_64",
          "aarch64"
        ]
      },
      {
        "name": "Ubuntu 23.10",
        "platform": "Linux",
        "docker": "5.10.1-mantic",
        "archs": [
          "x86_64",
          "aarch64"
        ]
      },
      {
        "name": "Ubuntu 24.04",
        "platform": "Linux",
        "docker": "5.10.1-noble",
        "archs": [
          "x86_64",
          "aarch64"
        ]
      },
...

There's no metadata for 2404 for the 6.0 (ie. main) snapshots, but the downloads page doesn't have any downloads either.

cmcgee1024 avatar Aug 07 '24 13:08 cmcgee1024

This is now merged into main.

cmcgee1024 avatar Aug 23 '24 13:08 cmcgee1024