[6.2 🍒] Use UUID for response file names and add 'resolveArgumentList' API which contains original command-line if a response file is used #1996
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Cherry-pick of #1989
Explanation: Using the content hash in the response file name caused us to require using the atomic FS write API, due to a possibility that concurrently-running driver processes may encounter a need to build a common, shared module dependency with an identical command-line recipe. In such a scenario there was a possibility of a race in writing out the response file for this command.
We have since seen challenges with the current atomic FS write APIs and this PR is an alternative approach to tackling this problem. Instead of using the content hash, we will use UUID to ensure that we do not have races when multiple drivers are creating a response file for an identical command. In addition, we add an API for build system clients so that they can directly examine the pre-response-file-creation command line arguments directly from the ArgsResolver, without needing to read the response file from the filesystem.
Scope: Affects builds which contain compilation tasks with command lines which do not fit the system default command line size, triggering response file use.
Risk: Low. The risk is low to build functionality since we expect this to largely not matter to being able to successfully build a given project. There is some risk to build performance if we do not correctly take this change into account in the build system, but we have an accompanying change in SwiftBuild to ensure that does not happen.
Reviewed By: @owenv
Problem: rdar://159417339
Original PR: Use UUID for response file names and add 'resolveArgumentList' API which contains original command-line if a response file is used #1989