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

Re: [PATCH] configure: pre-create build directories for VPATH builds

From: Daniel Shahaf <d.s_at_daniel.shahaf.name>
Date: Sat, 05 Nov 2011 10:31:31 +0200

On Friday, November 04, 2011 5:41 PM, "Jonathan Nieder" <jrnieder_at_gmail.com> wrote:
> With r1197804, I tried:
>
> svn export ~/src/subversion svn-test
> cd svn-test
> ./autogen.sh
> mkdir BUILD
> cd BUILD
> ../configure --prefix=$HOME/opt/subversion
> make extraclean-swig
>
> The result:
>
> for d in /tmp/svn-test/BUILD/subversion/bindings/swig/python /tmp/svn-test/BUILD/subversion/bindings/swig/python/libsvn_swig_py; \
> do \
> cd $d && rm -rf *.lo *.la *.o *.pyc .libs; \
> done
> /bin/sh: 3: cd: can't cd to /tmp/svn-test/BUILD/subversion/bindings/swig/python
> /bin/sh: 3: cd: can't cd to /tmp/svn-test/BUILD/subversion/bindings/swig/python/libsvn_swig_py
> make: *** [clean-swig-py] Error 2
>
> The following patch fixes it for me. What do you think?
>
> [[[
> * configure.ac: In VPATH builds, create directories imitating the source
> hierarchy under the build directory, so other parts of the build system
> (like "make extraclean-swig") don't have to worry about directories not
> existing.
>
> Patch by: peters
> (Tweaked by me to avoid creating unnecessary .svn directories when building
> from an svn checkout.)
> ]]]
>
> Index: configure.ac
> ===================================================================
> --- configure.ac (revision 1197804)
> +++ configure.ac (working copy)
> @@ -1374,6 +1374,15 @@
>
> AC_OUTPUT
>
> +if test "$abs_srcdir" != "$abs_builddir"
> +then
> + AC_MSG_NOTICE([Creating build directories])
> + (
> + cd "$abs_srcdir"
> + find subversion tools contrib -name .svn -prune -o -type d -print
> + ) | xargs $MKDIR

I disagree with the fix.

First, can you rely on xargs(1) in configure scripts?

Secondly, quoting issues. '$MKDIR' needs to be quoted, and the xargs
will fail if someone does q[mkdir "subversion/ foo'bar"] in
"$abs_srcdir". (The latter is somewhat of an edge case, but it'd be
nice not to have it IMO.)

And thirdly, with this fix 'make extraclean-swig; make extraclean-swig'
will still fail :-)

Perhaps then you'd resend a patch that fixes the bug differently?

> +fi
> +
> # ==== Print final messages to user ==========================================
>
> dnl Configure is long - users tend to miss warnings printed during it.
>
Received on 2011-11-05 09:32:06 CET

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

This site is subject to the Apache Privacy Policy and the Apache Public Forum Archive Policy.