[Scons-users] Custom nodes with a fixed ID

Brucker Florian (CR/AEH1) Florian.Brucker at de.bosch.com
Tue Mar 12 04:56:16 EDT 2013


Hello,

are there any resources (existing code, tutorials, etc.) available for using a custom nodes that have IDs which do not change between builds? Basically just like files and directories - database fields, for example. Anything that's addressable using an ID string.

We're currently using Value nodes for modeling such items, but those are hard to debug using --debug=explain: Firstly, their value is displayed instead of the corresponding ID. That can be fixed by subclassing SCons.Node.Python.Value, taking an additional ID string in the constructor and displaying it in __str__, etc. But more importantly, every time *any* dependency of a certain node changes, *all* value nodes are displayed as former & new dependencies ("'False' is no longer a dependency ... 'False' is a new dependency). This does not work for us, because we have several thousand of these nodes (we're basically building out of a database instead of from the file system).

I looked into how the mechanism for file and directory nodes works, which do show the desired behavior. As far as I understand, file and directory nodes are pseudo-singletons, and it is ensured that the same (normalized) path always maps to the same node instance. However, the details are distributed all over the FS nodes and the .sconsign mechanism, and I haven't been able to figure it out completely. More importantly I don't have a clear idea of how one could offer the same mechanism for a custom node class.

Thanks in advance for any pointers on this!


Mit freundlichen Grüßen / Best regards

Florian Brucker

Robert Bosch GmbH
(CR/AEH1)
Postfach 30 02 40
70442 Stuttgart
GERMANY
www.bosch.com<http://www.bosch.com>

Tel. +49 711 811 35247
Fax +49 711 811 51835247
florian.brucker at de.bosch.com<mailto:florian.brucker at de.bosch.com>

Sitz: Stuttgart, Registergericht: Amtsgericht Stuttgart, HRB 14000;
Aufsichtsratsvorsitzender: Franz Fehrenbach; Geschäftsführung: Volkmar Denner,
Stefan Asenkerschbaumer, Bernd Bohr, Stefan Hartung, Dirk Hoheisel, Christoph Kübel, Uwe Raschke,
Wolf-Henning Scheider, Werner Struth, Peter Tyroller



-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://four.pairlist.net/pipermail/scons-users/attachments/20130312/47b61f5e/attachment.html>


More information about the Scons-users mailing list