-
Notifications
You must be signed in to change notification settings - Fork 4.3k
Open
Labels
P3We're not considering working on this, but happy to review a PR. (No assignee)We're not considering working on this, but happy to review a PR. (No assignee)team-Rules-JavaIssues for Java rulesIssues for Java rulestype: bug
Description
Description
The suggested fix for Strict Java Deps errors adds the wrong target for dependencies on java_proto_library
s. It suggests adding a dep on the underlying proto_library
target, instead of on the java_proto_library
target.
Repro
First, download: https://gist.github.com/cushon/0241dafdb608b7e2f37c475d3304aa18
Building fails with a strict deps error:
$ bazel build :b
...
B.java:2: error: [strict] Using type com.test.proto.P from an indirect dependency (TOOL_INFO: "//:p_proto wrapped in java_proto_library"). See command below **
com.test.proto.P.Message m;
^
** Please add the following dependencies:
//:p_proto to //:b
** You can use the following buildozer command:
buildozer 'add deps //:p_proto ' //:b
The suggested fix is to add //p:proto
, which does not fix the problem:
$ buildozer 'add deps //:p_proto ' //:b
fixed ./sjdproto/BUILD
$ bazel build :b
B.java:2: error: [strict] Using type com.test.proto.P from an indirect dependency (TOOL_INFO: "//:p_proto wrapped in java_proto_library"). See command below **
com.test.proto.P.Message m;
The correct dep to add is //:p_java_proto
:
$ buildozer 'add deps //:p_java_proto ' //:b
$ bazel build :b
...
INFO: Build completed successfully
What's the output of bazel info release
?
$ bazel info release
release 0.11.1
gibfahn and evis
Metadata
Metadata
Assignees
Labels
P3We're not considering working on this, but happy to review a PR. (No assignee)We're not considering working on this, but happy to review a PR. (No assignee)team-Rules-JavaIssues for Java rulesIssues for Java rulestype: bug