[Scons-users] Builder object being called a large number of times and getting odd results

Gary Oberbrunner garyo at oberbrunner.com
Wed Aug 15 14:01:20 EDT 2012


On Wed, Aug 15, 2012 at 12:17 PM, TOM TANNER (BLOOMBERG/ LONDON)
<ttanner2 at bloomberg.net> wrote:

> I was trying to fiddle with one of my builders in a SConscript file, and I added some trace to it.

>

> It's called (a bit hackily) like this

>

> Import('*')

>

> (gets a Cloned environment)

>

> def _generator(...):

> print for_signature, Glob('stuff/*.mlst', string=True)

> return [ ... ]

>

> bld = Builder(generator = _generator)

>

> env['BUILDERS']['FooBar'] = bld

> env.FooBar([target1, target2], [ source1, source2 ])

>

> The builder gets called *eight* times each with for_signature set to 1.

>

> The first time it gets caled, Glob() behaves very strangely, returning me a list of files that exist in the repository BUT with the path to the version where the build targets would exist.

>

> Thus in the repository (path /my/source), there is a file called stuff/fred.mlst

>

> I build in /my/source/aix/64/stuff/fred.mlst

>

> the first time my function gets called, it prints /my/source/aix/64. The other 7 times, it prints stuff/fred.mlst


Hi Tom, not sure what's happening here. Can you send a complete
example so someone can try it out?


--
Gary


More information about the Scons-users mailing list