gha-setup-swift icon indicating copy to clipboard operation
gha-setup-swift copied to clipboard

Confusing options

Open dabrahams opened this issue 2 years ago • 10 comments
trafficstars

If I give a tag name, what is the branch name used for (and vice-versa)? Either one uniquely identifies a release. Please clarify in the README.

dabrahams avatar Oct 11 '23 00:10 dabrahams

Oh, yeah… I don't know how to fix the README for the semantics you've got, but branch is not a branch name and tag is not a tag name. For 5.9 the branch would be release/5.9 and the tag would be swift-5.9-RELEASE but what I actually have to pass is something like

        branch: swift-5.9-release
        tag: 5.9-RELEASE

dabrahams avatar Oct 11 '23 00:10 dabrahams

Perhaps the option names are poor, naming is difficult! I'm open to renaming the options in a backwards compatible manner. The names themselves are references to the URL:

https://download.swift.org/development/windows10/swift-DEVELOPMENT-SNAPSHOT-2023-08-12-a/swift-DEVELOPMENT-SNAPSHOT-2023-08-12-a-windows10.exe

which appears to be:

https://download.swift.org/[branch]/[host]/[tag]/[tag]-[host][suffix]

compnerd avatar Oct 16 '23 22:10 compnerd

In the ideal scenario, we would be able to use just the release version and or snapshot (for a release train or stable train) as a single parameter and derive everything from that.

compnerd avatar Oct 17 '23 15:10 compnerd

Screenshot 2023-10-17 at 8 28 59 PM

BTW, the tag terminology is also on the download page as well.

compnerd avatar Oct 18 '23 03:10 compnerd

We should really discuss how to fix this. I just came back here and find myself opting for https://github.com/SwiftyLab/setup-swift/ because I can't figure out what these instructions mean. Presumably your Windows support is better, but at least for simple use cases I totally understand how to use the other one.

dabrahams avatar Feb 12 '24 23:02 dabrahams

i have also found this extremely frustrating although the problem is hardly limited to this particular project. identifying toolchains is hard.

tayloraswift avatar Feb 14 '24 21:02 tayloraswift

Clearly doesn't have to be this hard. The swiftylab component makes it trivial. Anyone could implement the same API.

dabrahams avatar Feb 15 '24 09:02 dabrahams

Continuing from https://github.com/swift-actions/setup-swift/issues/634#issuecomment-1980787840

@compnerd wrote:

I know that you are frustrated by those options, but they are what apple uses. I'm happy to rename them, but we need the two parameters (or at least a way to derive the two). compnerd/gha-setup-swift does work on other platforms as well, and is much easier to evolve when working with the Windows platform. I don't mind co-maintaining an action if it is designed to take the needs for evolving the Windows support in mind.

Well, the names are confusing, but even if you do that there needs to be

  1. a clear explanation of what the names mean, i.e. what they map to in the Swift repository, and
  2. most especially, for the vast majority out there who only want to use released versions of Swift, how to go from an official version number to these settings.

Ideally, though (and you really need to do this if you want uptake of usage) there would be one option you could set that would take an official number, and, if set, would be used to derive the other settings.

dabrahams avatar Mar 06 '24 15:03 dabrahams

could this be as simple in the instructions as saying,

for an official release version X, use

        with:
          branch: swift-${{ X }}-release
          tag: ${{ X }}-RELEASE

?

dabrahams avatar Mar 19 '24 19:03 dabrahams

Yeah, I'm totally happy to have the documentation say that.

compnerd avatar Mar 19 '24 19:03 compnerd