Skip to content

Commit a5cc373

Browse files
committed
Stop adding '-external-plugin-path' to SDK directories
Apple SDK plugins are placed under '{}.platform/Developer/usr' directories, not in the SDK directory. Adding nonexisting paths can be confusing. rdar://121451763
1 parent ca72a65 commit a5cc373

File tree

2 files changed

+0
-23
lines changed

2 files changed

+0
-23
lines changed

Sources/SwiftDriver/Toolchains/DarwinToolchain.swift

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -434,15 +434,6 @@ public final class DarwinToolchain: Toolchain {
434434
}
435435

436436
if driver.isFrontendArgSupported(.externalPluginPath) {
437-
// Default paths for compiler plugins found within an SDK (accessed via
438-
// that SDK's plugin server).
439-
let sdkPathRoot = VirtualPath.lookup(sdkPath).appending(components: "usr")
440-
commandLine.appendFlag(.externalPluginPath)
441-
commandLine.appendFlag("\(sdkPathRoot.pluginPath.name)#\(sdkPathRoot.pluginServerPath.name)")
442-
443-
commandLine.appendFlag(.externalPluginPath)
444-
commandLine.appendFlag("\(sdkPathRoot.localPluginPath.name)#\(sdkPathRoot.pluginServerPath.name)")
445-
446437
// Determine the platform path. For simulator platforms, look into the
447438
// corresponding device platform instance.
448439
let origPlatformPath = VirtualPath.lookup(sdkPath)

Tests/SwiftDriverTests/SwiftDriverTests.swift

Lines changed: 0 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -7314,19 +7314,6 @@ final class SwiftDriverTests: XCTestCase {
73147314
XCTAssertLessThan(pluginB2Index!, pluginCIndex!)
73157315

73167316
#if os(macOS)
7317-
XCTAssertTrue(job.commandLine.contains(.flag("-external-plugin-path")))
7318-
let sdkServerPath = sdkRoot.appending(components: "usr", "bin", "swift-plugin-server").pathString
7319-
let sdkPluginPath = sdkRoot.appending(components: "usr", "lib", "swift", "host", "plugins").pathString
7320-
7321-
let sdkPluginPathIndex = job.commandLine.firstIndex(of: .flag("\(sdkPluginPath)#\(sdkServerPath)"))
7322-
XCTAssertNotNil(sdkPluginPathIndex)
7323-
XCTAssertLessThan(pluginCIndex!, sdkPluginPathIndex!)
7324-
7325-
let sdkLocalPluginPath = sdkRoot.appending(components: "usr", "local", "lib", "swift", "host", "plugins").pathString
7326-
let sdkLocalPluginPathIndex = job.commandLine.firstIndex(of: .flag("\(sdkLocalPluginPath)#\(sdkServerPath)"))
7327-
XCTAssertNotNil(sdkLocalPluginPathIndex)
7328-
XCTAssertLessThan(sdkPluginPathIndex!, sdkLocalPluginPathIndex!)
7329-
73307317
let origPlatformPath =
73317318
sdkRoot.parentDirectory.parentDirectory.parentDirectory.parentDirectory
73327319
.appending(component: "\(searchPlatform).platform")
@@ -7337,7 +7324,6 @@ final class SwiftDriverTests: XCTestCase {
73377324
let platformPluginPath = platformPath.appending(components: "lib", "swift", "host", "plugins")
73387325
let platformPluginPathIndex = job.commandLine.firstIndex(of: .flag("\(platformPluginPath)#\(platformServerPath)"))
73397326
XCTAssertNotNil(platformPluginPathIndex)
7340-
XCTAssertLessThan(sdkLocalPluginPathIndex!, platformPluginPathIndex!)
73417327

73427328
let platformLocalPluginPath = platformPath.appending(components: "local", "lib", "swift", "host", "plugins")
73437329
let platformLocalPluginPathIndex = job.commandLine.firstIndex(of: .flag("\(platformLocalPluginPath)#\(platformServerPath)"))

0 commit comments

Comments
 (0)