Skip to content

Commit a9f9e78

Browse files
committed
Revert "Add support for building Swift SDKs for armv7 with target Swift toolchain or a container (swiftlang#170)"
This reverts commit d4aba13.
1 parent a9f8e2a commit a9f9e78

File tree

6 files changed

+9
-32
lines changed

6 files changed

+9
-32
lines changed

Sources/SwiftSDKGenerator/Generator/SwiftSDKGenerator+Copy.swift

Lines changed: 6 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -73,11 +73,6 @@ extension SwiftSDKGenerator {
7373
// But not in all containers, so don't fail if it does not exist.
7474
if case .ubuntu = targetDistribution {
7575
subpaths += [("\(targetTriple.archName)-linux-gnu", false)]
76-
77-
// Custom subpath for armv7
78-
if targetTriple.archName == "armv7" {
79-
subpaths += [("arm-linux-gnueabihf", false)]
80-
}
8176
}
8277

8378
for (subpath, failIfNotExists) in subpaths {
@@ -109,16 +104,13 @@ extension SwiftSDKGenerator {
109104
func copyTargetSwift(from distributionPath: FilePath, sdkDirPath: FilePath) async throws {
110105
logger.info("Copying Swift core libraries for the target triple into Swift SDK bundle...")
111106

112-
for (pathWithinPackage, pathWithinSwiftSDK, ignoreIfMissing) in [
113-
("lib/swift", sdkDirPath.appending("usr/lib"), false),
114-
("lib/swift_static", sdkDirPath.appending("usr/lib"), false),
115-
("lib/clang", sdkDirPath.appending("usr/lib"), true),
116-
("include", sdkDirPath.appending("usr"), false),
107+
for (pathWithinPackage, pathWithinSwiftSDK) in [
108+
("lib/swift", sdkDirPath.appending("usr/lib")),
109+
("lib/swift_static", sdkDirPath.appending("usr/lib")),
110+
("lib/clang", sdkDirPath.appending("usr/lib")),
111+
("include", sdkDirPath.appending("usr")),
117112
] {
118-
try await rsync(
119-
from: distributionPath.appending(pathWithinPackage),
120-
to: pathWithinSwiftSDK, ignoreIfMissing: ignoreIfMissing
121-
)
113+
try await rsync(from: distributionPath.appending(pathWithinPackage), to: pathWithinSwiftSDK)
122114
}
123115
}
124116
}
@@ -128,7 +120,6 @@ extension Triple {
128120
switch self.archName {
129121
case "x86_64": return "/lib64/ld-linux-x86-64.so.2"
130122
case "aarch64": return "/lib/ld-linux-aarch64.so.1"
131-
case "armv7": return "/lib/ld-linux-armhf.so.3"
132123
default: fatalError("unsupported architecture \(self.archName)")
133124
}
134125
}

Sources/SwiftSDKGenerator/Generator/SwiftSDKGenerator+Entrypoint.swift

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,6 @@ public extension Triple.Arch {
2626
case .aarch64: return "arm64"
2727
case .x86_64: return "amd64"
2828
case .wasm32: return "wasm32"
29-
case .arm: return "armhf"
3029
default: fatalError("\(self) is not supported yet")
3130
}
3231
}

Sources/SwiftSDKGenerator/Generator/SwiftSDKGenerator.swift

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -158,10 +158,9 @@ public actor SwiftSDKGenerator {
158158
try Data(contentsOf: URL(fileURLWithPath: path.string))
159159
}
160160

161-
func rsync(from source: FilePath, to destination: FilePath, ignoreIfMissing: Bool = false) async throws {
161+
func rsync(from source: FilePath, to destination: FilePath) async throws {
162162
try self.createDirectoryIfNeeded(at: destination)
163-
let ignoreMissingArgs = ignoreIfMissing ? "--ignore-missing-args" : ""
164-
try await Shell.run("rsync -a \(ignoreMissingArgs) \(source) \(destination)", shouldLogCommands: self.isVerbose)
163+
try await Shell.run("rsync -a \(source) \(destination)", shouldLogCommands: self.isVerbose)
165164
}
166165

167166
func rsyncContents(from source: FilePath, to destination: FilePath) async throws {

Sources/SwiftSDKGenerator/PlatformModels/Triple.swift

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,6 @@ extension Triple.Arch {
3333
case .aarch64: return "aarch64"
3434
case .x86_64: return "x86_64"
3535
case .wasm32: return "wasm32"
36-
case .arm: return "arm"
3736
default: fatalError("\(self) is not supported yet")
3837
}
3938
}

Sources/SwiftSDKGenerator/SwiftSDKRecipes/LinuxRecipe.swift

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -158,7 +158,7 @@ public struct LinuxRecipe: SwiftSDKRecipe {
158158
self.linuxDistribution
159159
.release
160160
)_\(
161-
self.mainTargetTriple.archName
161+
self.mainTargetTriple.arch!.linuxConventionName
162162
)
163163
"""
164164
}
@@ -217,12 +217,6 @@ public struct LinuxRecipe: SwiftSDKRecipe {
217217
engine: QueryEngine,
218218
httpClient client: some HTTPClientProtocol
219219
) async throws -> SwiftSDKProduct {
220-
if self.linuxDistribution.name == .rhel && self.mainTargetTriple.archName == "armv7" {
221-
throw GeneratorError.distributionDoesNotSupportArchitecture(
222-
self.linuxDistribution, targetArchName: self.mainTargetTriple.archName
223-
)
224-
}
225-
226220
let sdkDirPath = self.sdkDirPath(paths: generator.pathsConfiguration)
227221
if !generator.isIncremental {
228222
try await generator.removeRecursively(at: sdkDirPath)

Sources/SwiftSDKGenerator/SystemUtils/GeneratorError.swift

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,6 @@ enum GeneratorError: Error {
2222
case unknownCPUArchitecture(String)
2323
case unknownLLDVersion(String)
2424
case distributionSupportsOnlyDockerGenerator(LinuxDistribution)
25-
case distributionDoesNotSupportArchitecture(LinuxDistribution, targetArchName: String)
2625
case fileDoesNotExist(FilePath)
2726
case fileDownloadFailed(URL, String)
2827
case ubuntuPackagesDecompressionFailure
@@ -51,10 +50,6 @@ extension GeneratorError: CustomStringConvertible {
5150
Target Linux distribution \(linuxDistribution) supports Swift SDK generation only when `--with-docker` flag is \
5251
passed.
5352
"""
54-
case let .distributionDoesNotSupportArchitecture(linuxDistribution, targetArchName):
55-
return """
56-
Target Linux distribution \(linuxDistribution) does not support the target architecture: \(targetArchName)
57-
"""
5853
case let .fileDoesNotExist(filePath):
5954
return "Expected to find a file at path `\(filePath)`."
6055
case let .fileDownloadFailed(url, status):

0 commit comments

Comments
 (0)