-
Notifications
You must be signed in to change notification settings - Fork 87
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add support for bzlmod #1502
Add support for bzlmod #1502
Conversation
FYI: #1503 |
FYI, the repo now uses Bazel 6.0. |
dd7b1b0
to
8f9ccb4
Compare
As part of this do we want to enable bzlmod in |
Yeah, I think that's a good idea. We might also need to create a |
If we can do that instead of disabling bzlmod, I would prefer that. |
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
a75dfff
to
718391c
Compare
718391c
to
bba2617
Compare
45b667b
to
d5acf95
Compare
0dc414e
to
1ee9b45
Compare
1ee9b45
to
7904eff
Compare
Split up the `rules_swift` bump from #1502.
7904eff
to
30eea2f
Compare
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
This PR adds initial support for bzlmod. I still have to test it with an example project, but the basic infrastructure should be ready.
bzlmod is only really ready to be used starting in Bazel 6.0. For this reason, the
MODULE.bazel
depends on rules_apple 2.0.0, which is also the release that requires Bazel 6. I will need to first check the newest version of rules_apple and rules_swift into the Bazel Central Registry, and then we can proceed testing the rules_xcodeproj integration.