https://pantsbuild.org/ logo
#general
Title
# general
l

loud-laptop-17949

12/01/2021, 10:44 PM
Is there any way to see
./pants filedeps
output as a graph?
w

witty-crayon-22786

12/01/2021, 11:02 PM
mmm… short answer: no.
but one option for this would be to use
./pants dependencies --transitive $something | xargs ./pants peek
, and to then render the lists of files as a graph…
👍 1
peek
will emit each node with its sources and dependencies, which you can use as an adjacency list
there is discussion on https://github.com/pantsbuild/pants/issues/13283 about giving
peek
a
DOT
output format, which would get you 90% of the way there. but a small script can also spit out a dot file pretty easily, and would let you show only the source files, for example
l

loud-laptop-17949

12/02/2021, 12:46 AM
ok that might be enough to get me started
for conext - I am trying to debug why some of our targets seems to have an unexpected number of dependencies
w

witty-crayon-22786

12/02/2021, 12:47 AM
yep: that’s a great way to do it.
l

loud-laptop-17949

12/02/2021, 12:51 AM
i take it there is no way to graph all the dependencies in a repo either?
w

witty-crayon-22786

12/02/2021, 12:52 AM
that would still be
peek
plus a script to render `DOT`… you’d just go straight to
./pants peek ::
just … be warned that
DOT
becomes fairly useless past a few hundred nodes.
@melodic-thailand-99227: https://pantsbuild.slack.com/archives/C0D7TNJHL/p1638346952082700 had a good question about adding a “`paths`” goal (which we had in v1), which would render a few paths between two nodes… that can be very handy for spot-checking why you depend on a particular thing
i’ll open a ticket about that one.
👍 2
commented over there
https://github.com/pantsbuild/pants/pull/13778 landed, and will be in 2.9.x! thanks a lot @melodic-thailand-99227
l

loud-laptop-17949

12/02/2021, 9:17 PM
nice!
w

witty-crayon-22786

12/02/2021, 9:18 PM
a neat usecase that i anticipate for that one will be flattening all paths, and then rendering those as a graph
l

loud-laptop-17949

12/02/2021, 11:24 PM
is there a way to use a 2.9 build now? I would love to try this feature out
h

hundreds-father-404

12/02/2021, 11:27 PM
5 Views