-
Notifications
You must be signed in to change notification settings - Fork 17
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 loads for certain py/java rules #121
Conversation
Bazel 8 removes native shell, python, and java rules. This PR makes rules_robolectric compatible with Bazel 8.
Provided this PR gets merged, we (the Bazel team) would also need a release cut relatively quickly in order to unblock the next rules_android release, which will unblock the upcoming Bazel 8 release. |
@Bencodes @Wyverald There ended up being some kind of java toolchain issue when I tried upgrading rules_java to 8.5.1 for the example app:
Note that this only occured with WORKSPACE mode. I tried debugging this for a while but wasn't able to come up with anything concrete. I suspect it's something to do with the native Android rules in rules_android v0.1.1 interacting badly with the latest rules_java, but upgrading the Android rule dep in WORKSPACE was unsavory to say the least. The only reason I wanted to upgrade rules_java in the first place was to get the rules_java version of http_jar(), but that involved pulling in a lot of complicated WORKSPACE setup and the aforementioned toolchain issue. The next best solution I could think of was to copy over the (fairly standalone) http_jar() rule into robolectric itself, which is also gross, but much less complicated than making WORKSPACE builds work. |
@ted-xie Just require extra modifications for Buildfier. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM.
@Bencodes @ted-xie New bazel patch release here: https://github.com/robolectric/robolectric-bazel/releases/tag/4.11.1.1 and bazelbuild/bazel-central-registry#3309. |
@@ -0,0 +1,200 @@ | |||
"""The http_jar repo rule, for downloading jars over HTTP. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@ted-xie and I chatted about this one further and think that this is probably the least-hacky solution for the underlying issue.
We talked about some alternatives here like letting the workspace and module file diverge, and even patching rules_android. But both of these kind of have downsides that might cause more issues for our end users than just copying http_jar over in the short term.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Bazel 8 removes native shell, python, and java rules. This PR makes rules_robolectric compatible with Bazel 8.