<https://github.com/pantsbuild/pants/pull/8450#dis...
# development
a
https://github.com/pantsbuild/pants/pull/8450#discussion_r336180171 discussion regarding the
--output-format=json
v2 list option which tries to add target fingerprinting in v2:
@average-vr-56795: In particular, if we change a default value in pants, or set a default with a flag or something, and the target doesn't set it, will the fingerprint change? Presumably it should, right?
Short answer: no, this fingerprint will not necessarily change, and yes, I absolutely think it should before we merge this.
Longer answer: Not all the things that contribute to Target#fingerprint do not transfer to a TargetAdaptor (which subclasses StructWithDeps, which subclasses Struct), only the things which are marked as hydrateable fields. As you imply, this is possibly not what we want at all for this purpose, and my use of TargetAdaptor here might not be correct.
@witty-crayon-22786 do you have any insight on how to bridge this? Does it break the v2 build graph traversal model if we're able to get an instance of a real Target in order to get a more normal fingerprint (i.e. a fingerprint containing everything the target payload does)? Are the Payload/Target concepts necessarily v1-only/requiring a v1 build graph, or is it possible to avoid having to reimplement payloads for all targets? I would love to pair on this or make an issue as necessary.