Skip to content

Commit 2aa8df4

Browse files
authored
Revert "Optional xcframework support for Linux" (swiftlang#9374)
Reverts swiftlang#7239 Fails on some linux distros
1 parent 2cd79dc commit 2aa8df4

File tree

16 files changed

+12
-312
lines changed

16 files changed

+12
-312
lines changed

Fixtures/Miscellaneous/LibraryEvolutionLinuxXCF/SwiftFramework/Package.swift

Lines changed: 0 additions & 16 deletions
This file was deleted.

Fixtures/Miscellaneous/LibraryEvolutionLinuxXCF/SwiftFramework/Sources/SwiftFramework/SwiftFramework.swift

Lines changed: 0 additions & 8 deletions
This file was deleted.

Fixtures/Miscellaneous/LibraryEvolutionLinuxXCF/TestBinary/Package.swift

Lines changed: 0 additions & 17 deletions
This file was deleted.

Fixtures/Miscellaneous/LibraryEvolutionLinuxXCF/TestBinary/Sources/TestBinary/Main.swift

Lines changed: 0 additions & 3 deletions
This file was deleted.

Sources/Build/BuildPlan/BuildPlan+Clang.swift

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -65,11 +65,7 @@ extension BuildPlan {
6565
clangTarget.libraryBinaryPaths.insert(library.libraryPath)
6666
}
6767
case .xcframework:
68-
let libraries = try self.parseXCFramework(
69-
for: target,
70-
triple: clangTarget.buildParameters.triple,
71-
enableXCFrameworksOnLinux: clangTarget.buildParameters.enableXCFrameworksOnLinux
72-
)
68+
let libraries = try self.parseXCFramework(for: target, triple: clangTarget.buildParameters.triple)
7369
for library in libraries {
7470
library.headersPaths.forEach {
7571
clangTarget.additionalFlags += ["-I", $0.pathString]

Sources/Build/BuildPlan/BuildPlan+Product.swift

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -298,8 +298,7 @@ extension BuildPlan {
298298
case .xcframework:
299299
let libraries = try self.parseXCFramework(
300300
for: binaryTarget,
301-
triple: productDescription.buildParameters.triple,
302-
enableXCFrameworksOnLinux: productDescription.buildParameters.enableXCFrameworksOnLinux
301+
triple: productDescription.buildParameters.triple
303302
)
304303
for library in libraries {
305304
libraryBinaryPaths.insert(library.libraryPath)

Sources/Build/BuildPlan/BuildPlan+Swift.swift

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -61,11 +61,7 @@ extension BuildPlan {
6161
swiftTarget.libraryBinaryPaths.insert(library.libraryPath)
6262
}
6363
case .xcframework:
64-
let libraries = try self.parseXCFramework(
65-
for: target,
66-
triple: swiftTarget.buildParameters.triple,
67-
enableXCFrameworksOnLinux: swiftTarget.buildParameters.enableXCFrameworksOnLinux
68-
)
64+
let libraries = try self.parseXCFramework(for: target, triple: swiftTarget.buildParameters.triple)
6965
for library in libraries {
7066
library.headersPaths.forEach {
7167
swiftTarget.additionalFlags += ["-I", $0.pathString, "-Xcc", "-I", "-Xcc", $0.pathString]

Sources/Build/BuildPlan/BuildPlan.swift

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -653,12 +653,9 @@ public class BuildPlan: SPMBuildCore.BuildPlan {
653653
}
654654

655655
/// Extracts the library information from an XCFramework.
656-
func parseXCFramework(for binaryTarget: BinaryModule, triple: Basics.Triple, enableXCFrameworksOnLinux: Bool) throws -> [LibraryInfo] {
656+
func parseXCFramework(for binaryTarget: BinaryModule, triple: Basics.Triple) throws -> [LibraryInfo] {
657657
try self.externalLibrariesCache.memoize(key: binaryTarget) {
658-
if !enableXCFrameworksOnLinux && triple.os == .linux {
659-
return []
660-
}
661-
return try binaryTarget.parseXCFrameworks(for: triple, fileSystem: self.fileSystem)
658+
try binaryTarget.parseXCFrameworks(for: triple, fileSystem: self.fileSystem)
662659
}
663660
}
664661

Sources/CoreCommands/Options.swift

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -515,13 +515,6 @@ public struct BuildOptions: ParsableArguments {
515515
@Flag(name: .customLong("experimental-prepare-for-indexing-no-lazy"), help: .hidden)
516516
var prepareForIndexingNoLazy: Bool = false
517517

518-
/// Hidden option to allow XCFrameworks on Linux
519-
@Flag(
520-
name: .customLong("experimental-xcframeworks-on-linux"),
521-
help: .hidden
522-
)
523-
public var enableXCFrameworksOnLinux: Bool = false
524-
525518
/// Whether to enable generation of `.swiftinterface`s alongside `.swiftmodule`s.
526519
@Flag(name: .customLong("enable-parseable-module-interfaces"))
527520
public var shouldEnableParseableModuleInterfaces: Bool = false

Sources/CoreCommands/SwiftCommandState.swift

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -941,7 +941,6 @@ public final class SwiftCommandState {
941941
sanitizers: options.build.enabledSanitizers,
942942
indexStoreMode: options.build.indexStoreMode.buildParameter,
943943
prepareForIndexing: prepareForIndexingMode,
944-
enableXCFrameworksOnLinux: options.build.enableXCFrameworksOnLinux,
945944
debuggingParameters: .init(
946945
debugInfoFormat: self.options.build.debugInfoFormat.buildParameter,
947946
triple: triple,

0 commit comments

Comments
 (0)