Return-Path: X-Original-To: notmuch@notmuchmail.org Delivered-To: notmuch@notmuchmail.org Received: from localhost (localhost [127.0.0.1]) by olra.theworths.org (Postfix) with ESMTP id 1738A431FB6 for ; Fri, 5 Sep 2014 05:47:16 -0700 (PDT) X-Virus-Scanned: Debian amavisd-new at olra.theworths.org X-Spam-Flag: NO X-Spam-Score: 0 X-Spam-Level: X-Spam-Status: No, score=0 tagged_above=-999 required=5 tests=[none] autolearn=disabled Received: from olra.theworths.org ([127.0.0.1]) by localhost (olra.theworths.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id NrDoXns8A7Tt for ; Fri, 5 Sep 2014 05:47:08 -0700 (PDT) Received: from tuna.imca.aps.anl.gov (tuna.imca.aps.anl.gov [164.54.200.33]) by olra.theworths.org (Postfix) with ESMTP id 395A2431FAF for ; Fri, 5 Sep 2014 05:47:08 -0700 (PDT) Received: from bass.imca.aps.anl.gov (bass.imca.aps.anl.gov [164.54.200.38]) by tuna.imca.aps.anl.gov (Postfix) with SMTP id 019442005F for ; Fri, 5 Sep 2014 07:47:05 -0500 (CDT) Received: (qmail 9258 invoked by uid 502); 5 Sep 2014 12:47:05 -0000 Date: Fri, 5 Sep 2014 07:47:05 -0500 From: "J. Lewis Muir" To: David Bremner Subject: Re: BUG: bad notmuch shared library install_name on Mac OS X Message-ID: <20140905124705.GA9173@bass.imca.aps.anl.gov> References: <54089FBC.20404@imca-cat.org> <87wq9jtawy.fsf@maritornes.cs.unb.ca> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <87wq9jtawy.fsf@maritornes.cs.unb.ca> Cc: notmuch@notmuchmail.org X-BeenThere: notmuch@notmuchmail.org X-Mailman-Version: 2.1.13 Precedence: list List-Id: "Use and development of the notmuch mail system." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 05 Sep 2014 12:47:16 -0000 On 9/4/14, 2:58 PM, David Bremner wrote: > "J. Lewis Muir" 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