[svn.haxx.se] · SVN Dev · SVN Users · SVN Org · TSVN Dev · TSVN Users · Subclipse Dev · Subclipse Users · this month's index

Re: [PATCH] close racecondition with make -j in header_wrappers.py

From: David Glasser <glasser_at_davidglasser.net>
Date: Wed, 23 Jan 2008 16:30:04 -0800

Ah, no wonder it fails for me if I put my swig commands under -j. I'm
not too familiar with the SWIG generation process, though; can another
commiter review this? Why would "make" be trying to write the same
file multiple times anyway? That seems wrong.

--dave

On Jan 23, 2008 7:04 AM, Olaf Hering <olh_at_suse.de> wrote:
>
> sometimes make -j fails. I came up with the change below.
> This change is in use since Feb 2006.
> Still applies to trunk.
>
> /usr/bin/python /usr/src/packages/BUILD/subversion-1.3.x/build/generator/swig/header_wrappers.py /usr/src/packages/BUILD/subversion-1.3.x/build.conf /usr/bin/swig /usr/src/packages/BUILD/subversion-1.3.x/subversion/include/svn_auth.h
>
> /usr/src/packages/BUILD/subversion-1.3.x/subversion/bindings/swig/core.i:613: Error: Unable to find 'svn_auth_h.swg'
> /usr/bin/swig -I/usr/src/packages/BUILD/subversion-1.3.x/subversion/bindings/swig -I/usr/src/packages/BUILD/subversion-1.3.x/subversion/bindings/swig/include -I/usr/src/packages/BUILD/subversion-1.3.x/subversion/bindings/swig/proxy -I/usr/src/packages/BUILD/subversion-1.3.x/subversion/bindings/swig/proxy -I/usr/src/packages/BUILD/subversion-1.3.x/subversion/include -I/usr/include -I/usr/include/apr-1 -python -classic -w451 -w305 -o subversion/bindings/swig/python/core.c /usr/src/packages/BUILD/subversion-1.3.x/subversion/bindings/swig/core.i
>
> build/generator/swig/header_wrappers.py | 3 ++-
> 1 file changed, 2 insertions(+), 1 deletion(-)
>
> --- a/build/generator/swig/header_wrappers.py
> +++ b/build/generator/swig/header_wrappers.py
> @@ -239,7 +239,7 @@ class Generator(generator.swig.Generator
> self.proxy_filename(base_fname))
>
> # Open the output file
> - self.ofile = open(output_fname, 'w')
> + self.ofile = open(output_fname + "~", 'w')
> self.ofile.write('/* Proxy classes for %s\n' % base_fname)
> self.ofile.write(' * DO NOT EDIT -- AUTOMATICALLY GENERATED */\n')
>
> @@ -264,6 +264,7 @@ class Generator(generator.swig.Generator
>
> # Close our output file
> self.ofile.close()
> + os.rename(output_fname + "~", output_fname)
>
> def process_header_file(self, fname):
> """Generate a wrapper around a header file"""
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: dev-unsubscribe_at_subversion.tigris.org
> For additional commands, e-mail: dev-help_at_subversion.tigris.org
>
>

-- 
David Glasser | glasser@davidglasser.net | http://www.davidglasser.net/
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe_at_subversion.tigris.org
For additional commands, e-mail: dev-help_at_subversion.tigris.org
Received on 2008-01-24 01:30:18 CET

This is an archived mail posted to the Subversion Dev mailing list.