bazel-deps
bazel-deps copied to clipboard
Artifacts in replacements shouldn't need versions
Say that GRPC is loaded as a replacement, with something like:
replacements:
io.grpc:
grpc-core:
lang: java
target: "@io_grpc_grpc_java//core"
grpc-netty:
lang: java
target: "@io_grpc_grpc_java//netty"
grpc-stub:
lang: java
target: "@io_grpc_grpc_java//stub"
If we want to depend on that outside of third party, we need to change the visibility rule. This can be done by listing these artifacts in the main dependencies
section as well. However, doing so requires a version
to be set, which seems to be irrelevant since the version is already configured.
Seems like the two options for fixing this are to either (1) allow the entry in dependencies to be omit the version or (2) allow the entry in replacements to declare the library as visible.
Dependencies already can omit versions. Have you had a problem with that?
Hmm... I may have read it wrong. The documentation suggested that the version was necessary unless you wanted to use the version that was selected based on transitive dependencies of other explicitly versioned dependencies.
I can confirm that it does work, so option (1) seems to be good. Maybe an update to documentation indicating this use case?