Skip to content

Commit 90b1568

Browse files
committed
Response files should be named using the hash of the command line arguments only
1 parent 5e9abc0 commit 90b1568

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

Sources/SwiftDriver/Execution/ArgsResolver.swift

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@ import class Foundation.NSLock
1515
import func TSCBasic.withTemporaryDirectory
1616
import protocol TSCBasic.FileSystem
1717
import struct TSCBasic.AbsolutePath
18+
import struct TSCBasic.SHA256
1819

1920
@_implementationOnly import Yams
2021

@@ -208,7 +209,8 @@ public final class ArgsResolver {
208209
assert(!forceResponseFiles || job.supportsResponseFiles,
209210
"Platform does not support response files for job: \(job)")
210211
// Match the integrated driver's behavior, which uses response file names of the form "arguments-[0-9a-zA-Z].resp".
211-
let responseFilePath = temporaryDirectory.appending(component: "arguments-\(abs(job.hashValue)).resp")
212+
let hash = SHA256().hash(resolvedArguments.joined(separator: " ")).hexadecimalRepresentation
213+
let responseFilePath = temporaryDirectory.appending(component: "arguments-\(hash).resp")
212214

213215
// FIXME: Need a way to support this for distributed build systems...
214216
if let absPath = responseFilePath.absolutePath {

0 commit comments

Comments
 (0)