You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Support Debian 11 and Debian 12 distributions in the generator (#203)
This completes #116 and can be used to generate Debian Swift SDKs either by downloading dependencies from mirrors directly or from containers.
- Added Debian `bullseye` and `bookworm` to `LinuxDistribution` and modded `SwiftSDKGenerator+Download` to work downloading both Ubuntu and Debian packages from their respective mirrors.
- Swift SDKs can be generated from Docker using the `swift:*-bookworm` container for Debian 12, but for Debian 11 you must create the container yourself/manually put the Swift toolchain into it.
- Added special handling in `VersionsConfiguration` so that if Debian 11 (bullseye) is selected, the Ubuntu 20.04 toolchain is downloaded. If Debian 12 (bookworm) is selected for Swift 5.9.* or Swift 5.10, the Ubuntu 22.04 toolchain is used instead. https://askubuntu.com/a/445496
- Added tests for the special handling in `LinuxRecipeTests.testItemsToDownloadForDebianTargets()` to ensure the correct toolchain is selected.
To use:
```bash
$ swift run swift-sdk-generator make-linux-sdk --linux-distribution-name debian --linux-distribution-version 11
$ swift run swift-sdk-generator make-linux-sdk --linux-distribution-name debian --linux-distribution-version 12
$ swift run swift-sdk-generator make-linux-sdk --linux-distribution-name debian --linux-distribution-version 12 --with-docker
```
I also added EndToEndTests for all Debian supported combinations, resulting in another 30GB of generated Swift SDKs:
```
2.1 GiB [####################] /debian_12_x86_64_6.0.3-RELEASE_with-docker.artifactbundle
2.1 GiB [################### ] /debian_12_aarch64_6.0.3-RELEASE_with-docker.artifactbundle
2.0 GiB [################## ] /debian_12_x86_64_5.10.1-RELEASE_with-docker.artifactbundle
1.9 GiB [################# ] /debian_12_x86_64_6.0.3-RELEASE.artifactbundle
1.9 GiB [################# ] /debian_12_aarch64_6.0.3-RELEASE.artifactbundle
1.9 GiB [################# ] /debian_11_x86_64_6.0.3-RELEASE.artifactbundle
1.9 GiB [################# ] /debian_12_aarch64_5.10.1-RELEASE_with-docker.artifactbundle
1.9 GiB [################# ] /debian_11_aarch64_6.0.3-RELEASE.artifactbundle
1.8 GiB [################ ] /debian_12_x86_64_5.10.1-RELEASE.artifactbundle
1.7 GiB [################ ] /debian_12_aarch64_5.10.1-RELEASE.artifactbundle
1.7 GiB [################ ] /debian_11_x86_64_5.10.1-RELEASE.artifactbundle
1.7 GiB [############### ] /debian_11_aarch64_5.10.1-RELEASE.artifactbundle
1.7 GiB [############### ] /debian_12_x86_64_5.9.2-RELEASE.artifactbundle
1.7 GiB [############### ] /debian_12_aarch64_5.9.2-RELEASE.artifactbundle
1.7 GiB [############### ] /debian_11_x86_64_5.9.2-RELEASE.artifactbundle
1.6 GiB [############### ] /debian_11_aarch64_5.9.2-RELEASE.artifactbundle
```
To make this work properly, I modded the `targetSwift` path in `DownloadableArtifacts` to use the swiftPlatform name in the file name to avoid the issues I saw with the EndToEndTests, where the *.tar.gz files would get corrupted when trying to download a different version of the target Swift on top of the existing file. Now, they look like this:
```
target_swift_5.10.1-RELEASE_debian12_aarch64.tar.gz target_swift_5.9.2-RELEASE_ubuntu22.04_aarch64.tar.gz
target_swift_5.10.1-RELEASE_debian12_x86_64.tar.gz target_swift_5.9.2-RELEASE_ubuntu22.04_x86_64.tar.gz
target_swift_5.10.1-RELEASE_ubuntu20.04_aarch64.tar.gz target_swift_6.0.3-RELEASE_debian12_aarch64.tar.gz
target_swift_5.10.1-RELEASE_ubuntu20.04_x86_64.tar.gz target_swift_6.0.3-RELEASE_debian12_x86_64.tar.gz
target_swift_5.10-RELEASE_ubuntu20.04_aarch64.tar.gz target_swift_6.0.3-RELEASE_ubuntu20.04_aarch64.tar.gz
target_swift_5.9.2-RELEASE_ubuntu20.04_aarch64.tar.gz target_swift_6.0.3-RELEASE_ubuntu20.04_x86_64.tar.gz
target_swift_5.9.2-RELEASE_ubuntu20.04_x86_64.tar.gz
```
[^1]: Since LLVM project doesn't provide pre-built binaries of `lld` for macOS on x86_64, it will be automatically built
55
55
from sources by the generator, which will increase its run by at least 15 minutes on recent hardware. You will also
56
56
need CMake and Ninja preinstalled (e.g. via `brew install cmake ninja`).
57
-
[^2]: These distributions are only supported by Swift 5.10.1 and later as both host and target platforms.
57
+
[^2]: Swift does not officially support Debian 11 or Debian 12 with Swift versions before 5.10.1. However, the Ubuntu 20.04/22.04 toolchains can be used with Debian 11 and 12 (respectively) since they are binary compatible.
58
58
[^3]: These versions are technically supported but require custom commands and a Docker container to build the Swift SDK, as the generator will not download dependencies for these distributions automatically. See [issue #138](https://github.com/swiftlang/swift-sdk-generator/issues/138).
0 commit comments