Skip to content

Commit 679b324

Browse files
authored
Merge pull request #1304 from DougGregor/add-local-plugin-path
Add default plugin path `local/lib/swift/host/plugins`
2 parents 65b2f03 + 67d6f22 commit 679b324

File tree

2 files changed

+6
-0
lines changed

2 files changed

+6
-0
lines changed

Sources/SwiftDriver/Jobs/FrontendJobHelpers.swift

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -253,6 +253,11 @@ extension Driver {
253253
.appending(components: "lib", "swift", "host", "plugins")
254254
commandLine.appendFlag(.pluginPath)
255255
commandLine.appendPath(defaultPluginPath)
256+
257+
let localPluginPath = try toolchain.executableDir.parentDirectory
258+
.appending(components: "local", "lib", "swift", "host", "plugins")
259+
commandLine.appendFlag(.pluginPath)
260+
commandLine.appendPath(localPluginPath)
256261
}
257262

258263
// Pass down -user-module-version if we are working with a compiler that

Tests/SwiftDriverTests/SwiftDriverTests.swift

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6661,6 +6661,7 @@ final class SwiftDriverTests: XCTestCase {
66616661
let job = jobs.first!
66626662
XCTAssertTrue(job.commandLine.contains(.flag("-plugin-path")))
66636663
XCTAssertTrue(job.commandLine.contains(.path(.absolute(try driver.toolchain.executableDir.parentDirectory.appending(components: "lib", "swift", "host", "plugins")))))
6664+
XCTAssertTrue(job.commandLine.contains(.path(.absolute(try driver.toolchain.executableDir.parentDirectory.appending(components: "local", "lib", "swift", "host", "plugins")))))
66646665
}
66656666

66666667
func testClangModuleValidateOnce() throws {

0 commit comments

Comments
 (0)