GNU bug report logs - #61748
27.2; Eglot should use shell-file-name when launching the language server for a remote file

Previous Next

Package: emacs;

Reported by: jeberger <at> free.fr

Date: Fri, 24 Feb 2023 07:40:01 UTC

Severity: normal

Found in version 27.2

Done: João Távora <joaotavora <at> gmail.com>

Bug is archived. No further changes may be made.

Full log


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

From: João Távora <joaotavora <at> gmail.com>
To: Michael Albinus <michael.albinus <at> gmx.de>
Cc: jeberger <at> free.fr, 61748 <at> debbugs.gnu.org
Subject: Re: bug#61748: 27.2; Eglot should use shell-file-name when
 launching the language server for a remote file
Date: Tue, 28 Feb 2023 00:00:04 +0000
[Message part 1 (text/plain, inline)]
Michael Albinus <michael.albinus <at> gmx.de> writes:

> João Távora <joaotavora <at> gmail.com> writes:
>
> Hi João,
>
>>     Why don't you add (the expanded) ~/bin to tramp-remote-path?
>>
>> I did, but it did not work reliably, Michael. Only sometimes.
>>
>> I will try again though.
>
> Show me your settings, we'll fix it together.

I use the attached dockerfile that I used for the reproduction of
bug#61350.  It installs a Java LSP server and has a Java project.  I
build and run this Docker container with:

[dockerfile (text/plain, inline)]
FROM ubuntu:latest
RUN apt update && apt install  openssh-server sudo openjdk-17-jdk openjdk-17-jre git wget -y
# Create a user “sshuser” and group “sshgroup”
RUN groupadd sshgroup && useradd -ms /bin/bash -g sshgroup sshuser
# Create sshuser directory in home
RUN mkdir -p /home/sshuser/.ssh
# Copy the ssh public key in the authorized_keys file. The idkey.pub below is a public key file you get from ssh-keygen. They are under ~/.ssh directory by default.
COPY id_rsa.pub /home/sshuser/.ssh/authorized_keys
# change ownership of the key file. 
RUN chown sshuser:sshgroup /home/sshuser/.ssh/authorized_keys && chmod 600 /home/sshuser/.ssh/authorized_keys
# Start SSH service
RUN service ssh start
# Expose docker port 22
EXPOSE 22

USER sshuser
WORKDIR /home/sshuser
RUN git clone --depth 1 --no-tags --single-branch -b eglot-tramp-freeze-repro https://github.com/thkoch2001/yacy_search_server
RUN wget https://download.eclipse.org/jdtls/milestones/1.19.0/jdt-language-server-1.19.0-202301171536.tar.gz
RUN mkdir jdtls
RUN tar xvfz jdt-language-server-1.19.0-202301171536.tar.gz -C jdtls
RUN mkdir bin
RUN ln -sf ~/jdtls/bin/jdtls ~/bin/jdtls

USER root
CMD ["/usr/sbin/sshd","-D"]
[Message part 3 (text/plain, inline)]
  docker build -t sshubuntu .
  docker run -d -p 2022:22 sshubuntu

In a directory where I have the attached dockerfile and a id_rsa.pub
which is the public key to my default ssh key.  

After this ssh access works with the user 'sshuser' on localhost port
2022 mapped to the server's 22.  The LSP server executable 'jdtls' is
linked to this user's $HOME/bin, or /home/sshuser/bin.

The default shell for user 'sshuser' is '/bin/bash' (though Tramp seems
to access it with '/bin/sh').  The local shell is '/bin/zsh'.

In the local machine I launch Emacs -Q sessions in slightly different
ways.  This fails:

    export REMOTE_FILE=/home/sshuser/yacy_search_server/source/net/yacy/yacy.java
    ~/Source/Emacs/emacs/src/emacs -Q                                                 \
       /ssh:sshuser <at> localhost#2022:$REMOTE_FILE                                       \
       --eval '(add-to-list (quote tramp-remote-path) "/home/sshuser/bin")'           \
       -f eglot

Even if it worked, I would be suboptimal.  I think I would like to avoid
the hardcoding of "/home/sshuser/bin" in my config.  This also fails.

    ~/Source/Emacs/emacs/src/emacs -Q                                                 \
       /ssh:sshuser <at> localhost#2022:$REMOTE_FILE                                       \
       --eval '(add-to-list (quote tramp-remote-path) "~/bin")'                       \
       -f eglot

And the following works.  Eglot is started correctly.

    ~/Source/Emacs/emacs/src/emacs -Q                                                 \
       /ssh:sshuser <at> localhost#2022:$REMOTE_FILE                                       \
       --eval '(add-to-list (quote tramp-remote-path) (quote tramp-own-remote-path))' \
       -f eglot

João

This bug report was last modified 2 years and 161 days ago.

Previous Next


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