Skip to content

Conversation

@luispadron
Copy link
Contributor

@luispadron luispadron commented Jul 9, 2025

Similar to #1533 but when using --strategy=worker

In 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 --expunge
  • git checkout 2.8.2
  • bazel build @com_github_apple_swift_argument_parser//... --strategy=worker,local --worker_sandboxing=false (pass)
  • git checkout master
  • bazel 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)

@luispadron luispadron marked this pull request as ready for review July 9, 2025 15:41
@luispadron luispadron force-pushed the luis/fix-rules_swift-3.x-readonly-bugs branch 3 times, most recently from 20b40c1 to 866ab66 Compare July 9, 2025 15:44
@luispadron luispadron force-pushed the luis/fix-rules_swift-3.x-readonly-bugs branch from 866ab66 to b2bc4e6 Compare July 9, 2025 15:45
@luispadron luispadron merged commit 6d28b81 into master Jul 9, 2025
13 checks passed
@luispadron luispadron deleted the luis/fix-rules_swift-3.x-readonly-bugs branch July 9, 2025 18:49
@jpsim
Copy link
Contributor

jpsim commented Jul 11, 2025

This appears to have broken relative path formatting in Periphery: https://github.com/peripheryapp/periphery/blob/master/Sources/PeripheryKit/Results/OutputFormatter.swift#L79-L81

Not sure what project needs to be adjusted. cc @ileitch

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.

5 participants