Skip to content

Swiftly is incompatible with Swift shipped in Xcode #301

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
gregcotten opened this issue Apr 3, 2025 · 4 comments
Open

Swiftly is incompatible with Swift shipped in Xcode #301

gregcotten opened this issue Apr 3, 2025 · 4 comments

Comments

@gregcotten
Copy link

Swiftly needs functionality to let the user switch between Xcode and the Open-Source Swift toolchains. If a user installs swiftly today on macOS, any use of swift from the command line will only ever use the currently selected Swiftly-selected toolchain.

@PaulSolt
Copy link

PaulSolt commented Apr 5, 2025

There should be some kind of way to disable swiftly so I can see my Xcode toolchain. I just want to swiftly disable or swiftly enable if there isn't going to be interoperability with existing toolchains through Xcode (due to portability between platforms ...).

My only workaround is to comment the swiftly ~/.zprofile addition and reload my zsh shell, just like I can comment out my $TOOLCHAINS=... line when doing Embedded Swift.

# Set the toolchain to the latest installed:
# export TOOLCHAINS=$(plutil -extract CFBundleIdentifier raw /Library/Developer/Toolchains/swift-latest.xctoolchain/Info.plist)

If you have an open Terminal window, you'll probably also need to unset TOOLCHAINS:

export TOOLCHAINS=""

@gregcotten
Copy link
Author

There should be some kind of way to disable swiftly so I can see my Xcode toolchain. I just want to swiftly disable or swiftly enable if there isn't going to be interoperability with existing toolchains through Xcode (due to portability between platforms ...).

My only workaround is to comment the swiftly ~/.zprofile addition and reload my zsh shell, just like I can comment out my $TOOLCHAINS=... line when doing Embedded Swift.

# Set the toolchain to the latest installed:
# export TOOLCHAINS=$(plutil -extract CFBundleIdentifier raw /Library/Developer/Toolchains/swift-latest.xctoolchain/Info.plist)

swiftly enable / swiftly disable is probably a good feature overall anyway! Kind of like brew link / brew unlink, it gives the user maximum freedom with their PATH, linker search paths, etc.

Probably any attempt of using swiftly when disabled should at least prompt the user about it, if not outright fail on "swiftly use"

@kirilltitov
Copy link

I don't know if it's relevant, but it seems like toolchain installed via Swiftly breaks code completion in Xcode (in VSCode it works well though)

@louisunlimited
Copy link
Contributor

I assume #315 fixes this issue?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants