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
maven_install does not differentiate compile and runtime scopes, causing circular dependencies #966
Comments
In addition to runtime there is a case for provided dependencies too. E.g.
|
Is there any workaround for this? |
Sometimes you can workaround using exclusions, like in grpc/grpc-java#10576. |
To avoid having to wade through that rather long issue the relevant bit is:
|
It looks like support for deps/runtime_deps/provided_deps is non-trivial.
|
Looks like there's also a dependency on coursier's behaviour: coursier/coursier#1231 Rather, the json report from coursier is used: it does not differentiate dependencies' scopes. |
If you're using 5.3, that's because this commit is not included. I've filed a request to release a new version: #1014 |
This causes circular dependencies when processed by Bazel, but are processed without issue with Maven and Gradle. The contents here are mostly taken from grpc/grpc-java#10576 (comment) , so see it for more context. The correct thing to do is for rules_jvm_external to use runtime_deps, but jvm_import doesn't support runtime deps. (It's unclear to me why all deps in jvm_import can't be treated as runtime_deps. Maybe something involved with the hjar. In Maven Central,
compile
scope normally behaves asexports
in Bazel as hjars aren't available in Gradle/Maven (see also #147), andruntime
scope is like Bazel'sruntime_deps
.)In gRPC 1.58.0 the grpc-core artifact had part of its contents moved into a new grpc-util artifact. To preserve existing behavior, grpc-core added a runtime-only dependency on grpc-util. grpc-util has a compile-time dependency on grpc-core.
io.grpc:grpc-core:1.58.0's POM:
io.grpc:grpc-util:1.58.0's POM:
With this
WORKSPACE
, Bazel finds "cycle in dependency graph":Looking at the generated BUILD file, rules_jvm_external doesn't use runtime_deps for the runtime-scoped:
And that's because jvm_import doesn't support runtime_deps, unlike java_import.
The text was updated successfully, but these errors were encountered: