[Scons-users] Follow-up: Success depends on target name!

Marc Branchaud mbranchaud at xiplink.com
Thu Oct 4 17:19:13 EDT 2012


On 12-10-04 04:57 PM, Marc Branchaud wrote:

> Hi all,

>

> I think I've found a bug, but I might be missing something. I'm trying to

> use a custom toolchain for my builds. The following SConstruct doesn't work

> in SCons 2.2.0 (nor even in SCons 1.2.0):

>

> -- 8< --

> e = DefaultEnvironment()

>

> mycc = e.Command(target="tools/mycc",

> source="/usr/bin/gcc",

> action="cp $SOURCE $TARGET")

>

> e.Replace(CC = mycc[0].abspath)

>

> e.Program(target='testapp', source='test.c')

> -- >8 --


While crafting the example for this problem, I ran into some really confusing
behaviour. The build works after I change the above SConstruct so that mycc
is no longer in the tools/ subdirectory:

e = DefaultEnvironment()
mycc = e.Command(target="mycc",
source="/usr/bin/gcc",
action="cp $SOURCE $TARGET")
e.Replace(CC = mycc[0].abspath)
e.Program(target='testapp', source='test.c')

But it fails if I give the Program a different target name! The following
names all cause SCons to miss the dependency on mycc:
app
app2
2app
glop
gloptest (but testglop works)
abcdefg
aragon (but waragon works)
frodo (but phrodo works)
gimli (but qgimli works)
legolas (but plegolas works)
boromir (but sauron works)

I can't imagine what SCons has against the Fellowship of the Ring... :)

All these failing target names work if I don't replace CC in the environment.
Also, I see the same behaviour in both 1.2.0 and 2.2.0.

Can anyone else confirm this weirdness?

M.



More information about the Scons-users mailing list