Skip to content

Run buildifier to add missing loads #7611

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

Merged
merged 10 commits into from
Apr 22, 2025
Merged

Conversation

comius
Copy link
Contributor

@comius comius commented Apr 14, 2025

Run buildifier --lint=fix -r -v. This add loads for the rules that were removed from Bazel 8. By Bazel 9 automatic loads will be disabled and all loads will need to be explicitly present.

Some loads that cause test failures are omitted and should be done in a separate PRs.

See: bazelbuild/bazel#25755

Copy link
Collaborator

@LeFrosch LeFrosch left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Overall, I think this is a good idea. But maybe in smaller batches and I think we need to decide if we want to keep compatibility with AOSP, because this will make picks harder in future.

CC @ujohnny @sellophane

load("@protobuf//bazel:java_proto_library.bzl", "java_proto_library")
load("@protobuf//bazel:proto_library.bzl", "proto_library")
load("@rules_java//java:defs.bzl", "java_library")
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just a question, why are there two different kinds of loads:

  1. load("@rules_java//java:defs.bzl", "java_library")
  2. load("@rules_java//java:java_library.bzl", "java_library")

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

defs.bzl is older (and legacy). At the moment we're advising everybody to use <symbol>.bzl. This results in minimal loads (defs.bzl needs to load everything, and by accident there java_proto_library in rules_java, that pulls down protobuf).

If there's a preexisting use of defs.bzl, buildifier won't touch it.

Copy link
Collaborator

@LeFrosch LeFrosch left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks a lot for this. Do we want to merge this? @ujohnny

@LeFrosch
Copy link
Collaborator

Since release is done, I'd suggest we merge this now? @ujohnny

@ujohnny ujohnny merged commit caafb27 into bazelbuild:master Apr 22, 2025
5 checks passed
@github-project-automation github-project-automation bot moved this from Untriaged to Done in Bazel IntelliJ Plugin Apr 22, 2025
@github-actions github-actions bot removed the awaiting-review Awaiting review from Bazel team on PRs label Apr 22, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
product: CLion CLion plugin product: GoLand GoLand plugin product: IntelliJ IntelliJ plugin
Projects
Development

Successfully merging this pull request may close these issues.

5 participants