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

Dirk Bächle tshortik at gmx.de
Tue Dec 9 15:59:15 EST 2014


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?

> [...]
>
> I want to create a type of Dir that has a builder to invoke vlib and 
> does its signature checking against the hash of the _info file (as it 
> is updated on every change).
>
I probably don't fully get what you're actually trying to accomplish 
here, but this should be possible with the current version of 
Node.Dir()...no changes to the sources needed.

> I then want to create a type of File that has dependency information 
> inside it for a builder to figure out what to build first (the 
> attributes) but that the target is going to be the vlib directory as 
> there is no equivalent of a .o file.
>
Figuring out what to build next is the task of the Taskmaster, not the 
Builder.

To me it seems that you're trying to put too much new behaviour into the 
Node class. That might be why you see yourself forced to a lot of source 
code changes in unexpected places.

SCons was built and designed to track dependencies, based on file's 
content changes. Given this as background you have to think about which 
parts of your overall build process could be processed by it. When this 
is clearly outlined, you can start to work on the implementation.

Dirk



More information about the Scons-users mailing list