diff --git a/Sources/SwiftSDKGenerator/Generator/SwiftSDKGenerator+Copy.swift b/Sources/SwiftSDKGenerator/Generator/SwiftSDKGenerator+Copy.swift index 01b1bcd..4073149 100644 --- a/Sources/SwiftSDKGenerator/Generator/SwiftSDKGenerator+Copy.swift +++ b/Sources/SwiftSDKGenerator/Generator/SwiftSDKGenerator+Copy.swift @@ -85,6 +85,14 @@ extension SwiftSDKGenerator { } try await generator.createSymlink(at: sdkDirPath.appending("lib"), pointingTo: "usr/lib") + // Copy the dynamic linker, following symlinks if necessary + try await generator.copyFromDockerContainer( + id: containerID, + from: FilePath(targetTriple.interpreterPath), + to: sdkDirPath.appending(targetTriple.interpreterPath), + failIfNotExists: true + ) + // Python artifacts are redundant. try await generator.removeRecursively(at: sdkUsrLibPath.appending("python3.10")) @@ -109,3 +117,13 @@ extension SwiftSDKGenerator { } } } + +extension Triple { + var interpreterPath: String { + switch self.archName { + case "x86_64": "/lib64/ld-linux-x86-64.so.2" + case "aarch64": "/lib/ld-linux-aarch64.so.1" + default: fatalError("unsupported architecture \(self.archName)") + } + } +} diff --git a/Tests/SwiftSDKGeneratorTests/EndToEndTests.swift b/Tests/SwiftSDKGeneratorTests/EndToEndTests.swift index 7365969..2aef1c3 100644 --- a/Tests/SwiftSDKGeneratorTests/EndToEndTests.swift +++ b/Tests/SwiftSDKGeneratorTests/EndToEndTests.swift @@ -270,7 +270,6 @@ final class Swift59_UbuntuEndToEndTests: XCTestCase { } func testAarch64FromContainer() async throws { - try skipBroken("https://github.com/swiftlang/swift-sdk-generator/issues/147") try skipSlow() try await buildTestcases(config: config.withArchitecture("aarch64").withDocker()) } @@ -300,7 +299,6 @@ final class Swift510_UbuntuEndToEndTests: XCTestCase { } func testAarch64FromContainer() async throws { - try skipBroken("https://github.com/swiftlang/swift-sdk-generator/issues/147") try skipSlow() try await buildTestcases(config: config.withArchitecture("aarch64").withDocker()) } @@ -353,7 +351,6 @@ final class Swift59_RHELEndToEndTests: XCTestCase { ) func testAarch64FromContainer() async throws { - try skipBroken("https://github.com/swiftlang/swift-sdk-generator/issues/147") try skipSlow() try await buildTestcases(config: config.withArchitecture("aarch64").withDocker()) } @@ -373,7 +370,6 @@ final class Swift510_RHELEndToEndTests: XCTestCase { ) func testAarch64FromContainer() async throws { - try skipBroken("https://github.com/swiftlang/swift-sdk-generator/issues/147") try skipSlow() try await buildTestcases(config: config.withArchitecture("aarch64").withDocker()) } @@ -393,7 +389,7 @@ final class Swift60_RHELEndToEndTests: XCTestCase { ) func testAarch64FromContainer() async throws { - try skipBroken("https://github.com/swiftlang/swift-sdk-generator/issues/147") + try skipBroken("https://github.com/swiftlang/swift-sdk-generator/issues/152") try skipSlow() try await buildTestcases(config: config.withArchitecture("aarch64").withDocker()) }