Skip to content

Conversation

artemcm
Copy link
Contributor

@artemcm artemcm commented Sep 15, 2025

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.

We've been having issues with content hash causing collisions as well as issues with underlying Foundation atomic APIs. For now, attempt to simply make the files unique with a uuid.
@artemcm artemcm requested a review from owenv September 15, 2025 17:36
@artemcm
Copy link
Contributor Author

artemcm commented Sep 15, 2025

@swift-ci test

@artemcm artemcm force-pushed the NonAtomicUniqueResponseFiles branch from ff7daf2 to e01d706 Compare September 15, 2025 17:53
@artemcm
Copy link
Contributor Author

artemcm commented Sep 15, 2025

@swift-ci test

@artemcm
Copy link
Contributor Author

artemcm commented Sep 15, 2025

@swift-ci test Windows platform

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants