GNU bug report logs - #66093
Eglot over tramp sshfs/sftp

Previous Next

Package: emacs;

Reported by: Ko Nishi <kohnish <at> gmx.com>

Date: Mon, 18 Sep 2023 18:11:01 UTC

Severity: normal

Fixed in version 29.2

Done: Michael Albinus <michael.albinus <at> gmx.de>

Bug is archived. No further changes may be made.

To add a comment to this bug, you must first unarchive it, by sending
a message to control AT debbugs.gnu.org, with unarchive 66093 in the body.
You can then email your comments to 66093 AT debbugs.gnu.org in the normal way.

Toggle the display of automated, internal messages from the tracker.

View this report as an mbox folder, status mbox, maintainer mbox


Report forwarded to bug-gnu-emacs <at> gnu.org:
bug#66093; Package emacs. (Mon, 18 Sep 2023 18:11:01 GMT) Full text and rfc822 format available.

Acknowledgement sent to Ko Nishi <kohnish <at> gmx.com>:
New bug report received and forwarded. Copy sent to bug-gnu-emacs <at> gnu.org. (Mon, 18 Sep 2023 18:11:01 GMT) Full text and rfc822 format available.

Message #5 received at submit <at> debbugs.gnu.org (full text, mbox):

From: Ko Nishi <kohnish <at> gmx.com>
To: bug-gnu-emacs <at> gnu.org
Cc: michael.albinus <at> gmx.de, joaotavora <at> gmail.com
Subject: Eglot over tramp sshfs/sftp
Date: Mon, 18 Sep 2023 19:52:25 +0200
[Message part 1 (text/html, inline)]

Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#66093; Package emacs. (Tue, 19 Sep 2023 07:47:01 GMT) Full text and rfc822 format available.

Message #8 received at 66093 <at> debbugs.gnu.org (full text, mbox):

From: Michael Albinus <michael.albinus <at> gmx.de>
To: Ko Nishi <kohnish <at> gmx.com>
Cc: 66093 <at> debbugs.gnu.org, joaotavora <at> gmail.com
Subject: Re: bug#66093: Eglot over tramp sshfs/sftp
Date: Tue, 19 Sep 2023 09:46:20 +0200
Ko Nishi <kohnish <at> gmx.com> writes:

> Hi,

Hi Ko,

> I was suggested to contact here from a github discussion
> https://github.com/joaotavora/eglot/discussions/1294.
> But in short, at the moment, eglot fails to spawn a functioning
> language server process over tramp when sshfs or sftp is used.
> For sshfs, I see clangd process without stty command on remote, while
> with sftp eglot doesn't find the path.

Tramp's sftp integration doesn't support remote processes. So there's no
chance to make it working.

sshfs, as general concept, doesn't allow remote processes either. Tramp
has added this functionality by opening a parallel ssh connection, see
tramp-sshfs.el for its configuration (the lines, where
tramp-sshfs-method is added to tramp-methods). However, it calls remote
commands directly via ssh, like this (according to Tramp traces):

--8<---------------cut here---------------start------------->8---
ssh -q -e none -t -t gandalf cd /home/albinus/src/emacs/ && ( env INSIDE_EMACS\=30.0.50\,tramp\:2.7.0-pre ENV\=\'\' TMOUT\=0 LC_CTYPE\=\'\' CDPATH\= HISTORY\= MAIL\= MAILCHECK\= MAILPATH\= PAGER\=cat autocorrect\= correct\= /bin/sh -c stty\ raw\ \>\ /dev/null\;\ /usr/bin/clangd )
--8<---------------cut here---------------end--------------->8---

I'm not sure, but likely the snippet "stty\ raw\ \>\ /dev/null\;\ /usr/bin/clangd"
might need another quoting.

> Best regards,
> Ko

Best regards, Michael.




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#66093; Package emacs. (Wed, 20 Sep 2023 01:41:03 GMT) Full text and rfc822 format available.

Message #11 received at 66093 <at> debbugs.gnu.org (full text, mbox):

From: Ko Nishi <kohnish <at> gmx.com>
To: Michael Albinus <michael.albinus <at> gmx.de>
Cc: 66093 <at> debbugs.gnu.org, joaotavora <at> gmail.com
Subject: Re: bug#66093: Eglot over tramp sshfs/sftp
Date: Tue, 19 Sep 2023 20:59:06 +0200
[Message part 1 (text/html, inline)]

Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#66093; Package emacs. (Wed, 20 Sep 2023 09:16:02 GMT) Full text and rfc822 format available.

Message #14 received at 66093 <at> debbugs.gnu.org (full text, mbox):

From: Michael Albinus <michael.albinus <at> gmx.de>
To: Ko Nishi <kohnish <at> gmx.com>
Cc: 66093 <at> debbugs.gnu.org, joaotavora <at> gmail.com
Subject: Re: bug#66093: Eglot over tramp sshfs/sftp
Date: Wed, 20 Sep 2023 11:14:38 +0200
Ko Nishi <kohnish <at> gmx.com> writes:

> Hi Michael,

Hi Ko,

> Without really understanding the code, If I copy the list from the ssh
> section of tramp-sh.el:245 and remove ("%c"), it started work after
> manually telling eglot to start clangd manually on propmt.
> Eglot is noticeably faster than using just ssh or sshx on a server
> 80ms ping away.

Remote processes with sshfs are configured to use the direct async
connection by default (see the Tramp manual, section "Improving
performance of asynchronous remote processes"). You can achieve the same
with ssh connections by setting the "direct-async-process" connection
property, like

--8<---------------cut here---------------start------------->8---
     (add-to-list 'tramp-connection-properties
                  (list (regexp-quote "/ssh:user <at> host:")
                        "direct-async-process" t))
--8<---------------cut here---------------end--------------->8---

> Best,
> Ko

Best regards, Michael.




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#66093; Package emacs. (Fri, 22 Sep 2023 18:03:02 GMT) Full text and rfc822 format available.

Message #17 received at 66093 <at> debbugs.gnu.org (full text, mbox):

From: Michael Albinus <michael.albinus <at> gmx.de>
To: Ko Nishi <kohnish <at> gmx.com>
Cc: 66093 <at> debbugs.gnu.org, joaotavora <at> gmail.com
Subject: Re: bug#66093: Eglot over tramp sshfs/sftp
Date: Fri, 22 Sep 2023 20:02:21 +0200
[Message part 1 (text/plain, inline)]
Ko Nishi <kohnish <at> gmx.com> writes:

> Hi Michael,

Hi Ko,

> Without really understanding the code, If I copy the list from the ssh
> section of tramp-sh.el:245 and remove ("%c"), it started work after
> manually telling eglot to start clangd manually on propmt.

Well, after all it was a perfect shot! The "-t -t" ssh arguments have
prevented the pipe process, eglot is using, to work properly.

Could you pls test the appended patch? It is on top of the emacs-29
branch of the Emacs git repository, but it should apply also on the
Emacs 29.1 sources.

> Other than that many other things aren't working like vc-root-dir,
> finding PATH and etc.
> I'll try to understand the code and play around later.

Yep, that's still open. Perhaps my patch improves the situation, because
it suppresses the "-t -t" arguments only for pipe processes.

> Best,
> Ko

Best regards, Michael.

[Message part 2 (text/x-patch, attachment)]

Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#66093; Package emacs. (Fri, 22 Sep 2023 18:13:02 GMT) Full text and rfc822 format available.

Message #20 received at 66093 <at> debbugs.gnu.org (full text, mbox):

From: Michael Albinus <michael.albinus <at> gmx.de>
To: Ko Nishi <kohnish <at> gmx.com>
Cc: 66093 <at> debbugs.gnu.org, joaotavora <at> gmail.com
Subject: Re: bug#66093: Eglot over tramp sshfs/sftp
Date: Fri, 22 Sep 2023 20:11:55 +0200
[Message part 1 (text/plain, inline)]
Michael Albinus <michael.albinus <at> gmx.de> writes:

Hi Ko,

> Could you pls test the appended patch? It is on top of the emacs-29
> branch of the Emacs git repository, but it should apply also on the
> Emacs 29.1 sources.

Oops, the other part is missing. Pls apply also the appended patch here.

>> Best,
>> Ko

Best regards, Michael.

[Message part 2 (text/x-patch, attachment)]

Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#66093; Package emacs. (Tue, 26 Sep 2023 13:45:02 GMT) Full text and rfc822 format available.

Message #23 received at 66093 <at> debbugs.gnu.org (full text, mbox):

From: Ko Nishi <kohnish <at> gmx.com>
To: Michael Albinus <michael.albinus <at> gmx.de>
Cc: 66093 <at> debbugs.gnu.org, joaotavora <at> gmail.com
Subject: Re: bug#66093: Eglot over tramp sshfs/sftp
Date: Tue, 26 Sep 2023 11:03:44 +0200
[Message part 1 (text/html, inline)]

Reply sent to Michael Albinus <michael.albinus <at> gmx.de>:
You have taken responsibility. (Tue, 26 Sep 2023 17:00:02 GMT) Full text and rfc822 format available.

Notification sent to Ko Nishi <kohnish <at> gmx.com>:
bug acknowledged by developer. (Tue, 26 Sep 2023 17:00:02 GMT) Full text and rfc822 format available.

Message #28 received at 66093-done <at> debbugs.gnu.org (full text, mbox):

From: Michael Albinus <michael.albinus <at> gmx.de>
To: Ko Nishi <kohnish <at> gmx.com>
Cc: 66093-done <at> debbugs.gnu.org, joaotavora <at> gmail.com
Subject: Re: bug#66093: Eglot over tramp sshfs/sftp
Date: Tue, 26 Sep 2023 18:59:19 +0200
Version: 29.2

Ko Nishi <kohnish <at> gmx.com> writes:

> Hi Micheal,

Hi Ko,

> It works pretty good on emac29.1! Thank you.

Thanks for the feedback. I've pushed the patch to the repositories,
slightly modified. It will appear with Emacs 29.2 as well as on GNU ELPA
later this week, as Tramp 2.6.1.3.

> The only thing it doesn't work is vc-root-dir on a current file.  Like
> within sshfs eshell, it returns properly, but according the
> interactive functions in my init.el that does work based on current
> file, it returns nil.

Yes. tramp-sshfs.el does not offer an implementation for
`vc-registered'. To be precise, it offers the function

--8<---------------cut here---------------start------------->8---
    (vc-registered . ignore)
--8<---------------cut here---------------end--------------->8---

Therefore, all files are not under VC control. This won't change.

> Btw, indeed, you might be right about async option, but sshfs "might"
> performce nicely for go to definition for eglot sometimes, but it's
> just an impression, I could be totally wrong if I actually measure it.

Pls tell me if you see more optimization knobs to be implemented. ATM, I
believe we have done what's possible with this bug, so I'm closing it.

> Best regards,
> Ko

Best regards, Michael.




bug archived. Request was from Debbugs Internal Request <help-debbugs <at> gnu.org> to internal_control <at> debbugs.gnu.org. (Wed, 25 Oct 2023 11:24:08 GMT) Full text and rfc822 format available.

This bug report was last modified 1 year and 197 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.