https://pantsbuild.org/ logo
h

hundreds-father-404

09/29/2021, 4:01 PM
@happy-kitchen-89482 if we proceed with
./pants peek
hydrating async fields, like evaluating the
sources
field, then I think there's less value for
./pants filedeps
? They now do the same thing, minus having to extract the info from JSON
A difference would be
BUILD
not showing up anymore, which it does in
filedeps
. But imo there isn't a ton of value to that?
w

witty-crayon-22786

09/29/2021, 4:07 PM
there is value in filedeps for the super simple case.
imo
h

happy-kitchen-89482

09/29/2021, 4:26 PM
If we switch peek to operate on generated targets then what does evaluating sources mean? The generate targets already have their sources explicitly set
w

witty-crayon-22786

09/29/2021, 4:26 PM
the lists will always be equivalent
i think that the
sources
example makes a clearer case for using the same field name, but toggling whether it’s expanded or not
h

happy-kitchen-89482

09/29/2021, 4:32 PM
I disagree, for two reasons: 1) it may be useful to see both, and 2) it's confusing to have the same field name mean two different things, it means that given a JSON blob you have to know the context in which it was produced to interpret it
I don't understand what you mean by "the lists will always be equivalent"?
w

witty-crayon-22786

09/29/2021, 4:32 PM
generated targets are generated from sources which have already been expanded
so the input and output will be a literal file path.
h

happy-kitchen-89482

09/29/2021, 4:33 PM
If
peek
operates on
Targets
instead of
UnexpandedTargets
then in the python case every target has exactly one source file
Right, so there is no point in expanding the sources
they are already expanded
w

witty-crayon-22786

09/29/2021, 4:33 PM
if the target is addressable, you’ll need to be able to display it
h

happy-kitchen-89482

09/29/2021, 4:34 PM
Unless you are suggesting that `Targets`` vs
UnexpandedTargets
should itself be optional
Today at least
Targets
replaces the generators with the generated
so you don't see the generators
h

hundreds-father-404

09/29/2021, 4:34 PM
generated targets are generated from sources which have already been expanded
Not true for languages like Go with
go_package
though. Expanding sources is still a thing for some languages
w

witty-crayon-22786

09/29/2021, 4:34 PM
that’s not what
peek
is doing today
h

happy-kitchen-89482

09/29/2021, 4:34 PM
I know, we are discussing changing that
w

witty-crayon-22786

09/29/2021, 4:35 PM
@happy-kitchen-89482: if both the generator and the generated target are addressable, then you need to be able to render each of them
and yea, as Eric said: in some cases you will see globs.
h

happy-kitchen-89482

09/29/2021, 4:35 PM
Because otherwise peek is not a good place for depgraph information
h

hundreds-father-404

09/29/2021, 4:35 PM
Today at least Targets replaces the generators with the generated
Right, and I propose in https://github.com/pantsbuild/pants/pull/12952 that we change that to the semantics Stu is proposing. Project introspection shows all addressable targets
h

happy-kitchen-89482

09/29/2021, 4:35 PM
OK
Always
w

witty-crayon-22786

09/29/2021, 4:35 PM
well, to be clear though:
h

happy-kitchen-89482

09/29/2021, 4:35 PM
?
w

witty-crayon-22786

09/29/2021, 4:35 PM
./pants peek $onetarget
should probably show one target…?
h

happy-kitchen-89482

09/29/2021, 4:36 PM
hm
I dunno
w

witty-crayon-22786

09/29/2021, 4:36 PM
basically, if something is addressable, it’s one-in-one-out
h

hundreds-father-404

09/29/2021, 4:36 PM
yeah I agree with that. But
./pants peek ::
should show everything
h

happy-kitchen-89482

09/29/2021, 4:37 PM
Interesting, so
::
implicitly globs over the generated targets
What about
:
?
w

witty-crayon-22786

09/29/2021, 4:37 PM
there is a fidgety thing there. i don’t think we have semantics to say that a
SingleAddress
doesn’t get expanded, but a glob does.
👍 1
h

hundreds-father-404

09/29/2021, 4:37 PM
imo
:
should be all targets in that dir, generated or not
w

witty-crayon-22786

09/29/2021, 4:37 PM
but… that would be reasonable semantics.
yea.
h

hundreds-father-404

09/29/2021, 4:38 PM
only
dir:tgt
should be one and exactly one target (for project introspection at least)
w

witty-crayon-22786

09/29/2021, 4:38 PM
but… it’s a change.
@happy-kitchen-89482: but, i think that this discussion is probably orthogonal to
peek
and fields…
unless it’s blocked you from getting a graph from
./pants dependencies --transitive --closed :: | xargs ./pants peek
…?
at the end of the day, that’s what we need.
h

happy-kitchen-89482

09/29/2021, 4:41 PM
I still think that is bonkers, but I no longer care...
I am probably wrong
w

witty-crayon-22786

09/29/2021, 4:42 PM
i think this discussion has shown that we have more than enough questions to answer in
peek
, let alone trying to add json and partial field outputs to other goals