From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: jeberger@free.fr Newsgroups: gmane.emacs.bugs Subject: bug#61748: 27.2; Eglot should use shell-file-name when launching the language server for a remote file Date: Tue, 28 Feb 2023 17:16:56 +0100 (CET) Message-ID: <1548871766.7639206.1677601016400.JavaMail.root@zimbra60-e10.priv.proxad.net> References: <774021794.15662399.1677224385920.JavaMail.root@zimbra60-e10.priv.proxad.net> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="36722"; mail-complaints-to="usenet@ciao.gmane.io" Cc: =?UTF-8?Q?Jo=C3=A3o_?= =?UTF-8?Q?T=C3=A1vora?= , 61748@debbugs.gnu.org To: Michael Albinus Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Tue Feb 28 17:18:26 2023 Return-path: Envelope-to: geb-bug-gnu-emacs@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 1pX2gJ-0009Fz-Kl for geb-bug-gnu-emacs@m.gmane-mx.org; Tue, 28 Feb 2023 17:18:23 +0100 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1pX2g1-00015F-K8; Tue, 28 Feb 2023 11:18:05 -0500 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1pX2fz-00014m-Hc for bug-gnu-emacs@gnu.org; Tue, 28 Feb 2023 11:18:03 -0500 Original-Received: from debbugs.gnu.org ([209.51.188.43]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1pX2fy-0002Pe-T8 for bug-gnu-emacs@gnu.org; Tue, 28 Feb 2023 11:18:03 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1pX2fy-0004hW-Ol for bug-gnu-emacs@gnu.org; Tue, 28 Feb 2023 11:18:02 -0500 X-Loop: help-debbugs@gnu.org Resent-From: jeberger@free.fr Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Tue, 28 Feb 2023 16:18:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 61748 X-GNU-PR-Package: emacs Original-Received: via spool by 61748-submit@debbugs.gnu.org id=B61748.167760102217927 (code B ref 61748); Tue, 28 Feb 2023 16:18:02 +0000 Original-Received: (at 61748) by debbugs.gnu.org; 28 Feb 2023 16:17:02 +0000 Original-Received: from localhost ([127.0.0.1]:51841 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pX2ez-0004f2-Mx for submit@debbugs.gnu.org; Tue, 28 Feb 2023 11:17:02 -0500 Original-Received: from smtp1-g21.free.fr ([212.27.42.1]:5980) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pX2ew-0004eb-0Y for 61748@debbugs.gnu.org; Tue, 28 Feb 2023 11:16:59 -0500 Original-Received: from zimbra60-e10.priv.proxad.net (unknown [172.20.243.210]) by smtp1-g21.free.fr (Postfix) with ESMTP id 88ED2B0052C; Tue, 28 Feb 2023 17:16:56 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=free.fr; s=smtp-20201208; t=1677601016; bh=6fhtSk5el5j8eeJ/2mTi9//FCDjVo59Pn5qFC3x928g=; h=Date:From:To:Cc:In-Reply-To:Subject:From; b=RKEvXIB411WZP337N6YmlGXFkepEdBp8b+hjn5H/2OG7e+3HG9JFU6LmikQp29ONB gFNd1A63jvhrvoYsIx7pANWw8RU1oMbM+/FCnxNgJqiJPeb8QBwOJCFJHLOc+mlAqb WNlmMo+lPJoVK7287kC0Pn1r5nckwzxgqj4GjNeUaNSBb1+p6f3QorHvJGr4KRTlQn 0Sxhi0cq9bNODYFVbvhtVgUJ6jKNxfM45L7Yn29h9pO37v+dlmX+Y7Ai7liftqBzN1 wBG57S0VLOBSTQ2Jx2uZdabcNxi6WxUw1xkPhPF23T3ZiCh+TcLO9wqNHlRHoWSP3B 5X4lrtwP2XuEA== In-Reply-To: <87fsap6cyd.fsf@gmx.de> X-Originating-IP: [193.240.154.120] X-Mailer: Zimbra 7.2.0-GA2598 (ZimbraWebClient - NAV6 (Win)/7.2.0-GA2598) X-Authenticated-User: jeberger@free.fr X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Original-Sender: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Xref: news.gmane.io gmane.emacs.bugs:256987 Archived-At: Michael Albinus wrote: > jeberger@free.fr writes: >=20 > Hi J=C3=A9r=C3=B4me, >=20 > > Effectively, `(executable-find "rust-analyzer" t)` doesn't find it. >=20 > Your current buffer is a remote one when you call it, right? >=20 > > I'll try to find out why, but this point should indeed be fixed in > > `executable-find` rather than Eglot. >=20 > Pls set tramp-verbose to 10, rerun the test, and show me the Tramp > debug > buffer. Something like >=20 > --8<---------------cut here---------------start------------->8--- > # emacs -Q -l tramp --eval '(setq tramp-verbose 10)' --eval > '(add-to-list (quote tramp-remote-path) ...)' /ssh:user@host: --eval > '(executable-find "rust-analyzer" t)' > --8<---------------cut here---------------end--------------->8--- >=20 > > J=C3=A9r=C3=B4me >=20 Yes, it's with a remote buffer. I also noticed that `(exec-path)` is wrong: it only contains the standard paths ("/bin" "/usr/bin" "/sbin" "/usr/sbin" "/usr/local/bin" "/usr/local/sbin") plus the path of the current file. It's missing the paths from the remote environment and the paths I've added manually to `tramp-remote-path`. However `(shell-command "echo $PATH")` prints the correct path, and `(shell-command "rust-analyzer --version")` works. I tried with a minimalist emacs: ``` emacs -Q -l tramp \ --eval '(setq tramp-verbose 10)' \ --eval "(setq tramp-remote-path '(tramp-own-remote-path tramp-default-r= emote-path))" \ --eval '(setq shell-file-name "zsh")' \ /plink:user@host: \ --eval '(message (exec-path))' ``` But Tramp ignores `shell-file-name` and uses `/bin/sh` instead. E.g. in the Tramp debug buffer, I see lines like this: ``` 16:53:16.188134 tramp-send-command (6) # /bin/sh -l -c 'echo 1e814d9777358b= 9e0b5ab89ad5422ddb \"$PATH\"' 2>/dev/null; echo tramp_exit_status $? ``` and when I call `shell-command`, it's clear that it's using `sh` too even though `C-h v` shows that `shell-file-name` is correctly set to `zsh`. J=C3=A9r=C3=B4me