You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
We solely do this to avoid the representation problem of how to represent a file address when there are multiple of them, but they have different generated_base_target_name. In Pants output, like ./pants list, we would show the same file foo.txt multiple times, which looks redudant, even though they're different targets. We'd need a syntax like foo.txt@:original to show the base target when there was ambiguity.
--
Why change this?
It makes the experience with file arguments more consistent for end users. We no longer have a special case. When using file args, you always get generated subtargets / files, no matter what.
We can remove AddressWithOrigin et al. The only reason we use WithOrigin right now is for SpecifiedSourceFiles. If we fix this issue, then there is no need for SpecifiedSourceFiles as described in Optimize generated subtargets' interaction with SpecifiedSourceFiles #10454. This results in much less complexity for plugin authors to no longer need to know about OriginSpec.
--
Note that we will continue to need to use the original owning address if we detect a deleted file:
Currently, if there are multiple owners of a source file, then we do not use generated subtargets:
pants/src/python/pants/engine/internals/graph.py
Lines 277 to 284 in 0a61cf8
We solely do this to avoid the representation problem of how to represent a file address when there are multiple of them, but they have different
generated_base_target_name. In Pants output, like./pants list, we would show the same filefoo.txtmultiple times, which looks redudant, even though they're different targets. We'd need a syntax likefoo.txt@:originalto show the base target when there was ambiguity.--
Why change this?
AddressWithOriginet al. The only reason we useWithOriginright now is forSpecifiedSourceFiles. If we fix this issue, then there is no need forSpecifiedSourceFilesas described in Optimize generated subtargets' interaction withSpecifiedSourceFiles#10454. This results in much less complexity for plugin authors to no longer need to know aboutOriginSpec.--
Note that we will continue to need to use the original owning address if we detect a deleted file:
pants/src/python/pants/engine/internals/graph.py
Lines 259 to 261 in 0a61cf8
This is important for
--changed-sinceto work properly.