Skip to content

Commit 5abdf52

Browse files
committed
Remove the addition of external-plugin-path for dev toolchains
SDK macro plugins are now provided within `Platforms/<Platform>.platform/Developer/usr/lib/swift/host/plugins` now, which is always added by the driver.
1 parent 35d3de2 commit 5abdf52

File tree

4 files changed

+0
-55
lines changed

4 files changed

+0
-55
lines changed

Sources/Build/BuildDescription/SwiftTargetBuildDescription.swift

Lines changed: 0 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -451,25 +451,6 @@ package final class SwiftTargetBuildDescription {
451451
}
452452
#endif
453453

454-
// If we're using an OSS toolchain, add the required arguments bringing in the plugin server from the default toolchain if available.
455-
if self.defaultBuildParameters.toolchain.isSwiftDevelopmentToolchain,
456-
DriverSupport.checkSupportedFrontendFlags(
457-
flags: ["-external-plugin-path"],
458-
toolchain: self.defaultBuildParameters.toolchain,
459-
fileSystem: self.fileSystem
460-
),
461-
let pluginServer = try self.defaultBuildParameters.toolchain.swiftPluginServerPath
462-
{
463-
let toolchainUsrPath = pluginServer.parentDirectory.parentDirectory
464-
let pluginPathComponents = ["lib", "swift", "host", "plugins"]
465-
466-
let pluginPath = toolchainUsrPath.appending(components: pluginPathComponents)
467-
args += ["-Xfrontend", "-external-plugin-path", "-Xfrontend", "\(pluginPath)#\(pluginServer.pathString)"]
468-
469-
let localPluginPath = toolchainUsrPath.appending(components: ["local"] + pluginPathComponents)
470-
args += ["-Xfrontend", "-external-plugin-path", "-Xfrontend", "\(localPluginPath)#\(pluginServer.pathString)"]
471-
}
472-
473454
if self.shouldDisableSandbox {
474455
let toolchainSupportsDisablingSandbox = DriverSupport.checkSupportedFrontendFlags(
475456
flags: ["-disable-sandbox"],

Sources/PackageModel/Toolchain.swift

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -25,12 +25,6 @@ public protocol Toolchain {
2525
/// Path to `lib/swift_static`
2626
var swiftStaticResourcesPath: AbsolutePath? { get }
2727

28-
/// Whether the used compiler is from a open source development toolchain.
29-
var isSwiftDevelopmentToolchain: Bool { get }
30-
31-
/// Path to the Swift plugin server utility.
32-
var swiftPluginServerPath: AbsolutePath? { get throws }
33-
3428
/// Path containing the macOS Swift stdlib.
3529
var macosSwiftStdlib: AbsolutePath { get throws }
3630

Sources/PackageModel/UserToolchain.swift

Lines changed: 0 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -84,8 +84,6 @@ public final class UserToolchain: Toolchain {
8484

8585
private let environment: EnvironmentVariables
8686

87-
public let isSwiftDevelopmentToolchain: Bool
88-
8987
public let installedSwiftPMConfiguration: InstalledSwiftPMConfiguration
9088

9189
public let providedLibraries: [ProvidedLibrary]
@@ -514,22 +512,6 @@ public final class UserToolchain: Toolchain {
514512
self.swiftCompilerPath = swiftCompilers.compile
515513
self.architectures = swiftSDK.architectures
516514

517-
#if canImport(Darwin)
518-
let toolchainPlistPath = self.swiftCompilerPath.parentDirectory.parentDirectory.parentDirectory
519-
.appending(component: "Info.plist")
520-
if localFileSystem.exists(toolchainPlistPath), let toolchainPlist = try? NSDictionary(
521-
contentsOf: URL(fileURLWithPath: toolchainPlistPath.pathString),
522-
error: ()
523-
), let overrideBuildSettings = toolchainPlist["OverrideBuildSettings"] as? NSDictionary,
524-
let isSwiftDevelopmentToolchainStringValue = overrideBuildSettings["SWIFT_DEVELOPMENT_TOOLCHAIN"] as? String {
525-
self.isSwiftDevelopmentToolchain = isSwiftDevelopmentToolchainStringValue == "YES"
526-
} else {
527-
self.isSwiftDevelopmentToolchain = false
528-
}
529-
#else
530-
self.isSwiftDevelopmentToolchain = false
531-
#endif
532-
533515
if let customInstalledSwiftPMConfiguration {
534516
self.installedSwiftPMConfiguration = customInstalledSwiftPMConfiguration
535517
} else {
@@ -879,16 +861,6 @@ public final class UserToolchain: Toolchain {
879861
configuration.xctestPath
880862
}
881863

882-
private let _swiftPluginServerPath = ThreadSafeBox<AbsolutePath?>()
883-
884-
public var swiftPluginServerPath: AbsolutePath? {
885-
get throws {
886-
try _swiftPluginServerPath.memoize {
887-
return try Self.derivePluginServerPath(triple: self.targetTriple)
888-
}
889-
}
890-
}
891-
892864
private static func loadJSONResource<T: Decodable>(
893865
config: AbsolutePath, type: T.Type, `default`: T
894866
)

Sources/SPMTestSupport/MockBuildTestHelper.swift

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -34,9 +34,7 @@ package struct MockToolchain: PackageModel.Toolchain {
3434
package let librarySearchPaths = [AbsolutePath]()
3535
package let swiftResourcesPath: AbsolutePath?
3636
package let swiftStaticResourcesPath: AbsolutePath? = nil
37-
package let isSwiftDevelopmentToolchain = false
3837
package let sdkRootPath: AbsolutePath? = nil
39-
package let swiftPluginServerPath: AbsolutePath? = nil
4038
package let extraFlags = PackageModel.BuildFlags()
4139
package let installedSwiftPMConfiguration = InstalledSwiftPMConfiguration.default
4240
package let providedLibraries = [ProvidedLibrary]()

0 commit comments

Comments
 (0)