|
Boost-Build : |
Subject: Re: [Boost-build] Dependency Graph Visualization
From: Steven Watanabe (watanabesj_at_[hidden])
Date: 2015-03-16 19:03:47
AMDG
On 03/16/2015 03:50 PM, aaron_at_[hidden] wrote:
>
> I have a few questions first:
>
> In order to get the header files that each file depends on, I need to use the
> scanners, however, the scanners are used during an UPDATE within the engine. For
> the Python port, is there a reason to keep the header file scanning (as well as
> caching) within the engine? Would it be too slow to move that portion of
> dependency discovery into Python during the actualization phase?
Header scanning is actually quite tricky
and is pretty tightly coupled with updating.
> For the
> purposes of outputting just the JSON with no intention to build, is there a way
> to get the headers using the existing Scanners?
>
Currently, the only way to get this information is
from b2 -d+12. There's no interface for accessing
the dependency graph from Jamfiles.
> For my company's visualization concerns, I would like to be able to create a
> pre-build hook that allows me to grab the same top-level targets, call the
> function I want to create to get the JSON dependency tree, then dump an HTML
> file that contains the framework and setup for using the dependency graph data
> with D3.js. However, the call to the pre-build hook doesn't pass any information
> to the hook and there isn't any way (that I can tell) to grab the top level
> targets from inside of the hook. Once Vladimir's server branch is complete, it
> would be nice if the Builder instance was passed into the pre and post build
> hooks so that any of the hooks had access to all of the build information. Is
> there a good way to get the top level targets?
>
The pre-build hook was written for a specific
use case in Boost, which doesn't need this.
I think passing the Builder would make sense,
but as things stand now there's no good way
to pass the information you want.
> Last question: when should the build system be used to create an output file and
> when should Python be used? For example, --out-xml created a target to output
> the file and special care was taken to ensure that the XML would be output every
> time --out-xml was specified on the command-line. Using Python, it seems like
> this would be much easier (at least for the JSON implementation) to just open a
> file and then write the json.dumps() output to the file. I'm more of a Python
> developer than a build systems developer so that would be the reason for my
> affinity to the Python solution :D
>
Just use python. The only reason that --out-xml
uses a target is that Jam doesn't have any I/O
facilities except targets.
In Christ,
Steven Watanabe
Boost-Build list run by bdawes at acm.org, david.abrahams at rcn.com, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk