Re: [PATCH 0/4] Allow specifying alternate names for addresses in other_email
[notmuch-archives.git] / 27 / ea1a1014fc12c6f1072216679292384d85292c
1 Return-Path: <amdragon@mit.edu>\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 olra.theworths.org (Postfix) with ESMTP id 0FBBC431FBC\r
6         for <notmuch@notmuchmail.org>; Fri, 14 Feb 2014 13:58:22 -0800 (PST)\r
7 X-Virus-Scanned: Debian amavisd-new at olra.theworths.org\r
8 X-Spam-Flag: NO\r
9 X-Spam-Score: -0.7\r
10 X-Spam-Level: \r
11 X-Spam-Status: No, score=-0.7 tagged_above=-999 required=5\r
12         tests=[RCVD_IN_DNSWL_LOW=-0.7] autolearn=disabled\r
13 Received: from olra.theworths.org ([127.0.0.1])\r
14         by localhost (olra.theworths.org [127.0.0.1]) (amavisd-new, port 10024)\r
15         with ESMTP id gjpk8IRjrILt for <notmuch@notmuchmail.org>;\r
16         Fri, 14 Feb 2014 13:58:15 -0800 (PST)\r
17 Received: from dmz-mailsec-scanner-8.mit.edu (dmz-mailsec-scanner-8.mit.edu\r
18         [18.7.68.37])\r
19         (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits))\r
20         (No client certificate requested)\r
21         by olra.theworths.org (Postfix) with ESMTPS id 89002431FB6\r
22         for <notmuch@notmuchmail.org>; Fri, 14 Feb 2014 13:58:15 -0800 (PST)\r
23 X-AuditID: 12074425-f79906d000000cf9-f0-52fe91760f11\r
24 Received: from mailhub-auth-2.mit.edu ( [18.7.62.36])\r
25         (using TLS with cipher AES256-SHA (256/256 bits))\r
26         (Client did not present a certificate)\r
27         by dmz-mailsec-scanner-8.mit.edu (Symantec Messaging Gateway) with SMTP\r
28         id A0.64.03321.6719EF25; Fri, 14 Feb 2014 16:58:14 -0500 (EST)\r
29 Received: from outgoing.mit.edu (outgoing-auth-1.mit.edu [18.9.28.11])\r
30         by mailhub-auth-2.mit.edu (8.13.8/8.9.2) with ESMTP id s1ELwD5D020593; \r
31         Fri, 14 Feb 2014 16:58:14 -0500\r
32 Received: from awakening.csail.mit.edu (awakening.csail.mit.edu [18.26.4.91])\r
33         (authenticated bits=0)\r
34         (User authenticated as amdragon@ATHENA.MIT.EDU)\r
35         by outgoing.mit.edu (8.13.8/8.12.4) with ESMTP id s1ELwAsw022503\r
36         (version=TLSv1/SSLv3 cipher=DHE-RSA-AES128-SHA bits=128 verify=NOT);\r
37         Fri, 14 Feb 2014 16:58:12 -0500\r
38 Received: from amthrax by awakening.csail.mit.edu with local (Exim 4.80)\r
39         (envelope-from <amdragon@MIT.EDU>)\r
40         id 1WEQlr-0007tC-LY; Fri, 14 Feb 2014 16:58:09 -0500\r
41 Date: Fri, 14 Feb 2014 16:58:07 -0500\r
42 From: Austin Clements <amdragon@MIT.EDU>\r
43 To: Tomi Ollila <tomi.ollila@iki.fi>\r
44 Subject: Re: [PATCH 1/1] emacs: always write emacs/.eldeps when the target is\r
45         remade\r
46 Message-ID: <20140214215736.GD4375@mit.edu>\r
47 References: <1390645309-2326-1-git-send-email-tomi.ollila@iki.fi>\r
48         <20140213071026.GX4375@mit.edu> <m2sirn1nik.fsf@guru.guru-group.fi>\r
49         <20140213074944.GY4375@mit.edu> <m2bny9ebvk.fsf@guru.guru-group.fi>\r
50 MIME-Version: 1.0\r
51 Content-Type: text/plain; charset=us-ascii\r
52 Content-Disposition: inline\r
53 In-Reply-To: <m2bny9ebvk.fsf@guru.guru-group.fi>\r
54 User-Agent: Mutt/1.5.21 (2010-09-15)\r
55 X-Brightmail-Tracker:\r
56  H4sIAAAAAAAAA+NgFmphleLIzCtJLcpLzFFi42IRYrdT0S2b+C/IoOGTssX1mzOZLd6snMfq\r
57         wORx+OtCFo9nq24xBzBFcdmkpOZklqUW6dslcGWc2D+LqeCHfsW0hyuYGxh71boYOTkkBEwk\r
58         ur+dZ4SwxSQu3FvP1sXIxSEkMJtJYv3tNawQzkZGic/7TzNDOKeZJHZf/8sE4SxhlOidPRes\r
59         n0VAVeJ220J2EJtNQENi2/7lYHERARWJB23rWUFsZgFpiW+/m5lAbGGBMImZi0CmcnDwCmhL\r
60         bFjuCjHzItDMn5PYQGp4BQQlTs58wgLRqyVx499LJpB6kDnL/3GAhDkFDCSuHr8OtkoUaNWU\r
61         k9vYJjAKzULSPQtJ9yyE7gWMzKsYZVNyq3RzEzNzilOTdYuTE/PyUot0LfRyM0v0UlNKNzGC\r
62         A9tFdQfjhENKhxgFOBiVeHgldP8FCbEmlhVX5h5ilORgUhLllewCCvEl5adUZiQWZ8QXleak\r
63         Fh9ilOBgVhLh7ckFyvGmJFZWpRblw6SkOViUxHlrLX4FCQmkJ5akZqemFqQWwWRlODiUJHgd\r
64         JgA1ChalpqdWpGXmlCCkmTg4QYbzAA2f3w8yvLggMbc4Mx0if4pRUUqc1wEkIQCSyCjNg+uF\r
65         JZ5XjOJArwjzxoKs4AEmLbjuV0CDmYAGrzr9F2RwSSJCSqqB8ajcw99/Lnpm/V0rNGGZ/vNJ\r
66         Z43ZEtr6rT8dcip+zas0cwbf7MtVHanrZH48lpzZtEyCYYf7veLT+57/7ml/s9byfvZeuf2N\r
67         Ox6VnMvObDA/N13AdcNCodePjlcnXPss8njF1XVJM3TD3fcwXosWC7BZcu/GX7e9yxd6vW1o\r
68         yus73aO+7JrFd0klluKMREMt5qLiRAAE+IpuFwMAAA==\r
69 Cc: notmuch@notmuchmail.org\r
70 X-BeenThere: notmuch@notmuchmail.org\r
71 X-Mailman-Version: 2.1.13\r
72 Precedence: list\r
73 List-Id: "Use and development of the notmuch mail system."\r
74         <notmuch.notmuchmail.org>\r
75 List-Unsubscribe: <http://notmuchmail.org/mailman/options/notmuch>,\r
76         <mailto:notmuch-request@notmuchmail.org?subject=unsubscribe>\r
77 List-Archive: <http://notmuchmail.org/pipermail/notmuch>\r
78 List-Post: <mailto:notmuch@notmuchmail.org>\r
79 List-Help: <mailto:notmuch-request@notmuchmail.org?subject=help>\r
80 List-Subscribe: <http://notmuchmail.org/mailman/listinfo/notmuch>,\r
81         <mailto:notmuch-request@notmuchmail.org?subject=subscribe>\r
82 X-List-Received-Date: Fri, 14 Feb 2014 21:58:22 -0000\r
83 \r
84 Quoth Tomi Ollila on Feb 14 at  9:24 pm:\r
85 > On Thu, Feb 13 2014, Austin Clements <amdragon@MIT.EDU> wrote:\r
86\r
87 > > Quoth Tomi Ollila on Feb 13 at  9:26 am:\r
88 > >> On Thu, Feb 13 2014, Austin Clements <amdragon@MIT.EDU> wrote:\r
89 > >> \r
90 > >> > Quoth Tomi Ollila on Jan 25 at 12:21 pm:\r
91 > >> >> So that the target is newer than its prerequisites.\r
92 > >> >> ---\r
93 > >> >>  emacs/Makefile.local | 3 +--\r
94 > >> >>  1 file changed, 1 insertion(+), 2 deletions(-)\r
95 > >> >> \r
96 > >> >> diff --git a/emacs/Makefile.local b/emacs/Makefile.local\r
97 > >> >> index 42bfbd9..d5d402e 100644\r
98 > >> >> --- a/emacs/Makefile.local\r
99 > >> >> +++ b/emacs/Makefile.local\r
100 > >> >> @@ -32,8 +32,7 @@ emacs_bytecode = $(emacs_sources:.el=.elc)\r
101 > >> >>  ifeq ($(HAVE_EMACS),1)\r
102 > >> >>  $(dir)/.eldeps: $(dir)/Makefile.local $(dir)/make-deps.el $(emacs_sources)\r
103 > >> >>         $(call quiet,EMACS) --directory emacs -batch -l make-deps.el \\r
104 > >> >> -               -f batch-make-deps $(emacs_sources) > $@.tmp && \\r
105 > >> >> -               (cmp -s $@.tmp $@ || mv $@.tmp $@)\r
106 > >> >> +               -f batch-make-deps $(emacs_sources) > $@.tmp && mv $@.tmp $@\r
107 > >> >>  -include $(dir)/.eldeps\r
108 > >> >>  endif\r
109 > >> >>  CLEAN+=$(dir)/.eldeps $(dir)/.eldeps.tmp\r
110 > >> >\r
111 > >> > Is this just so the rule doesn't get run again on the next make\r
112 > >> > invocation (unless, of course, a dependent changed)?\r
113 > >> \r
114 > >> Basically yes. I did multiple builds in rapid succession when developing\r
115 > >> something and this thing confused me quite a lot in the beginning...\r
116 > >> \r
117 > >> > Interestingly, if any of the dependents have changed, but in ways that\r
118 > >> > don't affect .eldeps, this change will make the build more expensive\r
119 > >> > because it will trigger a make restart after .eldeps is updated.\r
120 > >> \r
121 > >> I wondered what was the reason for the recipe you've chosen here, has\r
122 > >> it something to do with inodes or something ;) (and were going to ask\r
123 > >> an alternative to touch (or even : > $@) the target...\r
124 > >> \r
125 > >> ... but now I understand. E.g. change in notmuch-lib.el will cause *all* \r
126 > >> .el files to be re-bytecompiled after this change. \r
127 > >\r
128 > > This is unrelated to the cmp in the recipe.  A change in\r
129 > > notmuch-lib.el *must* cause almost all .el files to be recompiled\r
130 > > because they almost all require it and may use macros from it.  If you\r
131 > > touch, e.g., notmuch-hello.el, you'll see that very little is rebuilt\r
132 > > (with or without this patch).\r
133 > >\r
134 > >> An alternative to this patch would be adding a message to the rule\r
135 > >> which informs user to touch .eldeps to avoid re-doing .eldeps if\r
136 > >> that irritates one :D\r
137 > >> \r
138 > >> something like:\r
139 > >> \r
140 > >> (cmp -s $@.tmp $@ && \\r
141 > >>      echo "touch $@ to avoid redoing this target" || mv $@.tmp $@)\r
142 > >\r
143 > > I think this patch is good as it is; I was just pointing out that the\r
144 > > change also has a performance drawback in some situations.  (Knowing\r
145 > > make, there's probably *some* way to get the best of both worlds and\r
146 > > it's probably really ugly.)\r
147\r
148 > Ah, now I understand, because emacs/Makefile.local includes emacs/.eldeps\r
149 > when it notices mtime of emacs/.eldeps changes it restarts itself...\r
150\r
151 > ... to compare with current behaviour:\r
152\r
153 > $ make\r
154 > ...\r
155 > $ touch emacs/notmuch.el\r
156 > $ make\r
157 > ...\r
158 > $ make\r
159 > Use "make V=1" to see the verbose compile lines.\r
160 > EMACS emacs/.eldeps\r
161 > make: Nothing to be done for `all'.\r
162 > $ make\r
163 > Use "make V=1" to see the verbose compile lines.\r
164 > EMACS emacs/.eldeps\r
165 > make: Nothing to be done for `all'.\r
166 > $ make\r
167 > Use "make V=1" to see the verbose compile lines.\r
168 > EMACS emacs/.eldeps\r
169 > make: Nothing to be done for `all'.\r
170\r
171 > It will rerun emacs -L emacs -batch -l make-deps.el -f batch-make-deps ...\r
172 > over and over again...\r
173\r
174 > I thought I figured out a solution involving .eldeps.stamp file but\r
175 > that turned out to be no-go... (circular dependency netween .eldeps.stamp\r
176 > and Makefile.local).\r
177\r
178 > So, with this if one edits emacs/* files and keeps building byte-compiled\r
179 > versions often, make will both run EMACS emacs/.eldeps and restarting\r
180 > -- and when moving to edit other files both of the above stops. Without\r
181 > this change after editing emacs/* files EMACS emacs/.eldeps will be\r
182 > executed until it is touched or make clean executed (I wonder how make\r
183 > handles rebuilding emacs/.eldeps while doing make clean ;)\r
184\r
185\r
186 > Tomi\r
187 \r
188 Here's a way that works, but it's more complicated than your patch and\r
189 doesn't seem to perform any better:\r
190 \r
191 diff --git a/emacs/Makefile.local b/emacs/Makefile.local\r
192 index 42bfbd9..8a1f1c2 100644\r
193 --- a/emacs/Makefile.local\r
194 +++ b/emacs/Makefile.local\r
195 @@ -29,14 +29,28 @@ emacs_bytecode = $(emacs_sources:.el=.elc)\r
196  # the byte compiler may load an old .elc file when processing a\r
197  # "require" or we may fail to rebuild a .elc that depended on a macro\r
198  # from an updated file.\r
199 +#\r
200 +# We do this in two rules.  .eldeps is the "real" dependencies file\r
201 +# and will be rebuilt if and only if a .el source file changes.  We\r
202 +# could include this directly, but then whenever a .el file changed\r
203 +# (and .eldeps's mtime changed), make would restart immediately after\r
204 +# the include below.  To avoid this, we create a second file,\r
205 +# .eldeps.x, that we only update when its *contents* differ from\r
206 +# .eldeps.  .eldeps will often have an mtime older than .eldeps.x (any\r
207 +# .el file change that does not change dependencies will cause this),\r
208 +# so the .eldeps.x rule will often run, but it executes quickly and\r
209 +# quietly and will not trigger a make restart unless the dependencies\r
210 +# actually change.\r
211  ifeq ($(HAVE_EMACS),1)\r
212  $(dir)/.eldeps: $(dir)/Makefile.local $(dir)/make-deps.el $(emacs_sources)\r
213         $(call quiet,EMACS) --directory emacs -batch -l make-deps.el \\r
214                 -f batch-make-deps $(emacs_sources) > $@.tmp && \\r
215 -               (cmp -s $@.tmp $@ || mv $@.tmp $@)\r
216 --include $(dir)/.eldeps\r
217 +               mv $@.tmp $@\r
218 +$(dir)/.eldeps.x: $(dir)/.eldeps\r
219 +       @cmp -s $^ $@ || cp $^ $@\r
220 +-include $(dir)/.eldeps.x\r
221  endif\r
222 -CLEAN+=$(dir)/.eldeps $(dir)/.eldeps.tmp\r
223 +CLEAN+=$(dir)/.eldeps $(dir)/.eldeps.tmp $(dir)/.eldeps.x\r
224  \r
225  ifeq ($(HAVE_EMACS),1)\r
226  %.elc: %.el $(global_deps)\r