Fix .swiftsourceinfo readonly bugs in version 3+ #1550
Merged
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.
Similar to #1533 but when using
--strategy=workerIn rules_swift < 3.x the .swiftsourceinfo files are unconditionally written to the module path. In rules_swift >= 3.x these same files are no longer tracked by Bazel unless explicitly requested. When using non-sandboxed mode, previous builds will contain these files and cause build failures when Swift tries to use them, in order to work around this compatibility issue, we check the module path for the presence of .swiftsourceinfo files and if they are present but not requested, we remove them.
Testing:
bazel clean --expungegit checkout 2.8.2bazel build @com_github_apple_swift_argument_parser//... --strategy=worker,local --worker_sandboxing=false(pass)git checkout masterbazel build @com_github_apple_swift_argument_parser//... --strategy=worker,local --worker_sandboxing=false(failure)git checkout <this-branch>bazel build @com_github_apple_swift_argument_parser//... --strategy=worker,local --worker_sandboxing=false(pass)