swiftlang / swiftly

A Swift toolchain installer and manager, written in Swift.
https://swiftlang.github.io/swiftly/
Apache License 2.0
490 stars 28 forks source link

macOS: Generate `config.json` in `swiftly-install.sh` #138

Closed BrianHenryIE closed 3 months ago

BrianHenryIE commented 4 months ago

Fix #136

Currently, on macOS, no config.json is created by swiftly-install.sh and swiftly crashes when run.

This PR creates it using the values advised in https://github.com/swiftlang/swiftly/pull/121#issuecomment-2182924205

The platform.architecture key has to be explicitly absent, i.e. not even an empty string, for the correct URLs to be generated.

% swiftly install 5.7    

Fetching the latest stable Swift 5.7 release...
Installing Swift 5.7.3
                                              Downloading Swift 5.7.3
100% [================================================================================================]
Downloaded 963.4 MiB of 963.4 MiB
Installing package in user home directory...
installer: Package name is Swift Open Source Xcode Toolchain
installer: Installing at base path /Users/brianhenry
installer: The install was successful.
Swift 5.7.3 installed successfully!

Edit:

cmcgee1024 commented 3 months ago

Thanks @BrianHenryIE. As you've noted, there are some problems with the swiftly install shell script with macOS. We're currently in the process of migrating the installation logic of the shell script into swiftly itself, which should resolve this problem, and a few others. See #127 for more details.

BrianHenryIE commented 3 months ago

Sounds good. I've nothing to report about the tool itself on macOS – everything is running smoothly. I've updated nightlies a couple of times with it.

adam-fowler commented 3 months ago

Now that #127 has been merged we can probably close this