Skip to content

Commit 66f63c1

Browse files
committed
Disfavor current working directory when looking up executables.
1 parent c62800f commit 66f63c1

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

Sources/SwiftDriver/Toolchains/Toolchain.swift

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -209,10 +209,10 @@ extension Toolchain {
209209
if let overrideString = envVar(forExecutable: executableName(executable)) {
210210
return try AbsolutePath(validating: overrideString)
211211
} else if let toolDir = toolDirectory,
212-
let path = lookupExecutablePath(filename: executableName(executable), searchPaths: [toolDir]) {
212+
let path = lookupExecutablePath(filename: executableName(executable), currentWorkingDirectory: nil, searchPaths: [toolDir]) {
213213
// Looking for tools from the tools directory.
214214
return path
215-
} else if let path = lookupExecutablePath(filename: executableName(executable), searchPaths: [executableDir]) {
215+
} else if let path = lookupExecutablePath(filename: executableName(executable), currentWorkingDirectory: nil, searchPaths: [executableDir]) {
216216
return path
217217
} else if let path = try? xcrunFind(executable: executableName(executable)) {
218218
return path

0 commit comments

Comments
 (0)