[Scons-users] SCons Intermittent parallel build failures
    Brady Johnson 
    bradyallenjohnson at gmail.com
       
    Mon Mar 31 15:35:23 EDT 2014
    
    
  
Hello all,
I *occasionally *get build failures when doing parallel builds while
compiling java code.
The dependencies are very clear, as follows:
1) WsCommon java code is compiled
2) The WsCommon.jar file is created, specifying the classes from 1) as the
source
3) The WsCommon.jar target is used in the classpath to compile other java
code, and also as a source to a WAR file builder.
Here is an excerpt that I can show from the SConscript:
tclass = env.SccfJava(target='WsCommon/classes',
                      source='WsCommon/src/main/java',
                      JAVACLASSPATH=ws_common_classpath)
target_WsCommon_jar = env.SccfJar(target='WsCommon.jar',
source='WsCommon/classes')
tclass = env.SccfJava(target='DomainIpService/classes',
                      source='DomainIpService/src/main/java',
                      JAVACLASSPATH=[target_WsCommon_jar,
                                     ws_common_classpath,
                                     ...])
The problem Im seeing is that it appears as though targets that depend on
the WsCommon.jar file start being built *before *the WsCommon.jar file has
completed being built, as can be seen in the following build output:
Command execution time:
software/Code/WebServices/build/WsCommon/classes: 0.000009 seconds
 Building target: software/Code/WebServices/build/WsCommon.jar...
Command execution time: software/Code/Common/build/libCollections.a:
0.278377 seconds
 Building target: software/Code/Common/build/gen-cpp/ServiceChainForwarding.o...
error: error reading software/Code/WebServices/build/WsCommon.jar;
*zip file is empty*
Command execution time: software/Code/WebServices/build/WsCommon.jar:
0.225366 seconds
(Immediately after this failure, I did a clean and built again, and it
worked just fine)
I am building with "--debug=time", and this is the function Im using to
print the cmd line, which should explain the format of the above output.
def print_cmd_line(s, target, src, env):
    if len(target) > 1:
        print " Building targets:\n\t%s..." % ('\n\t'.join([str(x) for x in
target]))
    else:
        print " Building target: %s..." % (str(target[0]))
I with I could show more of my code, but this is all that I can show.
Has anyone seen similar behavior? Im seen several people mention using the
SideEffect() function with a dummy target to avoid simultaneous building of
the specified targets. Im considering doing this, but considering the fact
that the target(s) in question here clearly depend on each other, it doesnt
seem correct to use SideEffect().
Regards,
Brady
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://four.pairlist.net/pipermail/scons-users/attachments/20140331/8429f0cd/attachment-0001.html 
    
    
More information about the Scons-users
mailing list