Skip to content

Commit edb9439

Browse files
committed
Use fully qualified command paths to give drivers the information that they need from argv[0]
1 parent 6c5164c commit edb9439

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

Sources/SwiftlyCore/Platform.swift

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -165,11 +165,13 @@ extension Platform {
165165
/// the exit code and program information.
166166
///
167167
public func proxy(_ ctx: SwiftlyCoreContext, _ toolchain: ToolchainVersion, _ command: String, _ arguments: [String], _ env: [String: String] = [:]) async throws {
168+
let tcPath = self.findToolchainLocation(ctx, toolchain).appendingPathComponent("usr/bin")
169+
168170
var newEnv = try self.proxyEnv(ctx, env: ProcessInfo.processInfo.environment, toolchain: toolchain)
169171
for (key, value) in env {
170172
newEnv[key] = value
171173
}
172-
try self.runProgram([command] + arguments, env: newEnv)
174+
try self.runProgram([tcPath.appendingPathComponent(command).path] + arguments, env: newEnv)
173175
}
174176

175177
/// Proxy the invocation of the provided command to the chosen toolchain and capture the output.
@@ -178,7 +180,8 @@ extension Platform {
178180
/// the exit code and program information.
179181
///
180182
public func proxyOutput(_ ctx: SwiftlyCoreContext, _ toolchain: ToolchainVersion, _ command: String, _ arguments: [String]) async throws -> String? {
181-
try await self.runProgramOutput(command, arguments, env: self.proxyEnv(ctx, env: ProcessInfo.processInfo.environment, toolchain: toolchain))
183+
let tcPath = self.findToolchainLocation(ctx, toolchain).appendingPathComponent("usr/bin")
184+
return try await self.runProgramOutput(tcPath.appendingPathComponent(command).path, arguments, env: self.proxyEnv(ctx, env: ProcessInfo.processInfo.environment, toolchain: toolchain))
182185
}
183186

184187
/// Run a program.

0 commit comments

Comments
 (0)