-
Notifications
You must be signed in to change notification settings - Fork 18
Support downloading & installing Swift toolchain for Ubuntu/RHEL hosts when on Linux #115
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
Comments
@MaxDesiatov @euanh question for you guys. Do you think it would be acceptable/okay for the swift-sdk-generator to have an option to generate an SDK with just the sysroot for the target and no version of Swift included, like the static Linux SDKs? I would like to use the SDK generator to build some SDKs for various targets, but I do not want Swift included so that they can be used on any host (macOS, Linux, etc). |
I think this would be a nice option. It was not possible before #155 because, as you noticed, we were copying some of the target SDK files into the toolchain. After #155 the SDK and toolchain should be completely separate, so you should be able to remove the toolchain and still have a working SDK. |
Indeed. I think that's an acceptable compromise for an SDK that is compatible with a wider range of hosts, as long as you have the exact version of Swift installed :). Thank you, I shall have a look here and see if I can add an option. Do I need to file a ticket for this as well? |
… github.com:xtremekforever/swift-sdk-generator into swiftlang#115-linux-host-toolchain-from-host-triple
Right now, if you do the following on Ubuntu 22.04:
swift run swift-sdk-generator make-linux-sdk --swift-version 5.10.1-RELEASE --host x86_64-unknown-linux-gnu
The generator will still download the OSX package for the Swift 5.10.1, resulting in an SDK that is unusable on Ubuntu. If you pass
--host-swift-package-path /path/to/swift/installation
to the generator, then it will use the correct version of the Swift toolchain and package it in the generated SDK. However, there are errors involved since the Swift distribution for Linux includes extra libraries:This can be resolved by simply removing these extra libraries (dispatch and CoreFoundation) from the swift.xctoolchain directory. However, it would be nice if the generator could do all this for us and correctly pull the Swift distribution for Linux automatically, if running on a Ubuntu or RHEL host.
The text was updated successfully, but these errors were encountered: