This pitch isn’t about altering the swift language. It’s about changing the way swift is available on MacOS. Forgive me, if this is not the right place to post this.
The swift download options at https://swift.org/download/ point to xcode download or the toolchain option downloads a .pkg file. However, the .pkg installer installs swift in some specific directory. The only customizable option is to be able to choose whether to install it for the user or globally.
I would like to have the flexibility to install swift in any location and be able to use it by changing the path variable. And I think this would be possible with .tar.gz downloads for MacOS. Do any such builds already exist? If so, how do I get them?
If not then is it possible to make .tar.gz swift builds available for MacOS on the downloads page? Just like .tar.gz files are available for Ubuntu.
The Swift downloads page provides Xcode toolchains for macOS, so I don't quite understand what you mean by having the flexibility to install to an arbitrary location. How are you planning to make this work with Xcode?
I don't intend to make it work with Xcode. Xcode comes with swift bundled with it. Swift should be available for use with and without Xcode.
I want to be able to install multiple versions of swift which have nothing to do with the xcode version. Then, I can have isolated swift server side projects which don't interfere with iOS Development environment. And I want this without having to deal with xcode-select because that changes the global swift version.
I think that's a bug they are working on at SR-7388. I hope they fix it soon. In the meantime, there are some flags and env. variables you can set up before running the REPL that should help you (details in the discussion).
I'm not sure I'd call this "fairly easily"! :-) @mishal_shah, this sounds like a reasonable request to me for those who don't care about Xcode integration. Should @ankit_goel file a bug?
FWIW, though, you can have more than one toolchain installed in the standard locations for Xcode, and differentiate them with xcrun -toolchain <org.swift.whatever> swiftc.
build-script creates .tar.gz and our code signing system converts it into signed .pkg. I will need to look into how we want to handle code signing .tar.gz for macOS.
As @anon27714269 pointed out, zip files are supported in MacOS. Maybe zip files are a better alternative. Zip/tar.gz whichever works with code signing.
Zip files do not have the ability to store file permissions, which is why they are not used to distribute software packages that rely on those permissions.
I also disagree that zip would be advantageous even if it supported permissions, .tar.gz archives are better integrated with unix environments and allow to change compression algorithms without hassle (.tar.bz/.tar.xz).