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

Support for custom toolchains #101

Open
Amzd opened this issue Apr 27, 2024 · 2 comments
Open

Support for custom toolchains #101

Amzd opened this issue Apr 27, 2024 · 2 comments

Comments

@Amzd
Copy link

Amzd commented Apr 27, 2024

Would be nice to have some support for custom swift toolchains. This is helpful for development forks.

I tried just placing 5.10.0-example in .local/share/swiftly/toolchains but it was not picked up by swiftly list.

I don't mind making a PR if someone with more insight in the project has an idea on how to do this. Currently the installed versions is tracked in the config. Possibly could check the folders when you call swiftly list and add folders missing from config to config.installedToolchains as a new ToolchainVersion case? eg ToolchainVersion.custom(String) where String would be the folder name? I am probably not seeing all the possible issues with this approach.

@patrickfreed
Copy link
Contributor

Hey, yeah I think this is a cool idea. Before we decide on an implementation path, I'd like to know a bit more about how custom toolchains are typically installed though. Are they usually built from source? Or are they usually downloaded as tarballs, similar to regular releases or snapshots? If it's the latter, then I think this would best be supported by introducing a --custom-url (or something like that) option to the install command, rather than changing list. If the former, then maybe a --toolchain-path option could be introduced to install instead, which would allow one to specify a path on disk to use.

As a temporary workaround for your usecase, you can copy the toolchain to toolchains directory and then add it to config.json with some name you'll recognize that will also pass the parser (maybe some clearly nonexistent version such as 12.34.56).

@Amzd
Copy link
Author

Amzd commented Apr 27, 2024

My specific use case is step 1 of this https://github.com/kabiroberai/linux-app which requires a fork of spm which you just build locally. But unlike the steps I don't want to put it in my main 5.9.0 swift tool chain but in a copy (5.9.0-kabir) as otherwise it causes some other issues.

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

2 participants