-
Notifications
You must be signed in to change notification settings - Fork 16
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Build Swift SDKs for a Linux host if the
--host
parameter matches a…
… Linux OS (`*-unknown-linux-gnu`) (#167) This fixes #114 and provides the following: - If the `--host` param or auto-detected `hostTriple.os` is `.linux`, the amazonlinux2 Swift toolchain is downloaded and included in the Swift SDK. Examples: ``` swift run swift-sdk-generator make-linux-sdk --swift-version 6.0.3-RELEASE --host x86_64-unknown-linux-gnu --target aarch64-unknown-linux-gnu swift run swift-sdk-generator make-linux-sdk --swift-version 5.10.1-RELEASE --host aarch64-unknown-linux-gnu --target x86_64-unknown-linux-gnu ``` - I chose `amazonlinux2` for the host toolchain as it seems to be compatible with *every* Swift-supported Linux distribution with glibc versions and included libraries. - Updated the README.md to show that Ubuntu, RHEL, Amazon Linux 2, and Debian are officially supported as hosts and somewhat supported as targets... :) For testing all of this, I updated the EndToEndTests: - If the`SWIFT_SDK_GENERATOR_TEST_LINUX_SWIFT_SDKS` env variable is defined, Swift SDKs are built for a Linux host with the arch matching the machine on which the tests are running. So on an M-series Mac, the triple `aarch64-unknown-linux-gnu` is used. Or on an Intel Mac or PC, then `x86_64-unknown-linux-gnu` is used as the `--host` triple. - When Linux Swift SDKs are being tested, then a matrix of Swift docker containers are run against each test case to ensure the SDK works on every Linux distribution: ``` [SwiftSDKGeneratorTests] Creating test project /tmp/FDFD488C-089B-4213-B927-0DE0F9BD6B3A/swift-sdk-generator-test [SwiftSDKGeneratorTests] Updating minimum swift-tools-version in test project... [SwiftSDKGeneratorTests] Building test project in 6.0-focal container [SwiftSDKGeneratorTests] Test project built successfully [SwiftSDKGeneratorTests] Building test project in 6.0-focal container with static-swift-stdlib [SwiftSDKGeneratorTests] Test project built successfully [SwiftSDKGeneratorTests] Building test project in 6.0-jammy container [SwiftSDKGeneratorTests] Test project built successfully [SwiftSDKGeneratorTests] Building test project in 6.0-jammy container with static-swift-stdlib [SwiftSDKGeneratorTests] Test project built successfully [SwiftSDKGeneratorTests] Building test project in 6.0-noble container [SwiftSDKGeneratorTests] Test project built successfully [SwiftSDKGeneratorTests] Building test project in 6.0-noble container with static-swift-stdlib [SwiftSDKGeneratorTests] Test project built successfully [SwiftSDKGeneratorTests] Building test project in 6.0-fedora39 container [SwiftSDKGeneratorTests] Test project built successfully [SwiftSDKGeneratorTests] Building test project in 6.0-fedora39 container with static-swift-stdlib [SwiftSDKGeneratorTests] Test project built successfully [SwiftSDKGeneratorTests] Building test project in 6.0-rhel-ubi9 container [SwiftSDKGeneratorTests] Test project built successfully [SwiftSDKGeneratorTests] Building test project in 6.0-rhel-ubi9 container with static-swift-stdlib [SwiftSDKGeneratorTests] Test project built successfully [SwiftSDKGeneratorTests] Building test project in 6.0-amazonlinux2 container [SwiftSDKGeneratorTests] Test project built successfully [SwiftSDKGeneratorTests] Building test project in 6.0-amazonlinux2 container with static-swift-stdlib [SwiftSDKGeneratorTests] Test project built successfully [SwiftSDKGeneratorTests] Building test project in 6.0-bookworm container [SwiftSDKGeneratorTests] Test project built successfully [SwiftSDKGeneratorTests] Building test project in 6.0-bookworm container with static-swift-stdlib [SwiftSDKGeneratorTests] Test project built successfully ```
- Loading branch information
1 parent
f63f812
commit 84d62bf
Showing
8 changed files
with
235 additions
and
69 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.