From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Saulius Menkevicius Newsgroups: gmane.emacs.devel Subject: Re: master 2c79a8f 2/2: Use posix_spawn if possible. Date: Sat, 12 Feb 2022 10:44:21 +0200 Message-ID: References: <87czk5brgr.fsf@gmail.com> <7BD6026F-D756-42C3-9FCC-724D9A6B2378@fastmail.com> <187BA387-6D96-457A-A157-388AD9379D85@fastmail.com> <83tud9wo9e.fsf@gnu.org> <87leyl5rr7.fsf@gmail.com> <87k0e44e8s.fsf@gmail.com> Mime-Version: 1.0 (Mac OS X Mail 15.0 \(3693.60.0.1.1\)) Content-Type: multipart/alternative; boundary="Apple-Mail=_B6A94D2C-BD38-49B5-8078-B0FB55CDD2D8" Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="38769"; mail-complaints-to="usenet@ciao.gmane.io" Cc: Alan Third , Emacs developers , p.stephani2@gmail.com, Matt Armstrong , Eli Zaretskii , mituharu@math.s.chiba-u.ac.jp To: Robert Pluim Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Sat Feb 12 10:07:38 2022 Return-path: Envelope-to: ged-emacs-devel@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1nIoNU-0009r2-0B for ged-emacs-devel@m.gmane-mx.org; Sat, 12 Feb 2022 10:07:37 +0100 Original-Received: from localhost ([::1]:53776 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1nIoNM-0001SX-Ks for ged-emacs-devel@m.gmane-mx.org; Sat, 12 Feb 2022 04:07:28 -0500 Original-Received: from eggs.gnu.org ([209.51.188.92]:33624) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nIo19-0004Vf-8j for emacs-devel@gnu.org; Sat, 12 Feb 2022 03:44:31 -0500 Original-Received: from out2-smtp.messagingengine.com ([66.111.4.26]:38855) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nIo16-0001PG-5H; Sat, 12 Feb 2022 03:44:30 -0500 Original-Received: from compute1.internal (compute1.nyi.internal [10.202.2.41]) by mailout.nyi.internal (Postfix) with ESMTP id E07FE5C00DA; Sat, 12 Feb 2022 03:44:25 -0500 (EST) Original-Received: from mailfrontend2 ([10.202.2.163]) by compute1.internal (MEProxy); Sat, 12 Feb 2022 03:44:25 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=fastmail.com; h= cc:cc:content-type:date:date:from:from:in-reply-to:in-reply-to :message-id:mime-version:references:reply-to:sender:subject :subject:to:to; s=fm2; bh=kXK0egfali4GO2+aNYcgf8mLsynhng19BLBFuc 0fMkI=; b=MgSZMABIOXJuEf5pohP6abG/nATULF/qv42LwNshdygffe8GN6ICHX J0TG4w8rQg0jS37CimDg2pSnnJ62+XwCevsnAMa8kbD0gmycVNqW8gKRne7XP11t eusRu6KIVmYdNwigwff0KMrdypLw6k2pMj+bnUARfg6s/OSEAG7iIvCj47w96IKK ZsM+1C/GmuLE4Ez9Ctb7thm7ACw81JLBGxwvkKbjjCjwjoq/e5tPFkGC7/vfUtHW KTjxG9DJM5NxXqZ3h/fwJWGtmOcynydvF3ToBSydZv9lfN8S38sGuzah+D3q2u4L yb3PXKu6Ur7WnPYN62cb6lqpCYKeJmoA== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:cc:content-type:date:date:from:from :in-reply-to:in-reply-to:message-id:mime-version:references :reply-to:sender:subject:subject:to:to:x-me-proxy:x-me-proxy :x-me-sender:x-me-sender:x-sasl-enc; s=fm2; bh=kXK0egfali4GO2+aN Ycgf8mLsynhng19BLBFuc0fMkI=; b=fKeXGDB7+bA/ark9Wiy6SijL03tKGJvdb lBApdtESjHjTlzE2UE7jW8nNoHe7lWIAzjVK/EX9M81RtqWFka5CuelCdgF0y4fT Oa1PSpBFLh7g82o5uj2IRSbIhkVVGZ8t+0MRU0rwNpkSzKHDdexxKfXxL0w0hX2X F141GkN6AsVM0SE6V2h4QOOD329DwFSkpgZXkSvDr2df43ET7KE+IE66jNuz+4n3 OpMAmVEAtasqsP1Bf30gjrtI0QYTT9g490+ufbg9UGJF65EkQlW2E8PQW1Z5cwM0 5JB9dC9QfMm+Nu3yOtD9PQafkhYjEB7s66h0hG9Qz+mduPHZVMGQg== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvvddrieeggdduvddvucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfqfgfvpdfurfetoffkrfgpnffqhgen uceurghilhhouhhtmecufedttdenucesvcftvggtihhpihgvnhhtshculddquddttddmne cujfgurhephffktgggufffjgfvfhfosegrtdhmrehhtdejnecuhfhrohhmpefurghulhhi uhhsucfovghnkhgvvhhitghiuhhsuceoshgruhhlihhushhmvghnkhgvvhhitghiuhhsse hfrghsthhmrghilhdrtghomheqnecuggftrfgrthhtvghrnhepheekvefhleekhfdttefh teegieefieduueefffdtffegueeujefgvefguddtfeehnecuffhomhgrihhnpehsthgrtg hkvgigtghhrghnghgvrdgtohhmpdhgihhthhhusgdrtghomhenucevlhhushhtvghrufhi iigvpedtnecurfgrrhgrmhepmhgrihhlfhhrohhmpehsrghulhhiuhhsmhgvnhhkvghvih gtihhushesfhgrshhtmhgrihhlrdgtohhm X-ME-Proxy: Original-Received: by mail.messagingengine.com (Postfix) with ESMTPA; Sat, 12 Feb 2022 03:44:24 -0500 (EST) In-Reply-To: <87k0e44e8s.fsf@gmail.com> X-Mailer: Apple Mail (2.3693.60.0.1.1) Received-SPF: pass client-ip=66.111.4.26; envelope-from=sauliusmenkevicius@fastmail.com; helo=out2-smtp.messagingengine.com X-Spam_score_int: -27 X-Spam_score: -2.8 X-Spam_bar: -- X-Spam_report: (-2.8 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_FROM=0.001, HTML_MESSAGE=0.001, RCVD_IN_DNSWL_LOW=-0.7, RCVD_IN_MSPIKE_H3=0.001, RCVD_IN_MSPIKE_WL=0.001, SPF_HELO_PASS=-0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham autolearn_force=no X-Spam_action: no action X-Mailman-Approved-At: Sat, 12 Feb 2022 03:59:41 -0500 X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Original-Sender: "Emacs-devel" Xref: news.gmane.io gmane.emacs.devel:286180 Archived-At: --Apple-Mail=_B6A94D2C-BD38-49B5-8078-B0FB55CDD2D8 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset=utf-8 Correct, I meant ":connection-type pipe=E2=80=9C when I referred to = lsp-mode. My mistake. Curiously setting :connect-type to =E2=80=99pty = does not fix my issues on macOS+emacs-28 for me. I might be doing = something wrong though.. Applying Robert=E2=80=99s patch does fix it on = emacs-28 too. And I was mistaken about /bin/bash reseting signal mask, ksh does it = though.. = https://unix.stackexchange.com/questions/123768/calling-sigprocmask-from-b= ash = . So my workarounds to fix sigmask are as follows: - on linux, I will wrap invocation of server process with = =E2=80=9E/usr/bin/env --default-signal=E2=80=9C - on macos, I will wrap invocation of server process with =E2=80=9E/bin/ks= h -c=E2=80=9C - .. not sure what is needed on *BSDs, probably the same thing as on = macOS if they have /bin/ksh in default installation? Are there any chances of getting this patch to fix signal mask to = default after posix_spawn from Robert getting merged to master and/or = emacs-28? -Saulius > Am 2022-02-09 um 10:48 schrieb Robert Pluim : >=20 >>>>>> On Tue, 8 Feb 2022 23:09:20 +0200, Saulius Menkevicius = said: >=20 > Saulius> Robert you are correct about ``:connection-type''. In = particular > Saulius> lsp-mode specifies ``:connection-type pty'' here: >=20 > ':connection-type pipe', you mean. Does it still work if you use > 'pty'? >=20 > Saulius> - = https://github.com/emacs-lsp/lsp-mode/blob/master/lsp-mode.el#L6932 > Saulius> = >=20 > Saulius> As a workaround fsharp/csharp language servers can use = shell wrapper > Saulius> for launching the server binaries, as "#!/bin/bash" will = apparently > Saulius> normalize signal mask before launching sub-subprocess and = things work > Saulius> alright from thereon. >=20 > That=CA=BCs to be expected. bash is a caring parent :-) >=20 > Saulius> This is not as nice as having things just working before = this change > Saulius> to `make-process`, but at least we have some way to work = around this > Saulius> issue.. >=20 > OK. In that case I=CA=BCll put it only in master. >=20 > Robert > --=20 --Apple-Mail=_B6A94D2C-BD38-49B5-8078-B0FB55CDD2D8 Content-Transfer-Encoding: quoted-printable Content-Type: text/html; charset=utf-8
Correct, I meant ":connection-type pipe=E2=80=9C when I = referred to lsp-mode. My mistake. Curiously setting :connect-type to = =E2=80=99pty does not fix my issues on macOS+emacs-28 for me. I might be = doing something wrong though.. Applying Robert=E2=80=99s patch does fix = it on emacs-28 too.

And I was mistaken about /bin/bash reseting signal mask, ksh = does it though.. https://unix.stackexchange.com/questions/123768/calling-sigproc= mask-from-bash.

So my workarounds to fix sigmask are as follows:
- on linux, I will wrap invocation of server process with = =E2=80=9E/usr/bin/env --default-signal=E2=80=9C
- = on macos, I will wrap invocation of server process with =E2=80=9E/bin/ksh = -c=E2=80=9C
- .. not sure what is needed on *BSDs, = probably the same thing as on macOS if they have /bin/ksh in default = installation?

Are there any chances of getting this patch = to fix signal mask to default after posix_spawn from Robert getting = merged to master and/or emacs-28?

-Saulius


Am 2022-02-09 um 10:48 schrieb Robert Pluim <rpluim@gmail.com>:

On Tue, 8 Feb 2022 = 23:09:20 +0200, Saulius Menkevicius <sauliusmenkevicius@fastmail.com> said:

   Saulius> Robert you are correct = about ``:connection-type''. In particular
=    Saulius> lsp-mode specifies ``:connection-type = pty'' here:

':connection-type pipe', you = mean. Does it still work if you use
'pty'?
   Saulius> - https://github.com/emacs-lsp/lsp-mode/blob/master/lsp-mode.el#L= 6932
   Saulius> <https://github.com/emacs-lsp/lsp-mode/blob/master/lsp-mode.el#L= 6932>

   Saulius> = As a workaround fsharp/csharp language servers can use shell wrapper
   Saulius> for launching the server = binaries, as "#!/bin/bash" will apparently
=    Saulius> normalize signal mask before launching = sub-subprocess and things work
=    Saulius> alright from thereon.

That=CA=BCs to be expected. bash is a caring parent :-)

   Saulius> This is not as = nice as having things just working before this change
=    Saulius> to `make-process`, but at least we have = some way to work around this
=    Saulius> issue..

OK. = In that case I=CA=BCll put it only in master.

Robert
--

= --Apple-Mail=_B6A94D2C-BD38-49B5-8078-B0FB55CDD2D8--