unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
From: "João Távora" <joaotavora@gmail.com>
To: Michael Albinus <michael.albinus@gmx.de>
Cc: jeberger@free.fr, 61748@debbugs.gnu.org
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 00:00:04 +0000	[thread overview]
Message-ID: <87y1oid5h7.fsf@gmail.com> (raw)
In-Reply-To: <87v8jmn9ya.fsf@gmx.de> (Michael Albinus's message of "Mon, 27 Feb 2023 21:13:17 +0100")

[-- Attachment #1: Type: text/plain, Size: 527 bytes --]

Michael Albinus <michael.albinus@gmx.de> writes:

> João Távora <joaotavora@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:


[-- Attachment #2: dockerfile --]
[-- Type: text/plain, Size: 1215 bytes --]

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"]

[-- Attachment #3: Type: text/plain, Size: 1778 bytes --]


  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@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@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@localhost#2022:$REMOTE_FILE                                       \
       --eval '(add-to-list (quote tramp-remote-path) (quote tramp-own-remote-path))' \
       -f eglot

João

  reply	other threads:[~2023-02-28  0:00 UTC|newest]

Thread overview: 59+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <1909672588.15608265.1677223717877.JavaMail.root@zimbra60-e10.priv.proxad.net>
2023-02-24  7:39 ` bug#61748: 27.2; Eglot should use shell-file-name when launching the language server for a remote file jeberger
2023-02-24  8:15   ` Eli Zaretskii
2023-02-24 11:11     ` jeberger
2023-02-24 16:44       ` Michael Albinus
2023-02-27 11:07   ` João Távora
2023-02-27 12:05     ` João Távora
2023-02-27 17:59       ` bug#61748: [informatique] " Jérôme M. Berger
2023-02-27 23:41         ` João Távora
2023-02-28  9:50           ` jeberger
2023-02-28 10:14             ` Michael Albinus
2023-02-28 10:28               ` João Távora
2023-02-27 19:57       ` Michael Albinus
2023-02-27 20:07         ` João Távora
2023-02-27 20:13           ` Michael Albinus
2023-02-28  0:00             ` João Távora [this message]
2023-02-28  8:41               ` Michael Albinus
2023-02-28 12:18                 ` João Távora
2023-02-28 12:34                   ` Michael Albinus
2023-02-28 12:46                     ` João Távora
2023-02-28 13:05                       ` Michael Albinus
2023-02-28 13:47                         ` João Távora
2023-02-28 14:10                           ` Michael Albinus
2023-02-28 14:24                             ` João Távora
2023-02-28 14:45                               ` Michael Albinus
2023-02-28 15:13                                 ` João Távora
2023-02-28 15:44                                   ` Michael Albinus
2023-02-28 16:43                               ` Eli Zaretskii
2023-02-28 16:49                                 ` João Távora
2023-02-28 17:56                                   ` Eli Zaretskii
2023-03-01  4:34                                     ` Richard Stallman
2023-03-01  9:31                                       ` João Távora
2023-03-01 13:04                                         ` Eli Zaretskii
2023-03-01 13:05                                           ` João Távora
2023-02-28 13:59                   ` jeberger
2023-02-28 14:25                     ` João Távora
2023-02-28 14:49                       ` Michael Albinus
2023-02-28 14:53                         ` João Távora
2023-02-28 15:15                           ` Michael Albinus
2023-02-28 15:23                             ` João Távora
2023-02-28 15:50                               ` Michael Albinus
2023-02-28 16:28                                 ` João Távora
2023-03-02  9:14                                   ` Michael Albinus
2023-03-02 10:56                                     ` João Távora
2023-03-02 11:40                                       ` Michael Albinus
2023-03-03  0:24                                         ` João Távora
2023-02-28 14:49                       ` jeberger
2023-02-28 15:07                         ` João Távora
2023-02-28 15:12                         ` Michael Albinus
2023-02-28 16:16                           ` jeberger
2023-02-28 16:41                             ` jeberger
2023-02-28 17:09                               ` João Távora
2023-03-01  8:09                                 ` jeberger
2023-03-02 13:28                                   ` João Távora
2023-03-07 10:15                                     ` João Távora
2023-03-01  8:39                               ` Michael Albinus
2023-03-01  8:51                                 ` jeberger
2023-03-01  9:07                                   ` Michael Albinus
2023-03-01 10:01                                     ` jeberger
2023-03-01 10:11                                       ` Michael Albinus

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/emacs/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=87y1oid5h7.fsf@gmail.com \
    --to=joaotavora@gmail.com \
    --cc=61748@debbugs.gnu.org \
    --cc=jeberger@free.fr \
    --cc=michael.albinus@gmx.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).