Skip to content

Commit 54d208c

Browse files
Add support for Debian 13 (Trixie), add EndToEndTests (#249)
I'd like to be able to generate Swift SDKs for Debian Trixie since I've already built Swift for it: https://github.com/swift-embedded-linux/armhf-debian/releases/tag/6.2.1 The ubuntu24.04 toolchains are binary compatible with Debian 13 right now, so if you don't have Swift built for it that version will automatically be downloaded and included.
1 parent 01e610b commit 54d208c

File tree

3 files changed

+77
-8
lines changed

3 files changed

+77
-8
lines changed

Sources/SwiftSDKGenerator/PlatformModels/LinuxDistribution.swift

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -93,11 +93,13 @@ public enum LinuxDistribution: Hashable, Sendable {
9393
public enum Debian: String, Sendable {
9494
case bullseye
9595
case bookworm
96+
case trixie
9697

9798
init(version: String) throws {
9899
switch version {
99100
case "11": self = .bullseye
100101
case "12": self = .bookworm
102+
case "13": self = .trixie
101103
default:
102104
throw GeneratorError.unknownLinuxDistribution(
103105
name: LinuxDistribution.Name.debian.rawValue,
@@ -110,6 +112,7 @@ public enum LinuxDistribution: Hashable, Sendable {
110112
switch self {
111113
case .bullseye: return "11"
112114
case .bookworm: return "12"
115+
case .trixie: return "13"
113116
}
114117
}
115118

@@ -142,6 +145,13 @@ public enum LinuxDistribution: Hashable, Sendable {
142145
"libicu-dev",
143146
"libstdc++-12-dev",
144147
]
148+
case .trixie:
149+
return commonPackages + [
150+
"libgcc-14-dev",
151+
"libicu76",
152+
"libicu-dev",
153+
"libstdc++-14-dev",
154+
]
145155
}
146156
}
147157
}

Sources/SwiftSDKGenerator/PlatformModels/VersionsConfiguration.swift

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,9 @@ public struct VersionsConfiguration: Sendable {
5050
} else if self.swiftVersion.hasPrefix("5.9") || self.swiftVersion == "5.10" {
5151
// Ubuntu 22.04 toolchain is binary compatible with Debian 12
5252
return "ubuntu22.04"
53+
} else if debian.version == "13" {
54+
// Ubuntu 24.04 toolchain is binary compatible with Debian 13
55+
return "ubuntu24.04"
5356
}
5457
return "debian\(debian.version)"
5558
case let .rhel(rhel):

Tests/SwiftSDKGeneratorTests/EndToEndTests.swift

Lines changed: 64 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -679,8 +679,22 @@ final class Swift510_DebianEndToEndTests: XCTestCase {
679679
)
680680
}
681681

682-
// NOTE: Debian 11 containers do not exist for Swift, and the generator does not support
683-
// generating this container for you automatically, so we do not test this scenario.
682+
func testTrixieAarch64Direct() async throws {
683+
try skipSlow()
684+
try await buildTestcases(
685+
config: config.withLinuxDistributionVersion("13").withArchitecture("aarch64")
686+
)
687+
}
688+
689+
func testTrixieX86_64Direct() async throws {
690+
try skipSlow()
691+
try await buildTestcases(
692+
config: config.withLinuxDistributionVersion("13").withArchitecture("x86_64")
693+
)
694+
}
695+
696+
// NOTE: Debian 11 and 13 containers do not exist for Swift, and the generator does not
697+
// support creating this container for you automatically, so we do not test this scenario.
684698
}
685699

686700
final class Swift60_DebianEndToEndTests: XCTestCase {
@@ -726,8 +740,22 @@ final class Swift60_DebianEndToEndTests: XCTestCase {
726740
)
727741
}
728742

729-
// NOTE: Debian 11 containers do not exist for Swift, and the generator does not support
730-
// generating this container for you automatically, so we do not test this scenario.
743+
func testTrixieAarch64Direct() async throws {
744+
try skipSlow()
745+
try await buildTestcases(
746+
config: config.withLinuxDistributionVersion("13").withArchitecture("aarch64")
747+
)
748+
}
749+
750+
func testTrixieX86_64Direct() async throws {
751+
try skipSlow()
752+
try await buildTestcases(
753+
config: config.withLinuxDistributionVersion("13").withArchitecture("x86_64")
754+
)
755+
}
756+
757+
// NOTE: Debian 11 and 13 containers do not exist for Swift, and the generator does not
758+
// support creating this container for you automatically, so we do not test this scenario.
731759
}
732760

733761
final class Swift61_DebianEndToEndTests: XCTestCase {
@@ -773,8 +801,22 @@ final class Swift61_DebianEndToEndTests: XCTestCase {
773801
)
774802
}
775803

776-
// NOTE: Debian 11 containers do not exist for Swift, and the generator does not support
777-
// generating this container for you automatically, so we do not test this scenario.
804+
func testTrixieAarch64Direct() async throws {
805+
try skipSlow()
806+
try await buildTestcases(
807+
config: config.withLinuxDistributionVersion("13").withArchitecture("aarch64")
808+
)
809+
}
810+
811+
func testTrixieX86_64Direct() async throws {
812+
try skipSlow()
813+
try await buildTestcases(
814+
config: config.withLinuxDistributionVersion("13").withArchitecture("x86_64")
815+
)
816+
}
817+
818+
// NOTE: Debian 11 and 13 containers do not exist for Swift, and the generator does not
819+
// support creating this container for you automatically, so we do not test this scenario.
778820
}
779821

780822
final class Swift62_DebianEndToEndTests: XCTestCase {
@@ -820,8 +862,22 @@ final class Swift62_DebianEndToEndTests: XCTestCase {
820862
)
821863
}
822864

823-
// NOTE: Debian 11 containers do not exist for Swift, and the generator does not support
824-
// generating this container for you automatically, so we do not test this scenario.
865+
func testTrixieAarch64Direct() async throws {
866+
try skipSlow()
867+
try await buildTestcases(
868+
config: config.withLinuxDistributionVersion("13").withArchitecture("aarch64")
869+
)
870+
}
871+
872+
func testTrixieX86_64Direct() async throws {
873+
try skipSlow()
874+
try await buildTestcases(
875+
config: config.withLinuxDistributionVersion("13").withArchitecture("x86_64")
876+
)
877+
}
878+
879+
// NOTE: Debian 11 and 13 containers do not exist for Swift, and the generator does not
880+
// support creating this container for you automatically, so we do not test this scenario.
825881
}
826882

827883
final class Swift59_RHELEndToEndTests: XCTestCase {

0 commit comments

Comments
 (0)