Skip to content
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

Make bazel_tools work again #24094

Closed
wants to merge 4 commits into from

Conversation

meteorcloudy
Copy link
Member

@meteorcloudy meteorcloudy commented Oct 25, 2024

This PR address two problems:

@meteorcloudy meteorcloudy requested review from comius and removed request for ted-xie and ahumesky October 25, 2024 14:36
@github-actions github-actions bot added team-Android Issues for Android team awaiting-review PR is awaiting review from an assigned reviewer labels Oct 25, 2024
@Wyverald Wyverald added awaiting-PR-merge PR has been approved by a reviewer and is ready to be merge internally and removed awaiting-review PR is awaiting review from an assigned reviewer labels Oct 25, 2024
@ahumesky
Copy link
Contributor

ahumesky commented Oct 25, 2024

We had a goal of removing all android-related code from the bazel 8 binary, and breaking changes can happen in major versions of bazel. Related to the discussions in bazel-contrib/rules_jvm_external#1270, how far back do we need to support rules_jvm_external? We're working to make rules_android 0.6.0 work with rules_jvm_external and rules_kotlin (or vice versa), blocked on a few issues including the protobuf issue here.

@Wyverald Wyverald added awaiting-review PR is awaiting review from an assigned reviewer and removed awaiting-PR-merge PR has been approved by a reviewer and is ready to be merge internally labels Oct 25, 2024
@Wyverald
Copy link
Member

that's a good point -- let's fix the protobuf thing first and let the whole android thing pan out, before deciding whether to do the partial //tools/android rollback? I acknowledge the tension between major Bazel versions making breaking changes and rulesets wanting to support older Bazel versions; we should make a conscious decision here before 8.0 release.

@meteorcloudy
Copy link
Member Author

Sounds like there is a egg-chicken problem here.
The new protobuf version depends on rules_jvm_external now, so I actually cannot bump it without fixing the rules_jvm_external issue first.

@Wyverald
Copy link
Member

ow. @ahumesky, are you okay with us getting this PR submitted as-is, and then you guys can try to resolve the situation with rules_jvm_external, and then we could maybe roll forward the //tools/android deletion?

@ted-xie
Copy link
Contributor

ted-xie commented Oct 25, 2024

An important question here is what Bazel RC's the rollbacks/rollforwards would occur in. It would be extra painful to have to wait for RCs to be cut in order for changes to be reflected.

@Wyverald
Copy link
Member

If necessary, we can push RCs out very quickly for testing, no problem. (I'm talking multiple in a day.) cc @keertk @iancha1992

@meteorcloudy
Copy link
Member Author

Can we just keep android_extensions.bzl in Bazel 8 and delete it at HEAD? It wouldn't block or slow down any rules_android starlarification work, right?

@ahumesky
Copy link
Contributor

I think it's just an accident that android_extensions.bzl is still in the bazel repo (or we just hadn't gotten to deleting it yet. we were primarily concerned with removing things from the bazel binary before the bazel 8 cut).

Also if we do have to restore android_extensions.bzl in @bazel_tools, think we also have to restore these targets:

"has_androidsdk": attr.label(default = "@bazel_tools//tools/android:always_false"),
"sdk": attr.label(default = "@bazel_tools//tools/android:poison_pill_android_sdk"),
"dx_jar_import": attr.label(default = "@bazel_tools//tools/android:no_android_sdk_repository_error"),
"android_sdk_for_testing": attr.label(default = "@bazel_tools//tools/android:empty"),
"android_ndk_for_testing": attr.label(default = "@bazel_tools//tools/android:empty"),

The new protobuf version depends on rules_jvm_external now, so I actually cannot bump it without fixing the rules_jvm_external issue first.

Do you mean update protobuf to work with bazel 8?

rules_jvm_external has a goal of being compatible with N-2 versions of bazel (e.g. bazel-contrib/rules_jvm_external#1268 (comment)), but it's not clear that we need to ensure old versions of rules_jvm_external work with new versions of bazel (the compatibility matrix is already very difficult).

Would it work to first land adding the protobuf dep (#23908) which is required for rules_android 0.6.0, then we can update rules_jvm_external for rules_android 0.6.0 (revert bazel-contrib/rules_jvm_external#1215 / restore bazel-contrib/rules_jvm_external@ba7310c, and also this I think bazel-contrib/rules_jvm_external#1268), then we can update rules_kotlin (bazelbuild/rules_kotlin#1205, probably others). Or are there more circular dependencies that prevent all this from working?

@ahumesky
Copy link
Contributor

After discussing this, because of the various circular dependencies we'll need to restore android_extensions.bzl to update all the rulesets for bazel 8

meteorcloudy added a commit to meteorcloudy/bazel that referenced this pull request Oct 28, 2024
This PR address two problems:
- Partially rolledback bazelbuild@ef1a21f to restore android tools extension to avoid breaking older rules_jvm_external and rules_kotlin versions: bazel-contrib/rules_jvm_external#1270
- Add protobuf in MODULE.tools to ensure a Bazel 8 compatible version gets selected. (related bazelbuild#23908)

Closes bazelbuild#24094.

PiperOrigin-RevId: 690625240
Change-Id: I47e9ab7cab9bbfd09e455fb72d3d99d3e73f1f90
@github-actions github-actions bot removed the awaiting-review PR is awaiting review from an assigned reviewer label Oct 28, 2024
@Wyverald
Copy link
Member

@bazel-io fork 8.0.0

github-merge-queue bot pushed a commit that referenced this pull request Oct 28, 2024
- Update rules_java to 8.2.0:
93daa7b
-
78abca3
- #24094

---------

Co-authored-by: Googler <[email protected]>
@iancha1992
Copy link
Member

The changes in this PR have been included in Bazel 8.0.0 RC2. Please test out the release candidate and report any issues as soon as possible.
If you're using Bazelisk, you can point to the latest RC by setting USE_BAZEL_VERSION=8.0.0rc2. Thanks!

ramil-bitrise pushed a commit to bitrise-io/bazel that referenced this pull request Dec 18, 2024
This PR address two problems:
- Partially rolledback bazelbuild@ef1a21f to restore android tools extension to avoid breaking older rules_jvm_external and rules_kotlin versions: bazel-contrib/rules_jvm_external#1270
- Add protobuf in MODULE.tools to ensure a Bazel 8 compatible version gets selected. (related bazelbuild#23908)

Closes bazelbuild#24094.

PiperOrigin-RevId: 690651136
Change-Id: I47e9ab7cab9bbfd09e455fb72d3d99d3e73f1f90
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
team-Android Issues for Android team
Projects
None yet
Development

Successfully merging this pull request may close these issues.

7 participants