Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix runfiles lookup under bzlmod in Bazel 6 (bazelbuild#963)
When building Swift code with `--enable_bzlmod`, it currently fails due to the worker failing to find the `index-import` executable in the runfiles. This is because the naming is different under bzlmod and the C++ runfiles library was updated to support this new mapping as described in this [talk](https://www.youtube.com/watch?v=5NbgUMH1OGo). Since rules_swift supports both Bazel 5 and 6, we need to check `BAZEL_CURRENT_REPOSITORY` is defined to simply make use of the new constructor which will make it so the runfiles lookup will happen relative to the `rules_swift` repo under Bazel 6. I tested this locally with a `local_path_override` while iterating on getting the `rules_xcodeproj` to work under bzlmod (and also continues to work with bzlmod disabled in Bazel 6): MobileNativeFoundation/rules_xcodeproj#1502
- Loading branch information