bazel: strict deps labels are incorrect when using non java_* rules
Description of the problem / feature request:
Strict deps labels are incorrect when using scala_import I suspect the problem is in the java rules and not scala_import since java_rules seems to perform their own heuristics which breaks if a different “actor” is in play and scala_import here is accidental. I might be incorrect in my analysis but a few months ago when I debugged it this is what I saw (don’t have links to bazel code now, sorry 😦 )
Feature requests: what underlying problem are you trying to solve with this feature?
Trying to use java_library or java_common.compile with strict deps warnings
Bugs: what’s the simplest, easiest way to reproduce this bug? Please provide a minimal example if possible.
clone https://github.com/ittaiz/bazel-strict-deps-labels-issue
run bazel build --strict_java_deps=error //...
see:
TransitiveUser.java:1: error: [strict] Using type com.google.common.cache.Cache from an indirect dependency (TOOL_INFO: "@com_google_guava_guava//jar:guava-19.0.jar"). See command below **
import com.google.common.cache.Cache;
^
** Please add the following dependencies:
@com_google_guava_guava//jar:guava-19.0.jar to //:transitive_user
** You can use the following buildozer command:
buildozer 'add deps @com_google_guava_guava//jar:guava-19.0.jar ' //:transitive_user
INFO: Elapsed time: 0.279s, Critical Path: 0.14s
FAILED: Build did NOT complete successfully
expected at the very least @com_google_guava_guava//jar
and actually I’d like it to be //:import
since the rule effectively exports that file
What operating system are you running Bazel on?
os x
What’s the output of bazel info release
?
release 0.8.1-homebrew
About this issue
- Original URL
- State: closed
- Created 6 years ago
- Comments: 43 (34 by maintainers)
ok continuing the design discussion that started in #4846 about an “API” for strict-deps labels passing between JVM rules. There are currently 3 options as far as I can tell:
I think I’m missing some context on the con of providers and I also think we need to hash out the
exports
use-case since that feels to be the bone of contention here