You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
error: Target '@@com_google_protobuf//java/core:lite_runtime_only' is used but isn't explicitly declared, please add it to the deps.
You can use the following buildozer command:
buildozer 'add deps @@com_google_protobuf//java/core:lite_runtime_only' //deps-mode:scala_class
error: Target '@@com_google_protobuf//java/core:core' is used but isn't explicitly declared, please add it to the deps.
You can use the following buildozer command:
buildozer 'add deps @@com_google_protobuf//java/core:core' //deps-mode:scala_class
2 errors
Build failed
java.lang.RuntimeException: Build failed
at io.bazel.rulesscala.scalac.ScalacInvoker.invokeCompiler(ScalacInvoker.java:55)
at io.bazel.rulesscala.scalac.ScalacWorker.compileScalaSources(ScalacWorker.java:253)
at io.bazel.rulesscala.scalac.ScalacWorker.work(ScalacWorker.java:69)
at io.bazel.rulesscala.worker.Worker.persistentWorkerMain(Worker.java:86)
at io.bazel.rulesscala.worker.Worker.workerMain(Worker.java:39)
at io.bazel.rulesscala.scalac.ScalacWorker.main(ScalacWorker.java:33)
It's kind of surprising, since protobuf//java isn't used explicitly in my Scala code, it's used transitively via ProtoEnum.
Moreover, if I run all of given buildozer commands, then build fails again:
in scala_library rule //deps-mode:scala_class: target '@@com_google_protobuf//java/core:lite_runtime_only' is not visible from target '//deps-mode:scala_class'. Check the visibility declaration of the former target if you think the dependency is legitimate
Although, if I just do buildozer 'add deps @@com_google_protobuf//java/core:core' //deps-mode:scala_class, then build succeeds. But I'd like to avoid adding this dependency everywhere.
The text was updated successfully, but these errors were encountered:
Hi, @evis! Thanks for reporting. Could you create a small repo to reproduce your problem?
Regarding java_proto_library deps being incorrectly reported - it's a known issue. It happens because the archive is stamped with incorrect target label from the aspect. The similar issue for scala_proto_library is here for more info: #1234 (comment)
I tried to turn on
strict_deps_mode = "error"
in myscala_toolchain()
, but it complains about dependencies that aren't used directly in my Scala code.BUILD
:model.proto
:ScalaClass.scala
:Expected bazel build result: success (it builds with
strict_deps_mode = "off"
).Actual bazel build result: fails with
It's kind of surprising, since protobuf//java isn't used explicitly in my Scala code, it's used transitively via ProtoEnum.
Moreover, if I run all of given buildozer commands, then build fails again:
Although, if I just do
buildozer 'add deps @@com_google_protobuf//java/core:core' //deps-mode:scala_class
, then build succeeds. But I'd like to avoid adding this dependency everywhere.The text was updated successfully, but these errors were encountered: