Skip to content
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

Should Swiftly set the TOOLCHAINS environment variable? #180

Open
iainsmith opened this issue Oct 27, 2024 · 5 comments
Open

Should Swiftly set the TOOLCHAINS environment variable? #180

iainsmith opened this issue Oct 27, 2024 · 5 comments

Comments

@iainsmith
Copy link

When using swiftly on macos, every now and again I hit a use case where I need to explicitly set TOOLCHAINS. This recently hit me when I was looking to contribute to swift-java project.

It would be nice if this was automatically handled.

@cmcgee1024
Copy link
Member

The TOOLCHAINS environment variable is related to working with Xcode. At the moment the swiftly integration is mostly just at the macOS level.

@toffaletti
Copy link

Should we repurpose this Issue into an ask that swiftly provide some integration with Xcode on macOS? I find it currently rather confusing that Xcode+swiftly currently means swift in my PATH is no longer the Xcode swift so how am I supposed to switch back to the swift toolchains that Xcode provides? It would be nice if swiftly was aware of Xcode installs as well or at least some guidance on what we're expected to do. Currently I'm just removing swiftly from my PATH when I want Xcode swift, but that means it's not really providing much value for me over how I previously managed TOOLCHAINS env variable.

@toffaletti
Copy link

#277 seems related as well.

@cmcgee1024
Copy link
Member

Currently I'm just removing swiftly from my PATH when I want Xcode swift

Another approach that I use from time-to-time is to directly run /usr/bin/swift when I want the Xcode toolchain. There was a time when the swift.org toolchain wouldn't build swiftly for macOS due to a bug.

@MaxDesiatov
Copy link
Contributor

MaxDesiatov commented Apr 2, 2025

This problem is not specific to Xcode, I use TOOLCHAINS exclusively for selecting swift.org and locally built toolchains, as I don't use Xcode toolchains at all. Given that swiftly ignores TOOLCHAINS and doesn't issue any warnings about that, the only workaround seems to be removing SWIFTLY_BIN_DIR from PATH. I have an existing body of scripts that set TOOLCHAINS, and updating them all to use /usr/bin/swift instead of plain swift is not feasible.

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