Skip to content

Bazel: java_grpc_library rules can not be used from another repository (contains fix) #3650

@ah-quant

Description

@ah-quant

Please answer these questions before submitting your issue.

What version of gRPC are you using?

1.7.0

What JVM are you using (java -version)?

openjdk version "9-internal"
OpenJDK Runtime Environment (build 9-internal+0-2016-04-14-195246.buildd.src)
OpenJDK 64-Bit Server VM (build 9-internal+0-2016-04-14-195246.buildd.src, mixed mode)

What did you do?

If possible, provide a recipe for reproducing the error.

Import Bazel rules in a proto repository from another proto repository

What did you expect to see?

The other repository should be useable with Bazel

What did you see instead?

Build errors

I traced this here:

+ [src.short_path for src in srcs])

The error disappeared after changing it from
+ [src.short_path for src in srcs])
to
+ [_path_ignoring_repository(src) for src in srcs])

The -I imports already define aliases, but whatever src.short_path produces is prefixed with ../ and the proto-repo workspace name. That directory is not available in the build directory of the importing repo.

After this change, it worked in both the proto repo and the repo importing it.

If required, I can work on a reproducer or provide additional details - @-mention me in that case.
I still hope the description is sufficient... 😉

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions