You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@subversion.apache.org by Ramkumar Ramachandra <ar...@gmail.com> on 2011/01/08 10:03:46 UTC

[PATCH] Makefile.svn: Make stock SVN executable configurable

[[[
Makefile.svn: Make stock SVN binary configurable

* tools/dev/unix-build/Makefile.svn: Introduce a new variable
  $STOCK_SVN that defaults to `env LD_LIBRARY_PATH= svn`. Change
  references to `svn export` and `svn co` to use $STOCK_SVN.
]]]

Index: tools/dev/unix-build/Makefile.svn
===================================================================
--- tools/dev/unix-build/Makefile.svn	(revision 1056662)
+++ tools/dev/unix-build/Makefile.svn	(working copy)
@@ -10,6 +10,9 @@ ENABLE_JAVA_BINDINGS ?= no # they don't build with
 USE_APR_ICONV ?= no # set to yes to use APR iconv instead of GNU iconv
 PARALLEL ?= PARALLEL=1 CLEANUP=1
 
+# Assumes that `svn` is in $PATH and uses distribution APR libraries
+STOCK_SVN	= env LD_LIBRARY_PATH= svn
+
 PWD		= $(shell pwd)
 UNAME		= $(shell uname)
 
@@ -230,7 +233,7 @@ apr-clean:
 $(APR_OBJDIR)/.retrieved:
 	[ -d $(APR_OBJDIR) ] || mkdir -p $(APR_OBJDIR)
 	if [ ! -d $(APR_SRCDIR) ]; then \
-		svn export $(APR_URL)/tags/$(APR_VER)/ $(APR_SRCDIR); \
+		$(STOCK_SVN) export $(APR_URL)/tags/$(APR_VER)/ $(APR_SRCDIR); \
 	fi
 	touch $@
 
@@ -426,7 +429,7 @@ apr-util-clean:
 $(APR_UTIL_OBJDIR)/.retrieved:
 	[ -d $(APR_UTIL_OBJDIR) ] || mkdir -p $(APR_UTIL_OBJDIR)
 	if [ ! -d $(APR_UTIL_SRCDIR) ]; then \
-		svn export $(APR_UTIL_URL)/tags/$(APR_UTIL_VER)/ \
+		$(STOCK_SVN) export $(APR_UTIL_URL)/tags/$(APR_UTIL_VER)/ \
 			$(APR_UTIL_SRCDIR); \
 	fi
 	touch $@
@@ -622,7 +625,7 @@ serf-clean:
 $(SERF_OBJDIR)/.retrieved:
 	[ -d $(SERF_OBJDIR) ] || mkdir -p $(SERF_OBJDIR)
 	if [ ! -d $(SERF_SRCDIR) ]; then \
-		svn export $(SERF_URL) $(SERF_SRCDIR); \
+		$(STOCK_SVN) export $(SERF_URL) $(SERF_SRCDIR); \
 	fi
 	touch $@
 
@@ -663,7 +666,7 @@ serf-old-clean:
 $(SERF_OLD_OBJDIR)/.retrieved:
 	[ -d $(SERF_OLD_OBJDIR) ] || mkdir -p $(SERF_OLD_OBJDIR)
 	if [ ! -d $(SERF_OLD_SRCDIR) ]; then \
-		svn export $(SERF_OLD_URL) $(SERF_OLD_SRCDIR); \
+		$(STOCK_SVN) export $(SERF_OLD_URL) $(SERF_OLD_SRCDIR); \
 	fi
 	touch $@
 
@@ -842,7 +845,7 @@ $(SVN_OBJDIR)/.retrieved:
 		co="co"; \
 	fi; \
 	if [ ! -d $(SVN_WC) ] && [ ! -h $(SVN_WC) ]; then \
-		svn $${co} $(SUBVERSION_REPOS_URL)/$${branchdir} \
+		$(STOCK_SVN) $${co} $(SUBVERSION_REPOS_URL)/$${branchdir} \
 			$(SVN_WC); \
 	fi
 	touch $@

Re: [PATCH] Makefile.svn: Make stock SVN executable configurable

Posted by Ramkumar Ramachandra <ar...@gmail.com>.
Hi Stefan,

Stefan Sperling writes:
> LD_LIBRARY_PATH in the Makefile is only used by targets that are supposed
> to run the executables compiled by the Makefile, and need to *dynamically*
> load some libraries at run time (e.g. bindings) via dlopen().
> 
> This doesn't affect the checkout/export steps at all. They don't set or
> require any special LD_LIBRARY_PATH.

Very odd. When executing from the Makefile script, `svn` kept
complaining about APR not being compiled with threading support
(because it picked up the APR in ~/svn/prefix), but when I executed
the same command plainly from command-line, it worked fine.

> It sounds like you had LD_LIBRARY_PATH set in your environment.
> Why did you have it set? Maybe it's because the Linux runtime linker
> doesn't find the svn libraries installed in ~/svn/prefix otherwise?
> If so, that's not a problem with the Makefile.
> The binaries installed in your home dir should be linked with -rpath
> by libtool to make sure that they find their libraries in the right place.
> Then you won't have to set LD_LIBRARY_PATH at all if all you want to do
> is run an svn trunk binary. If there is anything to fix here, linking
> with -rpath is what you'd need to look at.

Hm, but I didn't have LD_LIBRARY_PATH set. That's what's odd. The
trunk svn works fine -- when I add ~/svn/prefix/svn-trunk/bin to
$PATH, `svn` picks up the right APR and just works.

Thanks for the help in diagnosing the problem -- I'll read a little
more about the Linux linker's behavior and try to find out what the
real problem is.

-- Ram

Re: [PATCH] Makefile.svn: Make stock SVN executable configurable

Posted by Stefan Sperling <st...@elego.de>.
On Sat, Jan 08, 2011 at 05:50:52PM +0530, Ramkumar Ramachandra wrote:
> I had an issue with my stock SVN picking up the APR libraries I'd just
> compiled, because LD_LIBRARY_PATH is set in Makefile.svn in several
> places. Stock SVN (Debian) was compiled with threading support, and
> the compiled APR was compiled without it- hence nothing worked, and I
> had to execute `svn export`, `svn co` by hand.

LD_LIBRARY_PATH in the Makefile is only used by targets that are supposed
to run the executables compiled by the Makefile, and need to *dynamically*
load some libraries at run time (e.g. bindings) via dlopen().

This doesn't affect the checkout/export steps at all. They don't set or
require any special LD_LIBRARY_PATH.

It sounds like you had LD_LIBRARY_PATH set in your environment.
Why did you have it set? Maybe it's because the Linux runtime linker
doesn't find the svn libraries installed in ~/svn/prefix otherwise?
If so, that's not a problem with the Makefile.
The binaries installed in your home dir should be linked with -rpath
by libtool to make sure that they find their libraries in the right place.
Then you won't have to set LD_LIBRARY_PATH at all if all you want to do
is run an svn trunk binary. If there is anything to fix here, linking
with -rpath is what you'd need to look at.

Stefan

Re: [PATCH] Makefile.svn: Make stock SVN executable configurable

Posted by Ramkumar Ramachandra <ar...@gmail.com>.
Hi Daniel,

Daniel Shahaf writes:
> What problem does this fix?

I had an issue with my stock SVN picking up the APR libraries I'd just
compiled, because LD_LIBRARY_PATH is set in Makefile.svn in several
places. Stock SVN (Debian) was compiled with threading support, and
the compiled APR was compiled without it- hence nothing worked, and I
had to execute `svn export`, `svn co` by hand.

-- Ram

Re: [PATCH] Makefile.svn: Make stock SVN executable configurable

Posted by Daniel Shahaf <d....@daniel.shahaf.name>.
[ moving stsp to bcc ]

What problem does this fix?

Ramkumar Ramachandra wrote on Sat, Jan 08, 2011 at 14:33:46 +0530:
> [[[
> Makefile.svn: Make stock SVN binary configurable
> 
> * tools/dev/unix-build/Makefile.svn: Introduce a new variable
>   $STOCK_SVN that defaults to `env LD_LIBRARY_PATH= svn`. Change
>   references to `svn export` and `svn co` to use $STOCK_SVN.
> ]]]
> 
> Index: tools/dev/unix-build/Makefile.svn
> ===================================================================
> --- tools/dev/unix-build/Makefile.svn	(revision 1056662)
> +++ tools/dev/unix-build/Makefile.svn	(working copy)
> @@ -10,6 +10,9 @@ ENABLE_JAVA_BINDINGS ?= no # they don't build with
>  USE_APR_ICONV ?= no # set to yes to use APR iconv instead of GNU iconv
>  PARALLEL ?= PARALLEL=1 CLEANUP=1
>  
> +# Assumes that `svn` is in $PATH and uses distribution APR libraries
> +STOCK_SVN	= env LD_LIBRARY_PATH= svn
> +
>  PWD		= $(shell pwd)
>  UNAME		= $(shell uname)
>  
> @@ -230,7 +233,7 @@ apr-clean:
>  $(APR_OBJDIR)/.retrieved:
>  	[ -d $(APR_OBJDIR) ] || mkdir -p $(APR_OBJDIR)
>  	if [ ! -d $(APR_SRCDIR) ]; then \
> -		svn export $(APR_URL)/tags/$(APR_VER)/ $(APR_SRCDIR); \
> +		$(STOCK_SVN) export $(APR_URL)/tags/$(APR_VER)/ $(APR_SRCDIR); \
>  	fi
>  	touch $@
>  
> @@ -426,7 +429,7 @@ apr-util-clean:
>  $(APR_UTIL_OBJDIR)/.retrieved:
>  	[ -d $(APR_UTIL_OBJDIR) ] || mkdir -p $(APR_UTIL_OBJDIR)
>  	if [ ! -d $(APR_UTIL_SRCDIR) ]; then \
> -		svn export $(APR_UTIL_URL)/tags/$(APR_UTIL_VER)/ \
> +		$(STOCK_SVN) export $(APR_UTIL_URL)/tags/$(APR_UTIL_VER)/ \
>  			$(APR_UTIL_SRCDIR); \
>  	fi
>  	touch $@
> @@ -622,7 +625,7 @@ serf-clean:
>  $(SERF_OBJDIR)/.retrieved:
>  	[ -d $(SERF_OBJDIR) ] || mkdir -p $(SERF_OBJDIR)
>  	if [ ! -d $(SERF_SRCDIR) ]; then \
> -		svn export $(SERF_URL) $(SERF_SRCDIR); \
> +		$(STOCK_SVN) export $(SERF_URL) $(SERF_SRCDIR); \
>  	fi
>  	touch $@
>  
> @@ -663,7 +666,7 @@ serf-old-clean:
>  $(SERF_OLD_OBJDIR)/.retrieved:
>  	[ -d $(SERF_OLD_OBJDIR) ] || mkdir -p $(SERF_OLD_OBJDIR)
>  	if [ ! -d $(SERF_OLD_SRCDIR) ]; then \
> -		svn export $(SERF_OLD_URL) $(SERF_OLD_SRCDIR); \
> +		$(STOCK_SVN) export $(SERF_OLD_URL) $(SERF_OLD_SRCDIR); \
>  	fi
>  	touch $@
>  
> @@ -842,7 +845,7 @@ $(SVN_OBJDIR)/.retrieved:
>  		co="co"; \
>  	fi; \
>  	if [ ! -d $(SVN_WC) ] && [ ! -h $(SVN_WC) ]; then \
> -		svn $${co} $(SUBVERSION_REPOS_URL)/$${branchdir} \
> +		$(STOCK_SVN) $${co} $(SUBVERSION_REPOS_URL)/$${branchdir} \
>  			$(SVN_WC); \
>  	fi
>  	touch $@

Re: [PATCH] Makefile.svn: Make stock SVN executable configurable

Posted by Ramkumar Ramachandra <ar...@gmail.com>.
Hi Stefan,

Stefan Sperling writes:
> On Sat, Jan 08, 2011 at 02:33:46PM +0530, Ramkumar Ramachandra wrote:
> > [[[
> > Makefile.svn: Make stock SVN binary configurable
> > 
> > * tools/dev/unix-build/Makefile.svn: Introduce a new variable
> >   $STOCK_SVN that defaults to `env LD_LIBRARY_PATH= svn`. Change
> >   references to `svn export` and `svn co` to use $STOCK_SVN.
> > ]]]
> 
> Hi Ram,
> 
> Why don't you just put the svn binary you want to run into the
> first entry of $PATH?

I did that, but it still doesn't solve the problem*: It picks up the
wrong APR libraries because Makefile.svn sets LD_LIBRARY_PATH in
several places.

* Actually I encountered the problem before I had a compiled version
  of SVN. I'd only just compiled the APR libraries.

-- Ram

Re: [PATCH] Makefile.svn: Make stock SVN executable configurable

Posted by Stefan Sperling <st...@elego.de>.
On Sat, Jan 08, 2011 at 02:33:46PM +0530, Ramkumar Ramachandra wrote:
> [[[
> Makefile.svn: Make stock SVN binary configurable
> 
> * tools/dev/unix-build/Makefile.svn: Introduce a new variable
>   $STOCK_SVN that defaults to `env LD_LIBRARY_PATH= svn`. Change
>   references to `svn export` and `svn co` to use $STOCK_SVN.
> ]]]

Hi Ram,

Why don't you just put the svn binary you want to run into the
first entry of $PATH?

Stefan