Skip to content

generator/linux: Copy ELF interpreter from architecture-specific locations #154

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Nov 27, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,14 @@ extension SwiftSDKGenerator {
}
try await generator.createSymlink(at: sdkDirPath.appending("lib"), pointingTo: "usr/lib")

// Copy the ELF interpreter
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"))

Expand All @@ -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)")
}
}
}
6 changes: 1 addition & 5 deletions Tests/SwiftSDKGeneratorTests/EndToEndTests.swift
Original file line number Diff line number Diff line change
Expand Up @@ -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())
}
Expand Down Expand Up @@ -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())
}
Expand Down Expand Up @@ -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())
}
Expand All @@ -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())
}
Expand All @@ -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())
}
Expand Down