[Scons-users] sconsign db access -- different results from python cmdline and scons

Dirk Bächle tshortik at gmx.de
Mon Jun 3 19:03:34 EDT 2013


Hi Jay,

On 03.06.2013 21:50, Jay Damask wrote:

> Hello,

>

> [...]

> I find different behavior accessing the SConsign api depending on

> whether I use the python command line or put the same code in a

> custom.py file and call it from scons.

>

> # $ python

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

> >>> d_rel_src =

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

> >>> d_rel_src.sconsign().entries

>

> returns a dictionary of entries where the keys are filenames and the

> values are SConsignEntry objects. This result matches the

> .sconsign.dblite file.

>

> Now, instead when I put the line

>

> print

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

>

> in some custom.py file that scons ends up calling, I can a blank

> dictionary. I have played around with all path variations I can think

> of, no dice. I can step through the code w/ scons --debug=pdb and get

> the same result still.

>


I'm not 100% sure, but during the parsing phase (in the
SConscripts/SConstructs) SCons changes the current
working directory to the local folder where the corresponding file
resides. This is probably why on your call of
"sconsign()", the .sconsign DB can't be found.
It should work if you put the call in your top-level SConstruct though
(haven't tried this).

As I mentioned in my reply to your first email, it would be good to know
what you're actually up to with all this. You're probably on a wrong
track...

Regards,

Dirk


-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://four.pairlist.net/pipermail/scons-users/attachments/20130604/a6f93a01/attachment.htm


More information about the Scons-users mailing list