[Scons-users] strange behavior with path as an array
robert zeigler
robert.zeigler at gmail.com
Tue Sep 10 18:32:09 EDT 2013
I think I've uncovered an scons bug (or at least a not-well-documented
"feature").
The following simple build script demonstrates the issue:
path=['/usr/local/bin:/opt/bin:/bin:/usr/bin'] #<-- this is the problematic
line. See below.
DefaultEnvironment(ENV={'PATH': path})
Command("A", "", "echo 'This is A' > $TARGET")
Command("B", "A", "cp $SOURCE $TARGET")
Command("C", "A", "cp $SOURCE $TARGET")
Running the first time gives:
scons: Reading SConscript files ...
scons: done reading SConscript files.
scons: Building targets ...
echo 'This is A' > A
cp A B
cp A C
scons: done building targets.
Next, running scons -n --debug=explain says:
scons: Reading SConscript files ...
scons: done reading SConscript files.
scons: Building targets ...
scons: rebuilding `B' because `/bin/cp' is no longer a dependency
cp A B
scons: rebuilding `C' because `/bin/cp' is no longer a dependency
cp A C
scons: done building targets.
But running scons does:
scons: Reading SConscript files ...
scons: done reading SConscript files.
scons: Building targets ...
cp A B
scons: done building targets.
And running it again does:
scons: Reading SConscript files ...
scons: done reading SConscript files.
scons: Building targets ...
cp A C
scons: done building targets.
Subsequent invocations of scons results in scons reporting . is up to date.
The problem is this line:
path=['/usr/local/bin:/opt/bin:/bin:/usr/bin']
If it is specified as:
path='/usr/local/bin:/opt/bin:/bin:/usr/bin'
Or as:
path=['/usr/local/bin', '/opt/bin', '/bin', '/usr/bin']
Everything works as expected.
What I consider a bug in scons is:
1) The build works the first time, but subsequent builds don't. I would
expect scons to either fail consistently or succeed consistently.
2) A dry run and a "real" run result in two different behaviors.
Robert
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://four.pairlist.net/pipermail/scons-users/attachments/20130910/1a79f20e/attachment.htm
More information about the Scons-users
mailing list