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

java_proto_library: difference between bazel7 and bazel8 #24543

Open
tpasternak opened this issue Dec 3, 2024 · 1 comment
Open

java_proto_library: difference between bazel7 and bazel8 #24543

tpasternak opened this issue Dec 3, 2024 · 1 comment
Assignees
Labels
P1 I'll work on this now. (Assignee required) team-Rules-Java Issues for Java rules type: bug

Comments

@tpasternak
Copy link
Contributor

Description of the bug:

for java_proto_library, JavaInfo providers contents are slightly different. In bazel 7 it didn't contain any java outputs.

USE_BAZEL_VERSION=7.4.1 bazelisk cquery --output=starlark "--starlark:expr=providers(target)['@@_builtins//:common/java/java_info.bzl%JavaInfo'].java_outputs" //:lib

[]
USE_BAZEL_VERSION=8.0.0rc6 bazelisk cquery --output=starlark "--starlark:expr=providers(target)['@@rules_java+//java/private:java_info.bzl%JavaInfo'].java_outputs" //:lib

[<unknown object com.google.devtools.build.lib.rules.java.JavaRuleOutputJarsProvider$JavaOutput>]

Which category does this issue belong to?

No response

What's the simplest, easiest way to reproduce this bug? Please provide a minimal example if possible.

File: BUILD.bazel

   1 load("@protobuf//bazel:java_proto_library.bzl", "java_proto_library")
   2 
   3 java_proto_library(
   4     name = "lib",
   5     deps = [":proto_lib"],
   6 )
   7 
   8 proto_library(
   9     name = "proto_lib",
  10     srcs = ["lib.proto"],
  11 )

File: MODULE.bazel

   1 bazel_dep(
   2     name = "protobuf",
   3     version = "29.0",
   4 )
   5 

File: lib.proto

   1 message Lib {
   2
   3 }   

Which operating system are you running Bazel on?

Linux

What is the output of bazel info release?

8.0.0rc6

If bazel info release returns development version or (@non-git), tell us how you built Bazel.

No response

What's the output of git remote get-url origin; git rev-parse HEAD ?

No response

If this is a regression, please try to identify the Bazel commit where the bug was introduced with bazelisk --bisect.

No response

Have you found anything relevant by searching the web?

No response

Any other information, logs, or outputs that you want to share?

No response

@satyanandak satyanandak added the team-Rules-Java Issues for Java rules label Dec 3, 2024
@hvadehra hvadehra self-assigned this Dec 3, 2024
@hvadehra hvadehra added P1 I'll work on this now. (Assignee required) and removed untriaged labels Dec 3, 2024
@hvadehra
Copy link
Member

hvadehra commented Dec 3, 2024

This regression was introduced with the proto rules moving out independently of the java rules. I'll fix in @rules_java

copybara-service bot pushed a commit to bazelbuild/rules_java that referenced this issue Dec 4, 2024
Work towards bazelbuild/bazel#24543

PiperOrigin-RevId: 702587292
Change-Id: I5feb477d86c059008ed78b58588a7a6fe7976e20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
P1 I'll work on this now. (Assignee required) team-Rules-Java Issues for Java rules type: bug
Projects
None yet
Development

No branches or pull requests

5 participants