ido address lookup for notmuch
[notmuch-archives.git] / 74 / eb5f302ea5d5db971b106504c6df38f1c78c11
1 Return-Path: <dmitry.kurochkin@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 olra.theworths.org (Postfix) with ESMTP id B0E43431FD0\r
6         for <notmuch@notmuchmail.org>; Fri, 11 Nov 2011 08:03:09 -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.799\r
10 X-Spam-Level: \r
11 X-Spam-Status: No, score=-0.799 tagged_above=-999 required=5\r
12         tests=[DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1,\r
13         FREEMAIL_FROM=0.001, RCVD_IN_DNSWL_LOW=-0.7] autolearn=disabled\r
14 Received: from olra.theworths.org ([127.0.0.1])\r
15         by localhost (olra.theworths.org [127.0.0.1]) (amavisd-new, port 10024)\r
16         with ESMTP id AXNwszzRR27L for <notmuch@notmuchmail.org>;\r
17         Fri, 11 Nov 2011 08:03:08 -0800 (PST)\r
18 Received: from mail-fx0-f53.google.com (mail-fx0-f53.google.com\r
19         [209.85.161.53]) (using TLSv1 with cipher RC4-SHA (128/128 bits))\r
20         (No client certificate requested)\r
21         by olra.theworths.org (Postfix) with ESMTPS id 7AF82431FB6\r
22         for <notmuch@notmuchmail.org>; Fri, 11 Nov 2011 08:03:08 -0800 (PST)\r
23 Received: by faan15 with SMTP id n15so4719027faa.26\r
24         for <notmuch@notmuchmail.org>; Fri, 11 Nov 2011 08:03:05 -0800 (PST)\r
25 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma;\r
26         h=from:to:subject:in-reply-to:references:user-agent:date:message-id\r
27         :mime-version:content-type;\r
28         bh=7/zkcOLidnPxa+LT/QlQhSBD/GexL6G5GZ49gu6BZro=;\r
29         b=aqoAkz6KmMIPQFTvgj28qvi0tI1XqqhkcnpPdUHpE4UWWunQF1jN0fcbkpwl9AuI2H\r
30         3xl2tt27MVxrt5/w5zFXJR3ocjz3OtRXbBn+4MQo3KP+9RXsEf/X0x+/d8HhBjVHViCA\r
31         Ssy68FeZ99t85cIg7wPbR4cqyKome3TPF/GlY=\r
32 Received: by 10.205.120.2 with SMTP id fw2mr688157bkc.10.1321027385533;\r
33         Fri, 11 Nov 2011 08:03:05 -0800 (PST)\r
34 Received: from localhost ([91.144.186.21])\r
35         by mx.google.com with ESMTPS id o7sm1621991bkw.16.2011.11.11.08.03.03\r
36         (version=TLSv1/SSLv3 cipher=OTHER);\r
37         Fri, 11 Nov 2011 08:03:04 -0800 (PST)\r
38 From: Dmitry Kurochkin <dmitry.kurochkin@gmail.com>\r
39 To: Tomi Ollila <tomi.ollila@iki.fi>, Notmuch Mail <notmuch@notmuchmail.org>\r
40 Subject: Re: [PATCH] test: use dtach(1) instead of screen(1) in emacs tests.\r
41 In-Reply-To: <yf67h36ew2b.fsf@taco2.nixu.fi>\r
42 References: <yf6mxc3ab4t.fsf@taco2.nixu.fi>\r
43         <1320963737-1666-1-git-send-email-jrollins@finestructure.net>\r
44         <877h373vbs.fsf@gmail.com> <yf67h36ew2b.fsf@taco2.nixu.fi>\r
45 User-Agent: Notmuch/0.9+55~g81c615b (http://notmuchmail.org) Emacs/23.3.1\r
46         (x86_64-pc-linux-gnu)\r
47 Date: Fri, 11 Nov 2011 20:02:52 +0400\r
48 Message-ID: <87ty6a3avn.fsf@gmail.com>\r
49 MIME-Version: 1.0\r
50 Content-Type: text/plain; charset=us-ascii\r
51 X-BeenThere: notmuch@notmuchmail.org\r
52 X-Mailman-Version: 2.1.13\r
53 Precedence: list\r
54 List-Id: "Use and development of the notmuch mail system."\r
55         <notmuch.notmuchmail.org>\r
56 List-Unsubscribe: <http://notmuchmail.org/mailman/options/notmuch>,\r
57         <mailto:notmuch-request@notmuchmail.org?subject=unsubscribe>\r
58 List-Archive: <http://notmuchmail.org/pipermail/notmuch>\r
59 List-Post: <mailto:notmuch@notmuchmail.org>\r
60 List-Help: <mailto:notmuch-request@notmuchmail.org?subject=help>\r
61 List-Subscribe: <http://notmuchmail.org/mailman/listinfo/notmuch>,\r
62         <mailto:notmuch-request@notmuchmail.org?subject=subscribe>\r
63 X-List-Received-Date: Fri, 11 Nov 2011 16:03:09 -0000\r
64 \r
65 On Fri, 11 Nov 2011 13:29:48 +0200, Tomi Ollila <tomi.ollila@iki.fi> wrote:\r
66 > On Fri, 11 Nov 2011 12:41:11 +0400, Dmitry Kurochkin <dmitry.kurochkin@gmail.com> wrote:\r
67 > > Hi Tomi.\r
68 > > \r
69 > > On Thu, 10 Nov 2011 14:22:17 -0800, Jameson Graef Rollins <jrollins@finestructure.net> wrote:\r
70 > > > From: Tomi Ollila <tomi.ollila@iki.fi>\r
71 > > > \r
72 > > > dtach is lighter than screen and is not setuid/setgid program so\r
73 > > > TMPDIR does not get reset by dynamic loader when executed.\r
74 > > > \r
75 > > > Signed-off-by: Jameson Graef Rollins <jrollins@finestructure.net>\r
76 > > > ---\r
77 > > > This tweaks the original patch slightly by removing the no-longer needed\r
78 > > > screenrc variables.\r
79 > > > \r
80 > > >  test/test-lib.sh |    5 ++---\r
81 > > >  1 files changed, 2 insertions(+), 3 deletions(-)\r
82 > > > \r
83 > > > diff --git a/test/test-lib.sh b/test/test-lib.sh\r
84 > > > index c81c709..c0fe037 100755\r
85 > > > --- a/test/test-lib.sh\r
86 > > > +++ b/test/test-lib.sh\r
87 > > > @@ -50,8 +50,6 @@ TZ=UTC\r
88 > > >  TERM=dumb\r
89 > > >  export LANG LC_ALL PAGER TERM TZ\r
90 > > >  GIT_TEST_CMP=${GIT_TEST_CMP:-diff -u}\r
91 > > > -export SCREENRC=/dev/null\r
92 > > > -export SYSSCREENRC=/dev/null\r
93 > > >  \r
94 > > >  # Protect ourselves from common misconfiguration to export\r
95 > > >  # CDPATH into the environment\r
96 > > > @@ -844,7 +842,8 @@ test_emacs () {\r
97 > > >   if [ -z "$EMACS_SERVER" ]; then\r
98 > > >           EMACS_SERVER="notmuch-test-suite-$$"\r
99 > > >           # start a detached screen session with an emacs server\r
100 > > > -         screen -S "$EMACS_SERVER" -d -m "$TMP_DIRECTORY/run_emacs" \\r
101 > > > +         TERM=xterm dtach -n "$TMP_DIRECTORY/dtach-emacs-socket-$$" \\r
102 > > \r
103 > > Can you please give a more detailed explanation (and a comment) to\r
104 > > justify this workaround:\r
105 > > \r
106 > > * Is it actually needed for dtach or emacs?  If it is the latter, then\r
107 > >   it should be "dtach ... env TERM=xterm emacs ...", right?\r
108\r
109 > dtach doesn't care about TERM, it is emacs which does (as you noticed\r
110 > below). But it is bood that the TERM is same in dtach's environment.\r
111\r
112 > doing VAR=val command args instead of env VAR=val saves one execve(2)\r
113 > as the shell does the environment setting (after fork before execve)\r
114 \r
115 I do not think trying that saving one execve(2) call is what we are\r
116 after.  Especially in test suite.\r
117 \r
118 IMO setting TERM inside dtach makes it clear that we the workaround is\r
119 for emacs, not dtach (a comment should also make this clear).  Besides,\r
120 it is always better to minimize the context affected by a hack.\r
121 \r
122 > > \r
123 > > * Why should we care about systems that use terminals without\r
124 > >   corresponding terminfo installed?\r
125\r
126 > That's the issue I thought, armdragon on IRC thought etc. The 'xterm'\r
127 > is part of ncurses-base on Debian, at least (thanks armdragon for this\r
128 > info) and is it pretty much as base to every terminal emulator there is \r
129 > (I just launched gnome-terminal for testing, TERM was set to xterm --\r
130 > it may have been initially in environment but if gnome-terminal changed\r
131 > it before launching shell, my shell config will not change it)\r
132\r
133 \r
134 Sorry, this does not answer my question.\r
135 \r
136 My point is that if a system can not run "emacs -nw" because it lacks\r
137 corresponding terminfo, it is not notmuch who should work around these\r
138 issues.  If you are using such system by whatever reason, it is your\r
139 responsibility to run notmuch tests (and all other programs who need a\r
140 valid terminfo) with modified TERM value.\r
141 \r
142 Perhaps others disagree, but I think it is reasonable for notmuch test\r
143 suite to expect that "emacs -nw" works.\r
144 \r
145 > > * Why is it safe to use xterm?  Is there any standard that requires\r
146 > >   xterm info to be present on the system?\r
147\r
148 > xterm is not needed, it is just to tell emacs it can use it's display\r
149 > control sequences. more common alternative would have been vt100, just\r
150 > that if one ever wants to attach to that emacs session you he gets\r
151 > better experience (such as colors), using any terminal emulator, like rxvt.\r
152\r
153 \r
154 Sorry, I was misleading.  I did not mean that we are using xterm itself.\r
155 I am worried that we introduce dependency on xterm terminfo.  I\r
156 understand that it is part of ncurses-base package in Debian.  But\r
157 Debian is not the only system out there.  I think it is perfectly fine\r
158 for a system without X to lack xterm terminfo.  And by setting TERM to\r
159 "xterm" we break such systems.\r
160 \r
161 Using "vt100" seems like a better alternative.  But the question\r
162 remains: is there any standard requirement that a particular terminfo\r
163 must be available on a system?  If there is no such requirement, then we\r
164 can not override TERM value without breaking the test suite on some\r
165 weird (but perfectly fine) systems.\r
166 \r
167 > > I have tried running dtach with emacs in rxvt-unicode and it worked fine\r
168 > > without overriding TERM.\r
169\r
170 > you had originally suitable TERM to be passed to emacs.\r
171\r
172 \r
173 Sure. Why do not you have a valid TERM value with a corresponding\r
174 terminfo on your system?\r
175 \r
176 Sorry for being picky here.  I am fine with your patch except for this.\r
177 But TERM override feels wrong to me so far.  (Though, it is not me who\r
178 decides on the patches, perhaps others are fine with it and you can just\r
179 ignore me.)\r
180 \r
181 Regards,\r
182   Dmitry\r
183 \r
184 > > \r
185 > > I have also tried running dtach with invalid TERM:\r
186 > > \r
187 > >   $ TERM=non-existing-term dtach -n s /bin/sh\r
188 > >   zsh: can't find terminal definition for non-existing-term\r
189 > > \r
190 > > No segfault, shell is started fine.\r
191\r
192 > Yes, dtach could not care less...\r
193\r
194 > > \r
195 > > But emacs does not work without a valid terminfo:\r
196 > > \r
197 > >   $ TERM=non-existing-term emacs -nw\r
198 > >   emacs: Terminal type non-existing-term is not defined.\r
199 > >   If that is not the actual type of terminal you have,\r
200 > >   use the Bourne shell command `TERM=... export TERM' (C-shell:\r
201 > >   `setenv TERM ...') to specify the correct type.  It may be necessary\r
202 > >   to do `unset TERMINFO' (C-shell: `unsetenv TERMINFO') as well.\r
203\r
204 > Yes, I got SIGSEGV --  strace -o oprfx -ff command args  is your friend :D\r
205\r
206 > > Regards,\r
207 > >   Dmitry\r
208\r
209 > Thanks for your analysis. \r
210\r
211 > Tomi\r
212\r
213 > > \r
214 > > > +                 "$TMP_DIRECTORY/run_emacs" \\r
215 > > >                   --no-window-system \\r
216 > > >                   --eval "(setq server-name \"$EMACS_SERVER\")" \\r
217 > > >                   --eval '(server-start)' \\r
218 > > > -- \r
219 > > > 1.7.7.1\r
220 > > > \r
221 > > > _______________________________________________\r
222 > > > notmuch mailing list\r
223 > > > notmuch@notmuchmail.org\r
224 > > > http://notmuchmail.org/mailman/listinfo/notmuch\r
225 > > _______________________________________________\r
226 > > notmuch mailing list\r
227 > > notmuch@notmuchmail.org\r
228 > > http://notmuchmail.org/mailman/listinfo/notmuch\r
229 > > \r