aboutsummaryrefslogtreecommitdiffhomepage
path: root/site/docs/tutorial
diff options
context:
space:
mode:
authorGravatar Gabriel Staples <ercaguy@gmail.com>2018-04-30 07:52:14 -0700
committerGravatar Copybara-Service <copybara-piper@google.com>2018-04-30 07:53:45 -0700
commit602cc73ffa582e4a6e4fffb26793b0a348d817af (patch)
tree57f523602f0625f4f933057e21e39dee1383b453 /site/docs/tutorial
parente07a0b8027665e0c02f980149ee4c26eb5543e3f (diff)
Add instructions to view graph locally via xdot
No one with sensitive data wants to get in the habit of pasting output into web pages online. This is very helpful to those who'd like to generate and view the graphs locally. Closes #4964. PiperOrigin-RevId: 194785337
Diffstat (limited to 'site/docs/tutorial')
-rw-r--r--site/docs/tutorial/cpp.md15
1 files changed, 15 insertions, 0 deletions
diff --git a/site/docs/tutorial/cpp.md b/site/docs/tutorial/cpp.md
index 4e7c49e2e5..09ff8bd4a1 100644
--- a/site/docs/tutorial/cpp.md
+++ b/site/docs/tutorial/cpp.md
@@ -192,6 +192,21 @@ output as a graph.
Then, paste the text into [GraphViz](http://www.webgraphviz.com/).
+On Ubuntu, you can view the graph locally by installing GraphViz and the xdot
+Dot Viewer:
+
+```
+sudo apt update && sudo apt install graphviz xdot
+```
+
+Then you can generate and view the graph by piping the text output above
+straight to xdot:
+
+```
+bazel query --nohost_deps --noimplicit_deps 'deps(//main:hello-world)' \
+ --output graph | xdot
+```
+
As you can see, the first stage of the sample project has a single target
that builds a single source file with no additional dependencies: