Skip to content

Commit 2d0b063

Browse files
owenvxymus
authored andcommitted
Look for tools relative to the frontend if it's in a different directory than the driver
1 parent 6d99493 commit 2d0b063

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

Sources/SwiftDriver/Toolchains/Toolchain.swift

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -134,6 +134,13 @@ extension Toolchain {
134134
return path
135135
} else if let path = try? xcrunFind(executable: executable) {
136136
return path
137+
} else if !["swift-frontend", "swift"].contains(executable),
138+
let parentDirectory = try? getToolPath(.swiftCompiler).parentDirectory,
139+
parentDirectory != executableDir,
140+
let path = lookupExecutablePath(filename: executable, searchPaths: [parentDirectory]) {
141+
// If the driver library's client and the frontend are in different directories,
142+
// try looking for tools next to the frontend.
143+
return path
137144
} else if let path = lookupExecutablePath(filename: executable, searchPaths: searchPaths) {
138145
return path
139146
} else if executable == "swift-frontend" {

0 commit comments

Comments
 (0)