[Scons-dev] How to traverse the graph after files are read

Kenny, Jason L jason.l.kenny at intel.com
Wed May 20 09:59:12 EDT 2015


>>Are there two separate FS objects for that?

No there is one global fs that is shared with all environment objects.

After the Sconstruct are read in this will hold all nodes that are known to the SCons and their relationships. The scanner have not been run yet, so there might be some node that are still to be added as dependent children. I think a call to get_children() will call the scanners however and return all explicit and implicit node dependents for a given node.

Jason

-----Original Message-----
From: Scons-dev [mailto:scons-dev-bounces at scons.org] On Behalf Of anatoly techtonik
Sent: Wednesday, May 20, 2015 8:47 AM
To: SCons developer list
Subject: Re: [Scons-dev] How to traverse the graph after files are read

On Wed, May 20, 2015 at 3:36 PM, Gary Oberbrunner <garyo at oberbrunner.com> wrote:
> On Wed, May 20, 2015 at 6:43 AM, anatoly techtonik 
> <techtonik at gmail.com>
> wrote:
>>
>> The confusing part is that
>> node graph is derived from filesystem.
>
>
> FS represents the filesystem, both on disk and what will exist once 
> all targets are built.

Are there two separate FS objects for that?

> I didn't say start from the filesystem, I said start from your target(s).
>
> myprog=Program(...)
> ...
> # at end of SConstruct:
> visit_node_sources_recursively(myprog)
>
> you just have to write visit_node_sources_recursively, following each 
> node's .sources list.  myprog is a File node (actually a list of 
> those).  Nowhere should you need FS.

First, I don't need to do this from SConstruct. I am looking how to add new debug option to scons itself.

So, there is no graph I can dump? Just a list of targets that are being traversed using sources? If so, then that means that every target should be a filesystem object?

What is target then? If it is a name, how a lookup if made to locate it in FS tree?
--
anatoly t.
_______________________________________________
Scons-dev mailing list
Scons-dev at scons.org
https://pairlist2.pair.net/mailman/listinfo/scons-dev


More information about the Scons-dev mailing list