[Scons-users] Just abandoned an attempt to subclass Node.FS.Dir() .. alternative?

Matthew Swabey mattaw at gmail.com
Tue Dec 9 17:21:41 EST 2014


I think you have helped me think about the problem properly - the first 
step in succeeding!

On 12/9/2014 3:59 PM, Dirk Bächle wrote:
> On 09.12.2014 20:39, Matthew Swabey wrote:
>> So there isn't an easy way to subclass a Dir or File that I 
>> overlooked? Or avoid duplicating tons of wrappers and other code to 
>> support a new node that looks very like a Dir and a File?
>>
>> The problem is ModelSim again:
>> vlib foo (create library foo which is a directory on the FS with an 
>> _info file underneath and acquires new directories based on calls to 
>> other tools)
>> vcom bar.vhd -work foo (creates subdirs under foo per module in the 
>> file using unpublished name mangling to do so)
> If the name mangling scheme is unknown, how do you plan to ever map it 
> to SCons...assuming that you would succeed in deriving your own 
> Dir/File type?
>
The problem I have with the HDL files is that their compilation results 
in an entry in this opaque library "directory" which updates the _info 
file and creates subdirs with mangled names.
However I can query the library with the provided binary "vdir", 
extracting lists of source files used to make things, properties of the 
compile including dates and times, etc.

I think I have not thought the node "strategy" through properly - tell 
me if this thinking is wrong:

There is a list of source nodes and a list of target nodes and the 
builder transforms one into the other.

The source node will just be a file node - it will represent the source 
file perfectly as it is a text file with code in. (I will need to use 
other infrastructure on the source node for `includes and packages that 
will have to be discovered and added to the dependency graph to be built 
however let us leave that for later as that is all text file searching 
and manipulation and loads of support is already there.)

The target node however needs to be the one that will query this opaque 
library using the binary to see if a compiled version exists and to get 
the changed date and create a suitable signature. Perhaps the Node.Value 
would work here? Or would a full custom node suit the situation better.

Hopefully I am now thinking "scons". Any improvements?

Matthew



More information about the Scons-users mailing list