Wouldn't it be possible/easier to create a new/separate script that converts the `make -p` output to the desired `.dot` graph? (Just to have this not be a thing that needs to pass through the GNU make project.) Also I feel like on most nontrivial projects the graph would be gigantic & to get any usability you'd need something interactive where you can collapse/expand the nodes you're (not) interested in. Don't we hav…
Proposal to add build graph output to GNU Make (2020)
21–30 of 40 posts
Re: Proposal to add build graph output to GNU Make (2020)
#22I once helped maintain a nearly full featured implementation of make in Python (pymake) that grew out of the Firefox project. As much as I would like to support efforts like this, I feel like it is ultimately doomed to suffer from usability limitations because make does not have a static DAG. Rather, the DAG evolves dynamically as make evaluates targets. There are pesky problems like $(call) and $(eval) where you can…
Re: Proposal to add build graph output to GNU Make (2020)
#23Considering that all build systems must keep a dependency graph internally, it’s surprising how many of them make it incredibly difficult to inspect why things are being rebuilt. I don’t really get it either, I’ve talked to a lot of people and getting feedback on how the build system is doing its task is one of the biggest complaints I see (others are “what is the build system doing” and “why does this have the worst…
You can get a .drv file using 'nix-instantiate' (or 'nix repl'), e.g.
$ nix-store --query --tree "$(nix-instantiate -E '(import {}).bash')"
/nix/store/378a0jpkxiwzyk6jj6w2y2qdpn8790nc-bash-4.4-p23.drv
+---/nix/store/j0bqs7l21myz0llnjp9wq73m4nfarzg1-bootstrap-tools.drv
| +---/nix/store/71d9qf26s1nzrp34cqw1hh0yrx0h1kbx-cpio.drv
| +---/nix/store/7jl6nhfsc0mchccg5w40rfm4zfshpsag-bzip2.drv
| +---/nix/store/bci5x35014bbpc87x7ds2n2ffh5syns1-sh.drv
| +---/nix/store/fnn1nmssk7fsfn83ik66cxddqxzvnwx6-bootstrap-tools.cpio.bz2.drv
| +---/nix/store/p1bhqmlpf6vr9bc5mb99w29mvllcqmsm-mkdir.drv
| +---/nix/store/spcnl3whhm392kir1snaar4wlcawr3yq-unpack-bootstrap-tools.sh
+---/nix/store/04npl9bjcjkpqgwx1s94azbimfgr531v-bash44-012.drv
| +---/nix/store/j0bqs7l21myz0llnjp9wq73m4nfarzg1-bootstrap-tools.drv [...]
| +---/nix/store/z6aidzdk3yl2k92g8qj8xgzr8glp0vjr-bootstrap-stage0-stdenv-darwin.drv
| | +---/nix/store/1i5y55x4b4m9qkx5dqbmr1r6bvrqbanw-multiple-outputs.sh
| | +---/nix/store/bnj8d7mvbkg3vdb07yz74yhl3g107qq5-patch-shebangs.sh
| | +---/nix/store/cickvswrvann041nqxb0rxilc46svw1n-prune-libtool-files.sh
...
It can also output other formats, like GraphML and GraphViz. Note that querying a build output will get its runtime dependencies instead of build-time dependencies.https://man.archlinux.org/man/community/nix/nix-store.1.en#S...
Re: Proposal to add build graph output to GNU Make (2020)
#24Re: Proposal to add build graph output to GNU Make (2020)
#25Re: Proposal to add build graph output to GNU Make (2020)
#26Re: Proposal to add build graph output to GNU Make (2020)
#27Considering that all build systems must keep a dependency graph internally, it’s surprising how many of them make it incredibly difficult to inspect why things are being rebuilt. I don’t really get it either, I’ve talked to a lot of people and getting feedback on how the build system is doing its task is one of the biggest complaints I see (others are “what is the build system doing” and “why does this have the worst…
Like ninja -d explain ?
I've been using this in my build system to make the explain output slightly more useful: https://github.com/ninja-build/ninja/pull/2067
It's just a quick hack that took me half a day (most of which was remembering how to C++ after 8 years...) but I think it makes "-d explain" much more useful.
Really, the "explain" implementation could do with an overhaul. I'd love ninja to serialise the build graph to disk (or maybe just the subset of the graph that actually needed rebuilding). This could be augmented with the reason why each rule was run, and possibly even with the command output for each rule. Then the existing ninja tools like "graph", "browse", and "query" could optionally use this graph instead of the "build.ninja" file, so that you can inspect what happened the last time you ran "ninja".
Realistically I'll never get around to implementing this, and my pull request above gets me close enough.
Re: Proposal to add build graph output to GNU Make (2020)
#28https://techpubs.jurassic.nl/manuals/0650/developer/Debugger...
Re: Proposal to add build graph output to GNU Make (2020)
#29I once helped maintain a nearly full featured implementation of make in Python (pymake) that grew out of the Firefox project. As much as I would like to support efforts like this, I feel like it is ultimately doomed to suffer from usability limitations because make does not have a static DAG. Rather, the DAG evolves dynamically as make evaluates targets. There are pesky problems like $(call) and $(eval) where you can…