Closed rosun82 closed 6 months ago
Do you have legacy_create_init
on your py_binary
/py_test
rules set to False
? The default behaviour (implicitly True) is very broken when it comes to overlapping names
Thanks for the pointer!
Setting --incompatible_default_to_explicit_init_py=true fixes the issue.
I think this should be made clear somewhere in the document though.
This issue has been automatically closed because there has been no response to our request for more information from the original author. With only the information that is currently in the issue, we don't have enough information to take action. Please reach out if you have or find the answers we need so that we can investigate further.
Issue Description
Imagine the following case:
Assume a_test.py imports both a.py and c_pb2, e.g.,
Here the build will fail with the following kind of error:
What this says is essentially the proto rule sets a new import path, which shields the original one (repo root).
The temporary solution is to move protos to the repo root, or at least make sure the path of all python file do not have common prefix with all proto file. This, as one would imagine, causes difficulty in organizing projects.
p.s.: there are no such issue with blaze, so I suppose it is fixable.
Log Output
No response
rules_proto_grpc Version
4.5.0
Bazel Version
6.4.0
OS
ubuntu
Link to Demo Repo
No response
WORKSPACE Content
No response
BUILD Content
No response
Proto Content
No response
Any Other Content
No response