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

anatoly techtonik techtonik at gmail.com
Wed Jun 3 09:08:04 EDT 2015


On Wed, Jun 3, 2015 at 2:30 PM, Gary Oberbrunner <garyo at oberbrunner.com> wrote:
> On Wed, Jun 3, 2015 at 6:54 AM, anatoly techtonik <techtonik at gmail.com>
> wrote:
>>
>> But I have plenty of other files in current directory. Why those are
>> not included?
>>
> At the end of reading the SConstruct, i.e. before the build phase begins,
> SCons only creates Nodes for files it has been told about.

But why SConstruct needs to be a part of build graph?

Looks like the current logic for building tree om 2.3.4 is the following:
1. SCons looks for SConstruct (in parent dirs also if requested)
2. It creates a FS object at this dir level, which is "default FS"
3. Then it creates a File node in this fs for SConstruct
    (creating nodes is handled by fs.File -> fs._lookup_abs)
4. The node for file is created by invoking File(file_name, dir_node, fs)
    (lookup of files on this level is made by simple dict lookup in
     _lookupDict index using full path - no tree traversal)
5. So, node linking should be done in File constructor, which is just
    a call to Base constuctor
6. Looking at Base constructor, I don't see where Node is linked into
    a tree. =/

What did I miss?
-- 
anatoly t.


More information about the Scons-dev mailing list