[Scons-users] sconsign db access -- different results from Dir() and File() apis

Dirk Bächle tshortik at gmx.de
Mon Jun 3 18:54:49 EDT 2013


Hi Jay,

On 03.06.2013 21:50, Jay Damask wrote:

> Hello,

>

> I'm trying to learn how to access the persisted csig (let's say md5)

> info from the .sconsign.dblite db. Please note that below I'm running

> from the python command line. I'm finding different behavior running a

> custom.py via scons, I will follow this post with another.

>

> [...]

> Using the Dir api, I can exec:

>

> # $ python

> >>> import SCons, SCons.Script, SCons.Node

> >>> d_rel_src =

> SCons.Script.Dir('#src/build_comm_lib/communications/protocol_buffers')

> >>> d_rel_src.sconsign().get_entry('epa.proto').ninfo.csig

>

> and I get an md5 signature that is persisted in the db. I can inspect

> the db via:

>

> # $ sconsign -c .sconsign.dblite | less

>

> and sure enough Dir-api md5 is there.

>


by calling "sconsign()", you're lazy initializing the stored
.sconsign.dblite DB and then access the info that's stored in it for the
file entry "epa.proto".


> However, using the File api, I can exec:

>

> # $ python

> >>> import SCons, SCons.Script, SCons.Node

> >>> f_rel_src =

> SCons.Script.File('#src/build_comm_lib/communications/protocol_buffers/epa.proto')

> >>> f_rel_src.get_csig()

> or

> >>> f_rel_src.get_ninfo().csig

>


Here, you are creating a new File Node and initialize its ninfo
structure. But it doesn't get filled with info, this would happen later
during the actual build process in:

next_task
make_ready
make_ready_current
visited

. I hope this makes things clearer to you. Can you write a little more
about what you are actually trying to accomplish? Reaching into the
SCons DB and hacking around with ninfos/binfo looks a bit like the
"wrong path" to do things. ;)

Best regards,

Dirk

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://four.pairlist.net/pipermail/scons-users/attachments/20130604/7932144b/attachment-0001.html


More information about the Scons-users mailing list