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

Add ability to create an SDK with an external sysroot and distribution name/version #186

Open
xtremekforever opened this issue Feb 15, 2025 · 0 comments

Comments

@xtremekforever
Copy link
Contributor

Since the Swift SDK Generator is becoming more and more useful for generating Swift SDKs for various Linux versions and architectures, one thing I think would be very useful is to have the ability to generate a Swift SDK for a custom sysroot and using a custom distribution name and version. For example, say I built Swift for openSUSE Leap 15, then wanted to create a Swift SDK targeting that. I could do something like this:

swift run swift-sdk-generator make-linux-sdk --swift-version 6.0.3-RELEASE \
   --target-sysroot ~/sysroot-opensuse-leap-15 --target-swift-package-path ~/swift-6.0.3-opensuse-leap-15 \
   --linux-distribution-name opensuse --linux-distribution-version leap-15

This suggests adding the --target-sysroot option to use for the target SDK instead of relying on a container or downloading packages (like for Ubuntu). And also, this would be required if the --linux-distribution-name and --linux-distribution-version are passed with unknown values.

I see this could even be useful for the case where people are building Swift for completely different distributions, like Yocto for example. Someone could have their custom-baked Linux distro and custom build of Swift, and generate a Swift SDK for their platform:

swift run swift-sdk-generator make-linux-sdk --swift-version 6.0.3-RELEASE \
   --target-sysroot ~/sysroot-custom-yocto --target-swift-package-path ~/swift-6.0.3-custom-yocto \
   --linux-distribution-name custom-yocto --linux-distribution-version 1.0.0

Just some ideas to make the swift-sdk-generator even more capable. I will note that I'm generating my own Swift SDKs for my company's Yocto distribution. But, if the swift-sdk-generator had the support to do this then it is even more accessible for the Swift ecosystem.

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

1 participant