[Scons-users] Debugging scons scripts

Bill Deegan bill at baddogconsulting.com
Wed Aug 8 21:21:47 EDT 2012


Bjoern,

On Wed, Aug 8, 2012 at 8:23 AM, Bjoern Doebel <bjoern.doebel at gmail.com>wrote:


> Hi all,

>

> I'd like to debug a scons setup and would be interested in pointers on

> how to proceed.

>

> I have a setup that builds one library and 2 applications (which

> depend on the lib to be ready) within a variant dir. In general, For

> that I do in my SConstruct:

>

> env = Environment( ... some std. settings for CPPPATH, FLAGS etc. )

> SConscript("app1", variant_dir="#/build/app1", exports="env")

> SConscript("app2", variant_dir="#/build/app2", exports="env")

> SConscript("lib", variant_dir="#/build/lib", exports="env")

>

> In the SConscripts I simply add a bunch of objects and one target:

>

> app1: env.app1 = env.Program("app1", app1_objs)

> app2: env.app2 = env.Program("app2", app2_objs)

> lib: env.lib = env.Library("foo", lib_objs)

>

> I declare additional dependencies in my main SConstruct:

>

> env.Depends(env.app1, env.lib)

> env.Depends(env.app2, env.lib)

>



Why are you doing this?
If you program links these libraries, you shouldn't need to do this..

-Bill


>

> This setup works fine so far. Now I added some Autoconf-style magic.

> _Before_ calling into the SConscripts, I do:

>

> conf = Configure(env)

> if not conf.CheckCC(): sys.exit(1)

> [... additional stuff ...]

> if not conf.CheckLib("boost_serialization", language="C++"): sys.exit(1)

> env = conf.Finish()

>

> The configuration stuff works as expected as well. Now I'm getting to

> my problem:

>

> When I modify one object that goes into the library, I'd expect the

> object as well as the library and all dependencies to be rebuilt.

> However, scons only triggers a rebuild of the object file, but does

> not link the library or the depending programs. I found this weird, so

> I started investigating. And what I found was, that if I remove the

> conf line:

>

> if not conf.CheckLib("boost_serialization", language="C++"): sys.exit(1)

>

> I get the expected behavior. This is really strange, because the

> boost_serialization lib is not related to the lib I build at all.

>

> I also tried to condense all this into a tiny test case (one lib, one

> app, some autoconf-style checks), but did not succeed in reproducing

> this behavior so far. Therefore I assume that I do some additional

> stuff that is wrong and I'd like to further investigate the problem.

> However, I feel clueless about where to look, so any hints would be

> appreciated.

>

> Cheers,

> Bjoern

> _______________________________________________

> Scons-users mailing list

> Scons-users at scons.org

> http://four.pairlist.net/mailman/listinfo/scons-users

>

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://four.pairlist.net/pipermail/scons-users/attachments/20120808/97a203c6/attachment.htm>


More information about the Scons-users mailing list