[Scons-dev] TEMPFILE spaces bug: your thoughts requested

Gary Oberbrunner garyo at oberbrunner.com
Sun Sep 2 10:41:07 EDT 2012


On Sat, Sep 1, 2012 at 11:27 PM, Kenny, Jason L <jason.l.kenny at intel.com> wrote:

> We gave Steve the patch to this issue.. As I recall he did not take it 100% and changed it. I have updated that version here:

>

> http://parts.tigris.org/source/browse/*checkout*/parts/trunk/parts/parts/mappers.py?revision=449&content-type=text%2Fplain

>

> end of the file line 694-800


At least just from looking at the code, I don't see how it quotes
cmd[0] or does anything specifically to prevent this problem.


> As I recall Steve tweak the actions to help make it smarter ( I believe it was the addition of a print action value), to help separate the value the temp file will call from the case when it need to create the temp file


Yes, that part is already in SCons.


> I forget the tweak we made, but it fixed the generation issue we found in our builds. I believe the issue is fixed with left overs lnk files in the temp directory. We use TempFile heavily in Part, or tweak the mslink and msvc tool use TEMPFILEMUNGE to deal with CC CXX and LINK commands as we found cases in our build in which the command line of these go way to long.

>

> The issue in 1705 I have not seen in our usages of it with scon 2.1 or 2.2


Can you try the simple test case from the bug report? I modified it a
little bit to run on modern SCons versions. This test fails for me on
the trunk. The fact that env['AR'] has spaces is what makes it fail.

=====
# Test MSVC tempfile handling

import os.path

d = os.path.join( "xxxxx", "yyyyyy", "zzzzzz", "aaaaaa" )
try:
os.makedirs( d )
except OSError, e:
pass


# Create a bunch of source files in xxxxx
numSources = 100
sources = []
for x in range(numSources):
source = os.path.join( d, str(x)+ ".cpp" )
sources += [ source ]
print "Making source: ", source
open( source, 'w' ).close()

env = Environment()

# Path to alternative build tools:
env['AR'] = env.WhereIs("lib.exe")
print "Using %s for AR"%env['AR']

# If issue #1705 is still active, this will fail,
# saying 'C:\Program' is not recognized as an internal or external command
# because it doesn't get quoted properly.
env.StaticLibrary( os.path.join( d, "foo.lib" ), sources )

=====


--
Gary


More information about the Scons-dev mailing list