-
-
Notifications
You must be signed in to change notification settings - Fork 636
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
Protobuf sources does not work with parametrized resolves #21409
Comments
Hi, it would be really helpful if you could create a repo containing a minimal repro of this, with a README explaining how to reproduce the bug. Then all we need to do is clone your repo and run that, and we can be sure we're all looking at the same thing. Thanks! |
I recall a steady series of fixes to parametrisation in 2.22.0 and 2.23 (currently in pre-release), so potentially you could try upgrading to one of those and see if the problem is already resolved. If not, a standalone reproducer as Benjy describes would be great, thank you! |
Hi all, I've tried with 2.22.0 and still see the issue. I have made a sample repo here where the README explains the problem and steps to reproduce |
Thanks. I can reproduce the issue with 2.23.0a0 too. I don't have input on resolving it though, but maybe someone else does. (BTW, not related to that issue, just picking up from the description: Pants will manage the codegen and venvs internally, so |
Thanks for the robust repro, which reproduces the issue for me. I will take a look ASAP. |
These warnings seem pertinent:
|
The parametrization introduces two sources of each .proto to .proto dependency. And because dep inference isn't disambiguating via the specific parametrization, Pants selects neither dep, and you end up with those errors. I'll see how this is handled in other parametrized contexts, such as dep inference between .py files. |
Interestingly:
So the |
So for Python dep resolution the resolve is used in a deep way to disambiguate:
The same is not true for proto dep resolution. The problem is, I'm not sure how it could be. The resolve is a python-specific concept that is passed through the |
@omri-cavnue have you found a workaround? |
@benjyw no not yet. I've tried a few solutions, including adding the files to the dependencies list manually, as well as creating a matrix via parametrization in the dependencies field, but neither works and these are also very manual solutions |
Describe the bug
When introducing multiple resolves into the repo, all of the python sources and test targets seem to work. However, the protobuf_sources does not work against multiple resolves. On a single resolve, the target works. But when parametrizing against multiple resolves, it complains about proto files not being found when they are imported into other proto files.
Pants version
2.21.0
OS
Both mac and linux
Additional info
The repo structure is similart to:
Here, the dog.proto would import person.proto to identify an owner.
and it complains about messages/example/v1/person.proto File not found.
The BUILD file is as follows:
With one resolve, this works as expected. With multiple resolves, it complains that the person.proto file is not found when trying to create python sources for the dog proto
The text was updated successfully, but these errors were encountered: