Subversion does not run after SQLite was changed to keg_only on 10.6.8 #17172

Closed
michaellopez opened this Issue Jan 18, 2013 · 21 comments

6 participants

@michaellopez

After brew update and brew upgrade today subversion does not run anymore.

$ svn --version
dyld: Library not loaded: /usr/local/lib/libsqlite3.0.8.6.dylib
  Referenced from: /usr/local/lib/libserf-1.0.0.0.dylib
  Reason: image not found
Trace/BPT trap

I tracked it to #17005 and I think that the keg_only change is the cause. The reason is that after running brew link sqlite the svn command runs just fine.

Gist: https://gist.github.com/4564921

@samueljohn

Thanks, did you already brew rm sqlite svn and then brew install svn?

@michaellopez

@samueljohn Yeah, the gist is copy/paste from terminal from the second time I ran it, with the HOMEBREW_MAKE_JOBS=1 VERBOSE=1 part. svn command was still broken unfortunately.

@samueljohn

Is your brew doctor happy?

@michaellopez

It complains about my NTFS-3G installation. But most likely that won't affect this issue as brew and all my formulae have worked and brew link sqlite is a workaround.

I followed the guidelines, my brew doctor output is in the gist

@samueljohn

Okay, the NTFS-3G should not be the problem here.

@adamv

What does which svn and otool -L $(which svn) give you?

@adamv

Wait, never mind above.

$ brew deps svn
neon
pkg-config
readline
serf
sqlite

Try brew rm svn serf neon and then reinstall svn.

@samueljohn

Thing is I can't reproduce.

@michaellopez

@adamv Thank you, running brew rm svn serf neon and then brew install svn solves it for me!

@Sharpie

The problem isn't coming from SVN, it is coming from serf:

 Referenced from: /usr/local/lib/libserf-1.0.0.0.dylib

It loos like we don't list SQLite as a serf dependency:

➜  ~  brew deps serf
libtool

This could be a problem if serf links against the system SQLite but SVN links against the keg-only SQLite. This begs the question: does SVN really need a newer SQLite than OS X provides? I can't find anything in the logs that gives the reasoning behind using our SQLite and SVN was built against the system version at one time: 800f03b.

@adamv

MacPorts doesn't list sqlite as a dep for serf either...

@adamv

But doing a brew install -v serf shows it is adding -lsqlite3 to its libs.

@adamv

...and linking to the system Sqlite. Jeez.

@Sharpie

And as far as ack can tell, no piece of serf code is calling a function beginning with sqlite3_ which is very curious.

@Sharpie

...and linking to the system Sqlite. Jeez.

Well, it would now that Homebrew SQLite is keg-only and not listed as a dep.

@adamv adamv reopened this Jan 18, 2013
@adamv

Does this have something to do with how apr works?

@Sharpie

From apu-1-config:

➜  serf-1.1.1  apu-1-config --libs
-lldap -llber -llber    -lexpat -liconv    -lsqlite3        -lldap -llber -llber

Which looks like it gets rolled into the serf build (tough to tell as serf has a bit of a wonky custom buildsystem):

self.LIBS = self.apu.get_value(None, '--link-libtool') \                    
                + ' ' + self.apu.get_value(None, '--libs') \                    
                + ' ' + self.apr.get_value(None, '--link-libtool') \            
                + ' ' + self.apr.get_value(None, '--libs') \                    
                + ' -lz'

As an aside, isn't there a linker option that can be invoked such that dylibs won't be linked unless the object code used to create a dylib or executable actually needs functions from the external lib?

@adamv

Might add sqlite as a build-time dep for serf in the meantime.

@adamv

(I'm not opposed to having svn link against system sqlite, if that works on all supported platforms.)

@adamv adamv added a commit that closed this issue Jan 22, 2013
@adamv adamv serf: depend on sqlite
apr-util will add a linkage to sqlite, even though serf doesn't use it
(from what I can tell). But when serf is linked with subversion, they
need to reference the same sqlite or bad things happen.

Closes #17172.
6b339a7
@adamv adamv closed this in 6b339a7 Jan 22, 2013
@norioxkimura norioxkimura added a commit to norioxkimura/homebrew that referenced this issue Jan 26, 2013
@adamv adamv serf: depend on sqlite
apr-util will add a linkage to sqlite, even though serf doesn't use it
(from what I can tell). But when serf is linked with subversion, they
need to reference the same sqlite or bad things happen.

Closes #17172.
6e4e748
@rajeeja rajeeja pushed a commit that referenced this issue Apr 19, 2013
@adamv adamv serf: depend on sqlite
apr-util will add a linkage to sqlite, even though serf doesn't use it
(from what I can tell). But when serf is linked with subversion, they
need to reference the same sqlite or bad things happen.

Closes #17172.
8d51b0e
@bitboxer

I had that problem today. Fixed it with adding --build-from-source to install subversion on my machine.

@xu-cheng xu-cheng locked and limited conversation to collaborators Feb 16, 2016
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.