Is there any way to see `./pants filedeps` output ...
# general
l
Is there any way to see
./pants filedeps
output as a graph?
w
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
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
yep: that’s a great way to do it.
l
i take it there is no way to graph all the dependencies in a repo either?
w
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
nice!
w
a neat usecase that i anticipate for that one will be flattening all paths, and then rendering those as a graph
l
is there a way to use a 2.9 build now? I would love to try this feature out
h