Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Investigate on where and how to add a minimal graphviz dot output #2777

Closed
erik-adelbert opened this issue Apr 22, 2023 · 0 comments
Closed

Comments

@erik-adelbert
Copy link
Contributor

erik-adelbert commented Apr 22, 2023

This issue originated on please gitter chan, it invites a discussion about adding graphviz dot support to plz output:

  1. Fabian Ponce was asking about a way to output the build graph in graphviz dot format
  2. I replied by publishing our awk script that rewrites plz query deps <target> output in dot
  3. @Tatskaari reacted positively to it and told us about a (nice) existing plan to do more than that
  4. But in the meantime, his conclusion was:

yeah, adding dot output should be quite simple if you want to have a go
I think you might just want to switch on a flag here:
https://github.com/thought-machine/please/blob/master/src/query/graph.go#L24

And spit out the structs using a dot file encoder (hopefully there's something in the wild we can use, though it's not a super complex formatting)

But imho, the proposed insertion point and technique doesn't fit so well:

  • On one hand the existing awk script piggybacks query deps to rewrites the output, it is simple: the dependency graph is kept internally by please following a successful build, the translation is mechanical. This result is akin to Bazel. It could be added to please here,
  • On the other hand, the graph output of query graph is flat and embeds extra data (build state and more), inserting a dot output here would probably require to rebuild the dependency graph and, imo, poses at the very least the open question on how to represent the data. Addressing these questions seems to exceed the purpose of an encoder.

The question is: Should we add graphviz dot support now? If so, would it be acceptable to add it to query deps?

izissise added a commit to Wuageorg/please that referenced this issue May 26, 2023
Add an option --dot on query deps which
generate a dot compatible graph.

Graph nodes will have different shapes depending
if it's a filegroup/remote_file/text_file/binary

One can get an image with
`plz query deps //src:please --dot | dot -Tpng > graph.png`

issue thought-machine#2777
Tatskaari pushed a commit that referenced this issue May 31, 2023
Add an option --dot on query deps which
generate a dot compatible graph.

Graph nodes will have different shapes depending
if it's a filegroup/remote_file/text_file/binary

One can get an image with
`plz query deps //src:please --dot | dot -Tpng > graph.png`

issue #2777
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants