[Scons-users] error 127

Peter Kerpedjiev pkerpedjiev at gmail.com
Fri Sep 12 08:25:26 EDT 2014


Hi,

Sorry if I've spammed the list with this message, but it kept telling me 
it was rejected because I wasn't subscribed.

The problem is indeed that the command line is too long. Perhaps I can 
explain the background and solicit ideas for a workaround.

Ideally I'd like to concatenate a very long list of files (between 5000 
and 10000) into one single file. The problem is that when all of the 
source files are passed as arguments to 'cat', scons exits with an error 
code of 127 (which actually comes from the python spawnvpe function... 
FWIW). My question is, can anyone suggest a better way of doing this 
while avoiding passing all of the arguments?

One possible solution is to just iterate over the source files and 
append them to the target individually. The problem here, I imagine, 
would be that when some source file hasn't changed, scons will recognize 
that and skip that append step. Ideally it should be that if any of the 
source files change, all are concatenated to the target.

Is there a better solution that doesn't involve passing a huge number of 
arguments as source files?

-Peter

On 06/04/2014 05:42 AM, William Deegan wrote:
> Peter,
>
> If I had to guess, I’d say you’ve exceeded the maximum command line 
> length with 5000 source files, and the shell is exiting with 127 status?
>
> -Bill
>
> On June 1, 2014 at 9:55:35 PM, Peter Kerpedjiev (pkerpedjiev at gmail.com 
> <mailto:pkerpedjiev at gmail.com>) wrote:
>
>> Hi,
>>
>> I'm getting an error 127 and have no idea why. It comes up after running
>> a simple cat command. Here's the relevant sections of the SConstruct 
>> file:
>>
>> import os
>>
>> env = Environment(ENV=os.environ)
>> consolidate_angles = Builder(action="cat $SOURCES > $TARGET")
>> ...
>> env.consolidate(output_angles, angles_files)
>>
>> Where output_angles = 'some_file.csv' and angles_files = ['file1.csv',
>> 'file2.csv', ... ]. I've attached the output and the error I get. The
>> array angles_files has about 5000 entries. If I reduce it to 3000,
>> the build completes without errors. If I take entries 3000 - 5000,
>> I also don't get any errors, leading me to believe that it's the length
>> of the argument list that's problematic. If I run the corresponding
>> command with all 5000 arguments on the command line, it works fine.
>>
>> Any ideas about why this happens and/or how to fix it? Like I said, if I
>> copy and paste the command into bash, it works just fine. It's also the
>> last command in the SConstruct file, if that makes any difference.
>>
>> -Peter
>>
>> ------------------------------------------------------------------------
>> _______________________________________________
>> Scons-users mailing list
>> Scons-users at scons.org
>> http://four.pairlist.net/mailman/listinfo/scons-users



-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://pairlist4.pair.net/pipermail/scons-users/attachments/20140912/64e17d8e/attachment.html>


More information about the Scons-users mailing list