swift-sdk-generator: Creating an AmazonLinux2 Swift SDK fails
Hello,
I wonder if it would be possible to generate an Amazon Linux 2 SDK ?
When I try to follow instruction to generate a SDK with a docker image, it generates files with the name Ubuntu
I surely missed something.
swift run swift-sdk-generator make-linux-sdk --from-container-image swift:6.0-amazonlinux2 --with-docker --swift-version 6.0.1-RELEASE
Building for debugging...
[1/1] Write swift-version-7BB6C6736DFA3E78.txt
Build of product 'swift-sdk-generator' complete! (0.33s)
Looking up configuration values...
Downloading required toolchain packages...
Using downloaded artifacts in these locations:
/Users/stormacq/Desktop/swift-sdk-generator/Artifacts/host_llvm_17.0.5_arm64-apple-macos15.0.0.tar.xz
/Users/stormacq/Desktop/swift-sdk-generator/Artifacts/host_swift_6.0.1-RELEASE_arm64-apple-macos15.0.0.pkg
Unpacking and copying Swift binaries for the host triple...
10608439 blocks
Launching a Docker container to copy Swift SDK for the target triple from it...
Copying Swift core libraries for the target triple into Swift SDK bundle...
Unpacking and copying `lld` linker...
Fixing up absolute symlinks...
Fixing absolute paths in `glibc.modulemap`...
Generating toolset JSON file...
Generating destination JSON file...
Generating .artifactbundle manifest file...
All done! Install the newly generated SDK with this command:
swift experimental-sdk install /Users/stormacq/Desktop/swift-sdk-generator/Bundles/6.0.1-RELEASE_ubuntu_jammy_aarch64.artifactbundle
After that, use the newly installed SDK when building with this command:
swift build --experimental-swift-sdk 6.0.1-RELEASE_ubuntu_jammy_aarch64
Time taken for this generator run: 3:08 seconds.
About this issue
- Original URL
- State: closed
- Created 2 years ago
- Comments: 21 (15 by maintainers)
Commits related to this issue
- tests: Fix EndToEnd test deadlock under `swift test`, but exclude from CI (#144) Building an SDK requires running the sdk-generator with `swift run swift-sdk-generator`. This takes a lock on `.build... — committed to swiftlang/swift-sdk-generator by euanh 2 years ago
- generator/linux: Use `--ldpath` linker flag for 5.9 Swift Package Manager's linker flag handling changed between 5.9 and 5.10. The flags which work for 5.9 cause linking failures 5.10 and later, an... — committed to euanh/swift-sdk-generator by euanh 2 years ago
- generator/linux: Use `--ldpath` linker flag for 5.9 Swift Package Manager's linker flag handling changed between 5.9 and 5.10. The flags which work for 5.9 cause linking failures 5.10 and later, an... — committed to euanh/swift-sdk-generator by euanh 2 years ago
- generator/linux: Use `--ldpath` linker flag for 5.9 (#151) Swift Package Manager's linker flag handling changed between 5.9 and 5.10. The flags which work for 5.9 cause linking failures 5.10 and la... — committed to swiftlang/swift-sdk-generator by euanh 2 years ago
- Merge branch '#138-amazon-linux-and-general-fixes' into develop — committed to xtremekforever/swift-sdk-generator by xtremekforever 2 years ago
- Merge branch 'main' into #138-amazon-linux-and-general-fixes — committed to xtremekforever/swift-sdk-generator by xtremekforever 2 years ago
- Fix support for Amazon Linux 2 x86_64, add EndToEndTests for all RHEL distributions (#195) This fixes the final issue we saw with #138 where there was an error generating an `amazonlinux2` Swift SDK ... — committed to swiftlang/swift-sdk-generator by xtremekforever 2 years ago
Thank you @euanh and @xtremekforever, closing this now.
Amazon Linux is based on RHEL, so if certain logic of Swift SDK creation can be shared between distributions instead of maintaining two separate copies, why not share those?
Hi @sebsto
I can reproduce this problem.
This is the default, you can override it using the
--sdk-nameflag e.g.--sdk-name 6.0.1-RELEASE_amazon_linux_2_aarch64My initial thought was that this was also caused by the SDK generator’s default assumption that it is working with an Ubuntu-derived distribution, whereas it seems Amazon Linux is based on CentOS. I had hoped that specifying
--linux-distribution rhelwould fix this - that flag causes it to handle some Ubuntu/RHEL differences. However I get the same error so I’ll need to investigate more.