BUG: bad notmuch shared library install_name on Mac OS X
J. Lewis Muir
jlmuir at imca-cat.org
Fri Sep 5 05:47:05 PDT 2014
On 9/4/14, 2:58 PM, David Bremner wrote:
> "J. Lewis Muir" <jlmuir at imca-cat.org> writes:
>
>> Hello.
>>
>> I submitted a patch [1] to fix a bug in how the notmuch shared
>> library is built on Mac OS X, but perhaps it's not clear it fixes a
>> bug, so I wanted to just request it be tagged as a bug for nmbug.
>
> Done, at least twice (waves to Jani).
Hi, David.
Great! Thanks!
> The usual problem we have with OS/X patches is finding somebody to
> review them.
OK. I guess I can't help there, but the commit message does give short
instructions for how to reproduce the problem, so hopefully someone will
be able to review it.
> It's a little surprising to me that it was completely
> broken before, since there have been people using notmuch on OS/X.
Right. I wonder if most people using notmuch on Mac OS X do so via
Homebrew or MacPorts. In this case, they would never encounter the
problem because notmuch has already been packaged for them.
Both Homebrew and MacPorts address the problem but in different ways.
Homebrew uses install_name_tool to correct the install_name on the
shared library post install. Homebrew actually does this automatically
for all libraries (i.e. via fix_install_names) [1][2], so even the
package maintainer might never see the problem, and the formula has no
patch or indication of a needed install_name fix [3].
I don't think MacPorts automatically fixes install_name problems, hence
its notmuch port does apply a patch [4][5] that is exactly the same as
what I submitted.
I checked Fink, but it does not appear to have a notmuch package.
Personally, I use Pkgsrc, and it did not have this patch for its notmuch
package, but I submitted it, and it has recently been committed to the
-current tree [6].
Another possibility is that people running notmuch on Mac OS X may set
DYLD_LIBRARY_PATH [7] in their environment to point to where their
libraries are installed. If this contains the path where the notmuch
shared library is installed, then the notmuch binary would be able to
find the notmuch shared library even if its install_name is not a full
path. But this should definitely not be a requirement for running a
program; I think DYLD_LIBRARY_PATH should only be used in development.
Thanks!
Lewis
[1] https://github.com/Homebrew/homebrew/blob/master/Library/Homebrew/formula_installer.rb
[2] https://github.com/Homebrew/homebrew/blob/master/Library/Homebrew/keg_fix_install_names.rb
[3] https://github.com/Homebrew/homebrew/blob/master/Library/Formula/notmuch.rb
[4] https://trac.macports.org/browser/trunk/dports/mail/notmuch/Portfile
[5] https://trac.macports.org/browser/trunk/dports/mail/notmuch/files/patch-lib-Makefile.local.diff
[6] http://cvsweb.netbsd.org/bsdweb.cgi/pkgsrc/mail/notmuch/patches/patch-lib_Makefile.local?rev=1.1&content-type=text/x-cvsweb-markup&only_with_tag=MAIN
[7] https://developer.apple.com/library/mac/documentation/Darwin/Reference/ManPages/man1/dyld.1.html
More information about the notmuch
mailing list