Skip to content

Commit 994f6b9

Browse files
committed
Look for tools relative to the frontend if it's in a different directory than the driver
1 parent 8179c27 commit 994f6b9

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
@@ -128,6 +128,13 @@ extension Toolchain {
128128
return path
129129
} else if let path = try? xcrunFind(executable: executable) {
130130
return path
131+
} else if !["swift-frontend", "swift"].contains(executable),
132+
let parentDirectory = try? getToolPath(.swiftCompiler).parentDirectory,
133+
parentDirectory != executableDir,
134+
let path = lookupExecutablePath(filename: executable, searchPaths: [parentDirectory]) {
135+
// If the driver library's client and the frontend are in different directories,
136+
// try looking for tools next to the frontend.
137+
return path
131138
} else if let path = lookupExecutablePath(filename: executable, searchPaths: searchPaths) {
132139
return path
133140
} else if executable == "swift-frontend" {

0 commit comments

Comments
 (0)