Hi All,

I have created a design proposal for swiftly proxies for more flexible toolchain selection during command invocation. For example, the toolchain can be selected, installed if necessary, using a special command-line argument with a '+' prefix:

swift build +5.10.1
clang -o foo.o foo.c +latest

There's also support for .swift-version files.

There's more detail in the pull request here:

Your feedback is welcome.

Thank you,
Chris

2 Likes

Caveat: not a swiftly user

I'm ok with wrappers that look like wrappers, but I personally don't like swift itself not only wrapping/driving swift tools, but also installing variants of itself, mainly because it's so much harder to police arguments than commands.

The alternative of having swiftly not only install but run commands (swiftly swift build ... or swiftly build ...) seems to give the proper notice.

Disclosure of self-interest: I say this having written clutch, a wrapper that builds swift scripts with dependencies, which garnered zero community interest :)

https://github.com/swift-nest/clutch

Cargo has similar syntax for invoking certain commands with different version. That's convenient. I'm not sure about implicit installation - I'd rather see an error suggesting install, but in general that's nice addition!