Re: [PATCH v4 01/16] add util/search-path.{c, h} to test for executables in $PATH
[notmuch-archives.git] / cc / 62f9d8913cb816c72a884959fda2b4da624bca
1 Return-Path: <nate4d@gmail.com>\r
2 X-Original-To: notmuch@notmuchmail.org\r
3 Delivered-To: notmuch@notmuchmail.org\r
4 Received: from localhost (localhost [127.0.0.1])\r
5  by arlo.cworth.org (Postfix) with ESMTP id BE0DD6DE17AA\r
6  for <notmuch@notmuchmail.org>; Fri,  5 Jun 2015 12:26:22 -0700 (PDT)\r
7 X-Virus-Scanned: Debian amavisd-new at cworth.org\r
8 X-Spam-Flag: NO\r
9 X-Spam-Score: -0.39\r
10 X-Spam-Level: \r
11 X-Spam-Status: No, score=-0.39 tagged_above=-999 required=5 tests=[AWL=0.310, \r
12  DKIM_SIGNED=0.1, DKIM_VALID=-0.1, FREEMAIL_FROM=0.001,\r
13  RCVD_IN_DNSWL_LOW=-0.7, RCVD_IN_MSPIKE_H3=-0.01,\r
14  RCVD_IN_MSPIKE_WL=-0.01, SPF_PASS=-0.001,\r
15  T_FREEMAIL_FORGED_FROMDOMAIN=0.01,\r
16  T_HEADER_FROM_DIFFERENT_DOMAINS=0.01] autolearn=disabled\r
17 Received: from arlo.cworth.org ([127.0.0.1])\r
18  by localhost (arlo.cworth.org [127.0.0.1]) (amavisd-new, port 10024)\r
19  with ESMTP id Z0fmDocnZIqY for <notmuch@notmuchmail.org>;\r
20  Fri,  5 Jun 2015 12:26:20 -0700 (PDT)\r
21 Received: from mail-qc0-f181.google.com (mail-qc0-f181.google.com\r
22  [209.85.216.181])\r
23  by arlo.cworth.org (Postfix) with ESMTPS id 172626DE1733\r
24  for <notmuch@notmuchmail.org>; Fri,  5 Jun 2015 12:26:20 -0700 (PDT)\r
25 Received: by qczw4 with SMTP id w4so33601742qcz.2\r
26  for <notmuch@notmuchmail.org>; Fri, 05 Jun 2015 12:26:19 -0700 (PDT)\r
27 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113;\r
28  h=sender:subject:mime-version:content-type:from:in-reply-to:date:cc\r
29  :content-transfer-encoding:message-id:references:to;\r
30  bh=R5CmlM0BUcfN18T4nbLDyBOVMajlcecFvvYis9SGaQg=;\r
31  b=ZK20pjukiEs3FzEs2YOmhabMr/8bi8rJEva9+dnPxR/gMJGg/6D8gdyr6lKK3yHGye\r
32  QyyRFajSKl6ON8HvdQlxKKipyyn5wcazkmurGyfFJita9b5nek6GU80begMfuXSZjYPn\r
33  kzT9ebIO2v07eZHsVfyXW3ZYvWysGccTPVFGoKcMd5QXqAY6SneuZ8YBzVtJMAJCzo26\r
34  kis+BgshH1WWZWn1JFuCNdBNI7145b5qkTWEr0fp3gv3EcxMYr3h1ak4955Mvt5qYhIA\r
35  NiW1lIgOpsdwW8fhqStliEx7RMPFfkmrONWLdhmyyXme+lfK6qwjKhJx753E4pTBW41P\r
36  ucpA==\r
37 X-Received: by 10.229.211.131 with SMTP id go3mr6231256qcb.18.1433532377973;\r
38  Fri, 05 Jun 2015 12:26:17 -0700 (PDT)\r
39 Received: from [10.46.105.28] ([70.42.157.61])\r
40  by mx.google.com with ESMTPSA id k71sm4363746qhc.42.2015.06.05.12.26.15\r
41  (version=TLSv1 cipher=RC4-SHA bits=128/128);\r
42  Fri, 05 Jun 2015 12:26:16 -0700 (PDT)\r
43 Sender: Nathan Eagleson <nate4d@gmail.com>\r
44 Subject: Re: build failures on Mac OS X 10.6.8 - diagnosis\r
45 Mime-Version: 1.0 (Apple Message framework v1085)\r
46 Content-Type: text/plain; charset=us-ascii\r
47 From: Nate Eagleson <nate@nateeag.com>\r
48 In-Reply-To: <m21thtib56.fsf@guru.guru-group.fi>\r
49 Date: Fri, 5 Jun 2015 15:26:11 -0400\r
50 Content-Transfer-Encoding: quoted-printable\r
51 Message-Id: <0C7BAABC-5AC3-4D6E-AD5D-2420918588C4@nateeag.com>\r
52 References: <7156CF8E-BE69-48C0-ACB8-88C7E68CD4BB@nateeag.com>\r
53  <m21thtib56.fsf@guru.guru-group.fi>\r
54 To: Tomi Ollila <tomi.ollila@iki.fi>\r
55 X-Mailer: Apple Mail (2.1085)\r
56 Cc: notmuch@notmuchmail.org\r
57 X-BeenThere: notmuch@notmuchmail.org\r
58 X-Mailman-Version: 2.1.18\r
59 Precedence: list\r
60 List-Id: "Use and development of the notmuch mail system."\r
61  <notmuch.notmuchmail.org>\r
62 List-Unsubscribe: <http://notmuchmail.org/mailman/options/notmuch>,\r
63  <mailto:notmuch-request@notmuchmail.org?subject=unsubscribe>\r
64 List-Archive: <http://notmuchmail.org/pipermail/notmuch/>\r
65 List-Post: <mailto:notmuch@notmuchmail.org>\r
66 List-Help: <mailto:notmuch-request@notmuchmail.org?subject=help>\r
67 List-Subscribe: <http://notmuchmail.org/mailman/listinfo/notmuch>,\r
68  <mailto:notmuch-request@notmuchmail.org?subject=subscribe>\r
69 X-List-Received-Date: Fri, 05 Jun 2015 19:26:22 -0000\r
70 \r
71 \r
72 On Jun 3, 2015, at 2:00 AM, Tomi Ollila wrote:\r
73 \r
74 > On Tue, Jun 02 2015, Nate Eagleson <nate@nateeag.com> wrote:\r
75 >=20\r
76 >> Hi folks,\r
77 >>=20\r
78 >> I'm trying to move from Apple's Mail.app in favor of =\r
79 offlineimap/notmuch,\r
80 >> but I've run into a build failure on Mac OS X 10.6.8.\r
81 >>=20\r
82 >> The failure was reported on this list a few months ago, but no\r
83 >> explanation or solution was found:\r
84 >>=20\r
85 >> http://notmuchmail.org/pipermail/notmuch/2015/020531.html\r
86 >>=20\r
87 >> By appending `-Wl,-t` to `FINAL_NOTMUCH_LDFLAGS` in Makefile.local, I\r
88 >> got 10.6.8's ld to dump the list of archives and dylibs that are =\r
89 being\r
90 >> linked in the failed compile.\r
91 >>=20\r
92 >> That list includes `/usr/lib/libutil.dylib`, but not notmuch's =\r
93 built-in\r
94 >> `util/libutil.a`.\r
95 >>=20\r
96 >> I have not found a sane way to tell 10.6.8's ld to prefer libutil.a =\r
97 over\r
98 >> libutil.dylib.\r
99 >>=20\r
100 >> My first thought was that there should be an option to prefer =\r
101 archives over\r
102 >> dylibs, but that does not seem to exist in 10.6.8's version of ld.\r
103 >>=20\r
104 >> Instead, people are recommending absolute paths when you need to link =\r
105 an\r
106 >> archive file in preference to existing dylibs:\r
107 >>=20\r
108 >> =\r
109 http://lists.apple.com/archives/darwin-development/2003/Sep/msg00008.html\r
110 >> http://stackoverflow.com/questions/844819/how-to-static-link-on-os-x\r
111 >>=20\r
112 >> As a simple test, I hardcoded an absolute path to libutil in\r
113 >> FINAL_NOTMUCH_LDFLAGS, and the compile succeeded.\r
114 >>=20\r
115 >> So, it seems like getting the path to the Makefile's parent directory =\r
116 and\r
117 >> using it to specify an absolute path to libutil.a would address this\r
118 >> issue without introducing new ones.\r
119 >>=20\r
120 >> Does this sound like a sane solution? Would a patch to do this be\r
121 >> accepted?\r
122 >=20\r
123 > Now that I look at this, I think that having full path to =\r
124 util/libutil.a\r
125 > should be used (everywhere) and if there is need to use =\r
126 *system-provided*\r
127 > libutil, then -lutil is to be added to the command line...\r
128 >=20\r
129 > ... I think it is somewhat unfortunate (or confusing) to have the =\r
130 library\r
131 > named as such, and perhaps better naming should have been used, but =\r
132 (*)\r
133 >=20\r
134 > (*) http://martinfowler.com/bliki/TwoHardThings.html\r
135 \r
136 Yep, that all makes sense. ...especially the naming quandary.\r
137 \r
138 >> If not, what would be a better way to solve this?\r
139 >=20\r
140 > Actually you could check how homebrew etc. solve this problem (or if =\r
141 there\r
142 > is any) to come with other ideas...\r
143 \r
144 My little research project started when I ran `brew install notmuch` and =\r
145 got this\r
146 failure. If there is a better solution, the homebrew folks don't have =\r
147 it.\r
148 \r
149 so, rename the local library, or use an absolute path to it during =\r
150 builds?\r
151 \r
152 The latter feels slightly more robust to me, since it completely =\r
153 precludes name collisions.=20\r
154 Though if we add 'notmuch' to the lib name, name collisions seem pretty =\r
155 unlikely.\r
156 \r
157 If no one else adds any comments in the next day or two, I'll submit a =\r
158 patch adding the absolute path behavior.\r
159 \r
160 -Nate\r
161 \r