[Scons-users] Problems with SCons parallel build

Tom Tanner (BLOOMBERG/ LONDON) ttanner2 at bloomberg.net
Mon Mar 24 08:59:37 EDT 2014


Are you using shutil.make_archive in one of your own builders? Or is it an scons supplied one, in which case it should be changed.

I looked at shutil.make_archive, and it does indeed change into the supplied directory, which is a bit painful. Maybe scons could supply an implementation which doesn't do that? The tarfile module looks like it should be able to cope with this, by using the arcname parameter to add

----- Original Message -----
From: scons-users at scons.org
To: scons-users at scons.org
At: Mar 22 2014 14:35:16


At first I thought this problem was caused by the RPM generation that Im doing by calling os.system('rpmbuild ...') and perhaps 'rpmbuild' could be changing the directory, since the rpm spec files have lots of cd, mkdir, etc. But I realized that cant be it, since os.system() spawns a subprocess. Upon further investigation, I found the problem to be attributed to shutil.make_archive(). Looking at the python docs for the utility: http://docs.python.org/2/library/shutil.html I saw the following:


shutil.make_archive(base_name, format[, root_dir[, base_dir[, verbose[, dry_run[, owner[, group[, logger]]]]]]])
...
root_dir is a directory that will be the root directory of the archive; ie. we typically chdir into root_dir before creating the archive.
...

After changing "shutil.make_archive()" with "os.system('tar czf theFile.tgz -C dir files)" it works great!! Ive tested it several times with "-j 12" with no problems.

Is there someway we could document this? It would be nice to help people avoid this problem in the future.

Regards,

Brady


-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://four.pairlist.net/pipermail/scons-users/attachments/20140324/f3c31139/attachment.html


More information about the Scons-users mailing list