late-advantage-75311
10/10/2023, 1:31 PMgorgeous-winter-99296
10/10/2023, 1:33 PMgorgeous-winter-99296
10/10/2023, 1:35 PMlate-advantage-75311
10/10/2023, 1:36 PMlate-advantage-75311
10/10/2023, 1:37 PMgorgeous-winter-99296
10/10/2023, 1:45 PMparametrize on sources one ends up having to do @resolve=... on run and test. Then suddenly all your targets exist in triplicate across the whole codebase, at a minimum. We have four resolves at this point (three just to fix Torch's broken wheels), and by extension every python_source in shared library has @resolve={cpu,gpu,base,...}. I'm not sure if this is really a configuration issue on our end, but I think to resolve the ambiguity of which torch we want we end up with this.
I think that is the same issue that also existed in the issue you linked, etc.late-advantage-75311
10/10/2023, 1:59 PMcurved-television-6568
10/10/2023, 2:18 PMTarget class for how plugin fields are registered: https://github.com/pantsbuild/pants/blob/78111bbc105418dc2f419181e67c8ec2f80f439a/[…]thon/pants/backend/codegen/protobuf/python/additional_fields.py
More core vs moved fields on the TargetGenerator class: https://github.com/pantsbuild/pants/blob/78111bbc105418dc2f419181e67c8ec2f80f439a/src/python/pants/engine/target.py#L1009-L1038late-advantage-75311
10/10/2023, 2:32 PMcurved-television-6568
10/10/2023, 2:36 PMlate-advantage-75311
10/18/2023, 6:30 PMlate-advantage-75311
10/19/2023, 2:42 PMProtobufSourcesGeneratorTarget.moved_fields = (*ProtobufSourcesGeneratorTarget.moved_fields, ProtobufPythonResolveField)
is enough to get it to work in my test situation. I'll make a (probably gruesome) PR with a small surface area that fixes it for this one case, and as a place to have the more general conversation about how to deal with parametrizable plugin fields in target generators.late-advantage-75311
10/19/2023, 7:21 PMlate-advantage-75311
10/21/2023, 2:02 AMlate-advantage-75311
10/21/2023, 2:02 AMlate-advantage-75311
10/22/2023, 10:59 AMcurved-television-6568
10/22/2023, 5:36 PMlate-advantage-75311
10/22/2023, 11:48 PMcurved-television-6568
10/23/2023, 12:21 AMcurved-television-6568
10/23/2023, 12:22 AMlate-advantage-75311
10/23/2023, 12:22 AMlate-advantage-75311
10/23/2023, 12:23 AMcurved-television-6568
10/23/2023, 12:24 AMlate-advantage-75311
10/23/2023, 1:16 AM