[Scons-users] Builder Chains Not Working?

William Deegan bill at baddogconsulting.com
Thu Nov 15 20:13:49 EST 2012


On 11/14/2012 04:15 PM, Mark Ribau wrote:

> I renamed all the files when I copy pasted into my email to protect

> "trade secrets" or whatever. :-P It is correct in the actual file.

> Fixed copypasta should be:

>

>

> in deeper SConscripts:

> env.Builder1("target0.json", "source0.json")

>

> in Builder1's emitter:

> env.MultiBuilder1("target1.json", "target0.json")

>

> in a parent SConscript:

>

> ret = env.MultiBuilder1("target2.json", ['target1.json', 'source2.json'])

> env.Alias( "myalias", True, ret)

> ret = env.Builder2("target2.binaryplatform", "target2.json")

> env.Alias( "myalias", True, ret)

> ret = env.InstallAs(os.path.join(installBase,"target2.binary"),

> "target2.binaryplatform")

> env.Alias( "myalias", True, ret)

> *

> *

>


*Should probably be:

*ret = env.MultiBuilder1("target2.json", ['target1.json', 'source2.json'])
env.Alias( "myalias", ret)
ret = env.Builder2("target2.binaryplatform", "target2.json")
env.Alias( "myalias", ret)
ret = env.InstallAs(os.path.join(installBase,"target2.binary"),
"target2.binaryplatform")
env.Alias( "myalias", ret)

or

ret1 = env.MultiBuilder1("target2.json", ['target1.json', 'source2.json'])
ret2 = env.Builder2("target2.binaryplatform", "target2.json")
ret3 = env.InstallAs(os.path.join(installBase,"target2.binary"),
"target2.binaryplatform")
env.Alias( "myalias", ret1 + ret2 + ret3)

ret is a node list and not really an action (so second param not third).


The way you're added env.MultiBuilder1() in the emitter makes me think
you really want a psuedo builder and not a builder to group sets of
building together.
http://www.scons.org/doc/production/HTML/scons-user/c3938.html

Does MultiBuilder1 simply concatenate the source files?
Any reason you can't do:
ret1 = env.MultiBuilder1("target2.json", ['target0.json', 'source2.json'])


-Bill



More information about the Scons-users mailing list