Skip to content

Commit 1889cd1

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. (cherry picked from commit e9791b0)
1 parent 85cc54c commit 1889cd1

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
@@ -439,25 +439,6 @@ package final class SwiftTargetBuildDescription {
439439
}
440440
#endif
441441

442-
// If we're using an OSS toolchain, add the required arguments bringing in the plugin server from the default toolchain if available.
443-
if self.buildParameters.toolchain.isSwiftDevelopmentToolchain,
444-
DriverSupport.checkSupportedFrontendFlags(
445-
flags: ["-external-plugin-path"],
446-
toolchain: self.buildParameters.toolchain,
447-
fileSystem: self.fileSystem
448-
),
449-
let pluginServer = try self.buildParameters.toolchain.swiftPluginServerPath
450-
{
451-
let toolchainUsrPath = pluginServer.parentDirectory.parentDirectory
452-
let pluginPathComponents = ["lib", "swift", "host", "plugins"]
453-
454-
let pluginPath = toolchainUsrPath.appending(components: pluginPathComponents)
455-
args += ["-Xfrontend", "-external-plugin-path", "-Xfrontend", "\(pluginPath)#\(pluginServer.pathString)"]
456-
457-
let localPluginPath = toolchainUsrPath.appending(components: ["local"] + pluginPathComponents)
458-
args += ["-Xfrontend", "-external-plugin-path", "-Xfrontend", "\(localPluginPath)#\(pluginServer.pathString)"]
459-
}
460-
461442
if self.disableSandbox {
462443
let toolchainSupportsDisablingSandbox = DriverSupport.checkSupportedFrontendFlags(flags: ["-disable-sandbox"], toolchain: self.buildParameters.toolchain, fileSystem: fileSystem)
463444
if toolchainSupportsDisablingSandbox {

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: [LibraryMetadata]
@@ -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 {
@@ -885,14 +867,4 @@ public final class UserToolchain: Toolchain {
885867
public var xctestPath: AbsolutePath? {
886868
configuration.xctestPath
887869
}
888-
889-
private let _swiftPluginServerPath = ThreadSafeBox<AbsolutePath?>()
890-
891-
public var swiftPluginServerPath: AbsolutePath? {
892-
get throws {
893-
try _swiftPluginServerPath.memoize {
894-
return try Self.derivePluginServerPath(triple: self.targetTriple)
895-
}
896-
}
897-
}
898870
}

Sources/SPMTestSupport/MockBuildTestHelper.swift

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,9 +32,7 @@ package struct MockToolchain: PackageModel.Toolchain {
3232
package let librarySearchPaths = [AbsolutePath]()
3333
package let swiftResourcesPath: AbsolutePath? = nil
3434
package let swiftStaticResourcesPath: AbsolutePath? = nil
35-
package let isSwiftDevelopmentToolchain = false
3635
package let sdkRootPath: AbsolutePath? = nil
37-
package let swiftPluginServerPath: AbsolutePath? = nil
3836
package let extraFlags = PackageModel.BuildFlags()
3937
package let installedSwiftPMConfiguration = InstalledSwiftPMConfiguration.default
4038
package let providedLibraries = [LibraryMetadata]()

0 commit comments

Comments
 (0)