-
Notifications
You must be signed in to change notification settings - Fork 281
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
Dependencies for host are used for target when set in grpc_deps #797
Comments
grpc_deps
@ianoc-stripe, @ianoc could you provide some insights? |
Hi @ignasl it would be great if you could add a test in a PR for this? it should be possible to write one that fails i believe? it would make it much easier to debug/fix. |
@ignasl merged a changed yesterday i think should act as a workaround for you, unfortunately the api's changed slightly due to limitations in bazel in making this nicer at the moment. But it should stop the host deps coming for target |
Thanks a lot for solving this one. API change is not a problem at all we are still in POC mode. I have already started experimenting. |
I have defined and registered my own
scala_proto_toolchain
:Naturally, I am declaring the rule for proto and another scala library that depends on it:
So dependencies are eventually set-up like this:
my_proto
->//important/dependency
my_library
->//important/dependency
my_library
->my_proto
Now, the problem arises that when
"my_library"
gets built, the classpath contains two copies of the//important/dependency
jars:/bazel-out/host/bin/important/dependency/dependency.jar
/bazel-out/darwin-fastbuild/bin/important/dependency/dependency.jar
This is a problem, because
jar
s meant for the host find their way into dependency list meant for the target. I cannot remove the//important/dependency' from the
grpc_deps` list, because generated code requires it and this causes compile failures.I believe (correct me if I am wrong) that bazel or rules_scala incorrectly resolves libraries' paths to
host
. With JVM languages compilers can happily accept them because they are essentially different. However, if this was, for example, C++ cross-platform build (host is x86 and target ARM) compiler would not allow it. Since bazel supports cross-compiling, the issue must be with scala_rules. Otherwise, please, let me know what am doing wrong.The text was updated successfully, but these errors were encountered: