Possible to spit out Directed Acyclic Graph from Scons? - scons

Is there a way to get scons to output the directed acyclic graph that it internally generates? In a graphviz format perhaps?

I don't think so. You can get it to spit out the dependency tree in various detail in an ASCII-art type way, see the --tree=xxx option described on the man page.

There is a python script to visualize scons dependencies with graphviz.

Related

Check which targets/components a stack target/component depends on?

By running stack ide targets, I can get a list of all the targets in a stack project. For example, for Halive, I get:
halive:lib
halive:exe:halive
halive:test:compileexpr
halive:test:demo
halive:test:subhalive
halive:test:testghc
halive:test:unit
I'd like to now if there's a way we can ask stack, intero, or some other tool, which targets a target depends on.
For example, in this scenario, I'd like stack/intero/whatever to tell me that halive:test:unit depends on halive:lib.
In case that's not possible, I guess I can try inspecting the .cabal file myself... is there a parser or a tool or something that could give me something like that?
You can just run stack dot command to build dependency graph for your project and then analyze this graph by yourself. I think your task is rather specific. Just a single analyzing algorithm for dependency graph. Probably not so common so it's not implemented yet (maybe it's implemented, but I'm not aware of it).
See details here:
Use “stack dot” to see which of your deps bring a particular package to your dependency tree

How to print out an ascii tree of the Linux script files?

I've seen in some posts people posting an ascii tree diagram of the Linux init scripts. You can see what binaries/scripts are called from init, and in what order.
Do you know which tool are they using?
Without an example, it's difficult to say.
You can use initctl list to list init scripts, and it shows a list of scripts, status and the process id (if they are running). However it's not in a tree format, just a list.
I use htop which has a tree mode (f5). Not sure if that's what you're looking for.
It might be easier if you could provide a link to what you mean.

Interactive Graph and Tree visualization for Desktop Application in Haskell

I have seen that there are bindings to graphviz, but it appears to just work with the Dot language and so I'm assuming that it would be more appropriate for static visualization. We have more of a dynamic, often updated, interactive need for automatic laying out and working with graphs and trees. Is there an appropriate library for such a thing in Haskell?
I need something that will work on at least both Linux and Windows
There are bindings to ubigraph, a closed source graph visualization program/library that has a free-ware version available for download. Ubigraph is interactive, fairly fast, and really damned easy to use given the hubigraph bindings - see an old answer of mine for a code example.
This appears to come the closest I was able to find so far:
http://hackage.haskell.org/package/graph-rewriting-layout-0.4.4
I also ran across this:
http://www.haskell.org/pipermail/haskell-cafe/2009-April/060496.html

Graphing the DAG generated by make?

My understanding is that when make executes, it generates a DAG internally to represent all the dependencies in the project. Is there a way to get at that DAG and graph it, say using something like graphviz?
I'm using gnu make on Ubuntu 8.04.
EDIT
I just ran across these tools called mamdag and mamdot. They're supposed to work with both nmake and gnu make, but I can't seem to find the options to get gnu make to spit out the mam file.
It can be downloaded here - these packages:
INIT
ast-base
ast-gpl
Just found this article by Glenn Fowler at AT&T describing the MAM language and the mamdot tool.
It seems like you have to patch gnu make for this to work, although I'm not 100% certain yet.
Maybe there's another way?
You should try using Makefile::GraphViz's gvmake utility to create the graphs you want
For the code side of things, doxygen will produce dependency diagrams between source and header files, if that is what you are interested in, without the use of make.

Generate class diagram from existing javadocs

I'm using an external java library for which I only have the javadocs and do not have the source code. I'd like to generate a UML diagram from the existing javadocs so that I can visualize the class hierarchy using something like Graphviz. Is that possible? Note that what I'm looking for is a graphical version of overview-tree.html.
Please let me know if you have any ideas and/or suggestions.
Thanks,
Shirley
I don't believe that there is such a tool. Most of the reverse engineer tools depend on the actual code. The javadoc information isn't guaranteed to match the code as a 1:1 for the structure, thus making it unreliable.
I'm not familiar with any off-the-shelf solution for this purpose. Most commonly folks have the source code that generated the JavaDoc.
That being said, the overview-tree.html traditionally has a fairly straightforward HTML format.
It should not be difficult to write a script that would read the file as text or as a DOM, reconstruct the hierarchy of UL and LI tags, and use that to build an input file for graphviz. I've done similar stuff in the past with other forms of data.
It's just a matter of time and proficiency with the scripting language or appropriate tools.
The one problem of this approach is that you would only get the hierarchy of classes. You would have to make it somewhat smarter if you wanted to get the "implements XYZ" and create multiple hierarchies. Even if you could get that data, you would have to manipulate GraphViz's levels to get it to provide an appropriate layout once you have this multiple inheritance structure.
Of course, adding the details of the members would turn this into a whole new problem since you will have to access other HTML files.

Resources