Skip Menu |

Preferred bug tracker

Please visit the preferred bug tracker to report your issue.

This queue is for tickets about the Alien-SVN CPAN distribution.

Report information
The Basics
Id: 60490
Status: open
Priority: 0/
Queue: Alien-SVN

People
Owner: Nobody in particular
Requestors: mschwern [...] cpan.org
Cc:
AdminCc:

Bug Information
Severity: Wishlist
Broken in: 1.6.12.0
Fixed in: (no value)



Subject: Check if there's already an SVN library installed and use that
People have requested that Alien::SVN use existing installed Subversion libraries. Makes sense, as Alien modules are less about installing the alien library in question as making sure its installed and of a high enough version. But don't ask me how to do it.
On Wed Aug 18 18:32:59 2010, MSCHWERN wrote: Show quoted text
> People have requested that Alien::SVN use existing installed Subversion > libraries. Makes sense, as Alien modules are less about installing the > alien library in question as making sure its installed and of a high > enough version. > > But don't ask me how to do it.
I'm not sure that Alien::SVN has ever used anything other than existing installed Subversion libraries. From what I can tell, the Subversion SWIG bindings do not know how to find a .so file in a non-standard location. To get them to find .so files within the Perl module tree, I had to apply the attached patch. To verify that the existing system is not using the custom-compiled Subversion, try hiding /usr/lib/libsvn_client-1.so.0 and then perform the following command: strace perl -MSVN::Client -e1 2>&1 | grep open That will show you all the places that the dynamic loader is looking for libsvn_client-1.so.0, which will include a bunch of dirs where the library was built, but not the dir where the .so files were installed. It was a colleague of mine who had the original insight to perform an strace. I then hacked until we managed to get the proper dir in to the search path. I doubt that the patch uses best practices for passing arguments from a top-level Build.PL to a Makefile.PL in a subdirectory, but it should be enough to convey the idea. Cheers, Marvin Humphrey
Subject: alien_svn_fix.patch
diff -ur Alien-SVN-1.6.12.0.old/inc/My/SVN/Builder.pm Alien-SVN-1.6.12.0/inc/My/SVN/Builder.pm --- Alien-SVN-1.6.12.0.old/inc/My/SVN/Builder.pm 2010-08-17 23:08:53.000000000 -0700 +++ Alien-SVN-1.6.12.0/inc/My/SVN/Builder.pm 2010-11-29 16:38:26.000000000 -0800 @@ -77,6 +77,10 @@ $mm_args{$build_to_makemaker{$key}} = $value; } + + $mm_args{ALIEN_DIR} = File::Spec->catdir( + $self->install_destination('arch'), 'Alien', 'SVN'); + return map { "$_=$mm_args{$_}" } keys %mm_args; } diff -ur Alien-SVN-1.6.12.0.old/src/subversion/subversion/bindings/swig/perl/native/Makefile.PL.in Alien-SVN-1.6.12.0/src/subversion/subversion/bindings/swig/perl/native/Makefile.PL.in --- Alien-SVN-1.6.12.0.old/src/subversion/subversion/bindings/swig/perl/native/Makefile.PL.in 2010-08-17 23:08:49.000000000 -0700 +++ Alien-SVN-1.6.12.0/src/subversion/subversion/bindings/swig/perl/native/Makefile.PL.in 2010-11-29 16:37:13.000000000 -0800 @@ -3,6 +3,13 @@ use Config; use Cwd 'abs_path'; +my $alien_dir; +for my $arg (@ARGV) { + next unless $arg =~ /ALIEN_DIR/; + (undef, $alien_dir) = split(/=/, $arg); +} +die "Missing required arg ALIEN_DIR" unless $alien_dir; + my $perl_path = $Config{perlpath}; if ($^O ne 'VMS') { $perl_path .= $Config{_exe} unless $perl_path =~ m/$Config{_exe}$/i; @@ -16,7 +23,8 @@ my $swig_builddir = "${svnlib_builddir}/bindings/swig"; my @modules = qw/client delta fs ra repos wc/; -my @ldpaths = ("$swig_builddir/perl/libsvn_swig_perl/.libs", +my @ldpaths = ($alien_dir, + "$swig_builddir/perl/libsvn_swig_perl/.libs", map {"$svnlib_builddir/libsvn_$_/.libs"} (@modules, qw/diff subr ra_local ra_svn
Subject: Re: [rt.cpan.org #60490] Check if there's already an SVN library installed and use that
Date: Thu, 02 Dec 2010 23:59:47 +1100
To: bug-Alien-SVN [...] rt.cpan.org
From: Michael G Schwern <schwern [...] pobox.com>
On 2010.11.30 12:14 PM, Marvin Humphrey via RT wrote: Show quoted text
> <URL: https://rt.cpan.org/Ticket/Display.html?id=60490 > > > On Wed Aug 18 18:32:59 2010, MSCHWERN wrote:
>> People have requested that Alien::SVN use existing installed Subversion >> libraries. Makes sense, as Alien modules are less about installing the >> alien library in question as making sure its installed and of a high >> enough version. >> >> But don't ask me how to do it.
> > I'm not sure that Alien::SVN has ever used anything other than existing > installed Subversion libraries.
It would use the Alien::SVN installed libraries, but it was easily confused by other installed ones. This patch looks like it may have fixed that long standing problem! Show quoted text
>>From what I can tell, the Subversion SWIG bindings do not know how to find a
> .so file in a non-standard location.
Yeah, I'd always assumed they did. -- 124. Two drink limit does not mean first and last. -- The 213 Things Skippy Is No Longer Allowed To Do In The U.S. Army http://skippyslist.com/list/
Show quoted text
> It would use the Alien::SVN installed libraries, but it was > easily confused by other installed ones.
Our belief is that it would load the newly compiled shared libraries during building and testing, and then it would continue to load those same files once installed -- but from the build directory, not the installation directory. Once the build directory gets zapped, the load mechanism follows the rest of the LD search path (which was set at compile time). This search path does not include the location underneath the Perl arch dirs where the compiled .so files were installed, so we don't believe those copies were ever accessed once installed (at least not on our system). Instead, if you have copies of those shared objects in a standard installation location like /usr/lib, it finds those. If it can't find them anywhere (for instance because you moved libsvn_client.1.0.so out of the way for testing purposes), it gives up. In our case, the version in /usr/lib was not compatible with the version distributed with SVN, and caused a segfault on load. The first symptom was that root was able to use SVN::Client properly, but any other user would get a segfault. That's because root was the one that built Alien::SVN and was still able to see the build directory and load shared objects from there, but other users didn't have permission to access that directory and would get the incompatible version in /usr/lib and blow up. Note that all this happens outside the Perl XS load mechanism. When you use the Perl module SVN::Client, it tries to load the SWIG XS shared object for SVN::_Core, _Core.so. It finds that successfully, but then the dl_load_file() call dispatches to the C dynamic loader to get libsvn_client-1.0.so -- and that loader knows nothing about Perl's @INC. The solution was to prepend the non-standard installation directory to the LD search path which gets baked into _Core.so at build time. Show quoted text
> This patch looks like it may have fixed that long standing > problem!
Excellent. :) Show quoted text
> > From what I can tell, the Subversion SWIG bindings do not > > know how to find a .so file in a non-standard location.
> > Yeah, I'd always assumed they did.
I would have assumed the same thing. It seems like a non-standard install location would be a common usage pattern. It took me a while to figure out that there were no provisions made for that in that Makefile.PL.in!
Yeah, this one is kind of annoying on the Win32 side. It tries to compile and install SVN, even though it's perfectly fine. I thinking "Dude, just type in svn on the CLI. It's right THERE!" I have TortoiseSVN installed and the svn binary is right there. I think all it would need to install in that case is the Perl modules. Do the Perl modules have their own standard Perl distro install within this distro, or is it all built into the C compiler Makefile? It would be nice to just separate this out.