From: "J. Lewis Muir" <jlmuir@imca-cat.org>
To: David Bremner <david@tethera.net>
Cc: notmuch@notmuchmail.org
Subject: Re: [PATCH] lib: make notmuch shared library install_name be full path on Mac OS X
Date: Thu, 26 Feb 2015 12:14:23 -0600 [thread overview]
Message-ID: <20150226181423.GA2822@bass.imca.aps.anl.gov> (raw)
In-Reply-To: <87twyao35q.fsf@maritornes.cs.unb.ca>
On 2/25/15 1:34 AM, David Bremner wrote:
> Unfortunately we did not receive any feedback from Mac users in the
> meantime. It would be nice to know that your patch won't break the
> existing macports and brew packages. I suppose that those work
> because they install the libraries into a well known location.
Hi, David.
I just tried installing to /usr/local (now on OS X Yosemite 10.10.2),
and you're right about that; it appears that because it's a standard
location, it works without my patch. Looking at the dyld(1) man page,
it says the following for the DYLD_FALLBACK_LIBRARY_PATH environment
variable (and I think the fact that /usr/local/lib is in the default
list is the reason why it works without the patch):
This is a colon separated list of directories that contain
libraries. It is used as the default location for libraries
not found in their install path. By default, it is set to
$(HOME)/lib:/usr/local/lib:/lib:/usr/lib.
However, if I install to /opt, it does *not* work without my patch. So,
I'm still confident that the patch is correct and needed.
The reason it works in Homebrew is twofold. One, assuming Homebrew
installs packages to /usr/local, the dynamic linker finds the notmuch
library in /usr/local/lib because it's in the default list of locations
that the dynamic linker looks for libraries. Two, Homebrew globally
corrects all install names in dynamically shared libraries and binaries
for all packages. So, even if the package is broken, Homebrew corrects
it automatically, and no one ever knows.
The reason it works in MacPorts is because they apply a patch that's the
same as what I submitted! See:
https://trac.macports.org/browser/trunk/dports/mail/notmuch/files/patch-lib-Makefile.local.diff
For any OS X notmuch developer willing to test this, here are
the five commands to run to reproduce the problem (note: another
libnotmuch*.dylib must *not* be in /usr/local/lib where it would
be found automatically by the dynamic linker; similarly, no DYLD_*
environment variables should be set for this test; obviously, change the
CFLAGS and LDFLAGS environment variables in the ./configure command to
point to where the libraries are that notmuch needs):
===
$ git clone git://notmuchmail.org/git/notmuch
$ CFLAGS='-I/pkg/include' LDFLAGS='-L/pkg/lib' ./configure --prefix=/opt --without-emacs
$ make
$ make install
$ /opt/bin/notmuch --version
===
When I run the just-installed notmuch in that last command, it produces
the following output:
===
dyld: Library not loaded: libnotmuch.4.dylib
Referenced from: /opt/bin/notmuch
Reason: image not found
Trace/BPT trap: 5 (core dumped)
===
Regards,
Lewis
next prev parent reply other threads:[~2015-02-26 18:20 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-09-01 3:13 [PATCH] lib: make notmuch shared library install_name be full path on Mac OS X J. Lewis Muir
2015-02-25 7:34 ` David Bremner
2015-02-26 18:14 ` J. Lewis Muir [this message]
2015-02-26 19:04 ` Tomi Ollila
2015-03-04 18:23 ` J. Lewis Muir
2015-03-04 20:45 ` David Bremner
2015-02-27 8:24 ` David Bremner
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
List information: https://notmuchmail.org/
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20150226181423.GA2822@bass.imca.aps.anl.gov \
--to=jlmuir@imca-cat.org \
--cc=david@tethera.net \
--cc=notmuch@notmuchmail.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
Code repositories for project(s) associated with this public inbox
https://yhetil.org/notmuch.git/
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).