Skip to content

Stop adding '-external-plugin-path' to SDK directories #1573

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Mar 29, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 0 additions & 9 deletions Sources/SwiftDriver/Toolchains/DarwinToolchain.swift
Original file line number Diff line number Diff line change
Expand Up @@ -434,15 +434,6 @@ public final class DarwinToolchain: Toolchain {
}

if driver.isFrontendArgSupported(.externalPluginPath) {
// Default paths for compiler plugins found within an SDK (accessed via
// that SDK's plugin server).
let sdkPathRoot = VirtualPath.lookup(sdkPath).appending(components: "usr")
commandLine.appendFlag(.externalPluginPath)
commandLine.appendFlag("\(sdkPathRoot.pluginPath.name)#\(sdkPathRoot.pluginServerPath.name)")

commandLine.appendFlag(.externalPluginPath)
commandLine.appendFlag("\(sdkPathRoot.localPluginPath.name)#\(sdkPathRoot.pluginServerPath.name)")

// Determine the platform path. For simulator platforms, look into the
// corresponding device platform instance.
let origPlatformPath = VirtualPath.lookup(sdkPath)
Expand Down
14 changes: 0 additions & 14 deletions Tests/SwiftDriverTests/SwiftDriverTests.swift
Original file line number Diff line number Diff line change
Expand Up @@ -7314,19 +7314,6 @@ final class SwiftDriverTests: XCTestCase {
XCTAssertLessThan(pluginB2Index!, pluginCIndex!)

#if os(macOS)
XCTAssertTrue(job.commandLine.contains(.flag("-external-plugin-path")))
let sdkServerPath = sdkRoot.appending(components: "usr", "bin", "swift-plugin-server").pathString
let sdkPluginPath = sdkRoot.appending(components: "usr", "lib", "swift", "host", "plugins").pathString

let sdkPluginPathIndex = job.commandLine.firstIndex(of: .flag("\(sdkPluginPath)#\(sdkServerPath)"))
XCTAssertNotNil(sdkPluginPathIndex)
XCTAssertLessThan(pluginCIndex!, sdkPluginPathIndex!)

let sdkLocalPluginPath = sdkRoot.appending(components: "usr", "local", "lib", "swift", "host", "plugins").pathString
let sdkLocalPluginPathIndex = job.commandLine.firstIndex(of: .flag("\(sdkLocalPluginPath)#\(sdkServerPath)"))
XCTAssertNotNil(sdkLocalPluginPathIndex)
XCTAssertLessThan(sdkPluginPathIndex!, sdkLocalPluginPathIndex!)

let origPlatformPath =
sdkRoot.parentDirectory.parentDirectory.parentDirectory.parentDirectory
.appending(component: "\(searchPlatform).platform")
Expand All @@ -7337,7 +7324,6 @@ final class SwiftDriverTests: XCTestCase {
let platformPluginPath = platformPath.appending(components: "lib", "swift", "host", "plugins")
let platformPluginPathIndex = job.commandLine.firstIndex(of: .flag("\(platformPluginPath)#\(platformServerPath)"))
XCTAssertNotNil(platformPluginPathIndex)
XCTAssertLessThan(sdkLocalPluginPathIndex!, platformPluginPathIndex!)

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