From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: =?UTF-8?Q?Jo=C3=A3o_?= =?UTF-8?Q?T=C3=A1vora?= 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 00:00:04 +0000 Message-ID: <87y1oid5h7.fsf@gmail.com> References: <1909672588.15608265.1677223717877.JavaMail.root@zimbra60-e10.priv.proxad.net> <774021794.15662399.1677224385920.JavaMail.root@zimbra60-e10.priv.proxad.net> <87cz5uop91.fsf@gmx.de> <87v8jmn9ya.fsf@gmx.de> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="1034"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Gnus/5.13 (Gnus v5.13) Cc: jeberger@free.fr, 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 00:59:19 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 1pWnOo-000AdL-TC for geb-bug-gnu-emacs@m.gmane-mx.org; Tue, 28 Feb 2023 00:59:19 +0100 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1pWnOa-00040d-HM; Mon, 27 Feb 2023 18:59:04 -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 1pWnOY-00040L-Jc for bug-gnu-emacs@gnu.org; Mon, 27 Feb 2023 18:59:02 -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 1pWnOY-0002yh-25 for bug-gnu-emacs@gnu.org; Mon, 27 Feb 2023 18:59:02 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1pWnOX-00051o-MF for bug-gnu-emacs@gnu.org; Mon, 27 Feb 2023 18:59:01 -0500 X-Loop: help-debbugs@gnu.org Resent-From: =?UTF-8?Q?Jo=C3=A3o_?= =?UTF-8?Q?T=C3=A1vora?= Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Mon, 27 Feb 2023 23:59:01 +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.167754230119276 (code B ref 61748); Mon, 27 Feb 2023 23:59:01 +0000 Original-Received: (at 61748) by debbugs.gnu.org; 27 Feb 2023 23:58:21 +0000 Original-Received: from localhost ([127.0.0.1]:49223 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pWnNt-00050q-Ab for submit@debbugs.gnu.org; Mon, 27 Feb 2023 18:58:21 -0500 Original-Received: from mail-wm1-f51.google.com ([209.85.128.51]:52844) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pWnNp-00050a-3q for 61748@debbugs.gnu.org; Mon, 27 Feb 2023 18:58:20 -0500 Original-Received: by mail-wm1-f51.google.com with SMTP id j3so5328618wms.2 for <61748@debbugs.gnu.org>; Mon, 27 Feb 2023 15:58:17 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; t=1677542291; h=mime-version:user-agent:message-id:date:references:in-reply-to :subject:cc:to:from:from:to:cc:subject:date:message-id:reply-to; bh=gaSInsvatnEM9FugaobYZf89bZfv2+ZkPQ6th3vgDmg=; b=qPNOsWWR7s73I1i8AYInwcXynPFz9r1xLByG5p7vKDvDkS0pyGfBaPFNdmNZw3ORan pLGJ+IxbzLPFJuKfPY9lCbDuz8A02K2oGOx9do79Tg1dOm5WFjBb4zQ8UGWFfHJ+Y5RC US0aGaOCVttVk651yHsDwc6aNBlFeT14Tnl2u4reF/3dKqSkfws0sG/xmSHpk7feE5WV 5nWBFRq82r+6y2y+NTSlEoePtRdXmmKDoK3dZ3B1R+RS4Arndyo2bAhbK95r/pKhyMvT +gsVLc75RiKj1780M2P09ZBeXKVVtHMe7TGkO8yfVuetU44LM217n27ZYKzB4gMayUSF VUzw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; t=1677542291; h=mime-version:user-agent:message-id:date:references:in-reply-to :subject:cc:to:from:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to; bh=gaSInsvatnEM9FugaobYZf89bZfv2+ZkPQ6th3vgDmg=; b=bEKJvUVHx4OYSKXuJnA0SF7i3UD/tNfJWp0zI4cHDZQkqs9FsUWEyQmydwvbeSOuN3 b3Q1citdwtpBOK25Mfer9mjLN6ovEvcD6tMZFgiVulcEg33NAploEDSyooQ4WFINYo/b MrZ8IPm0dxNYNmAz9LP4R0yES63/g1bGpDjEJU2sh2kVZ4OrhbcMAnRFcz2DW9UdciKw 2n5gWTNIuVTmnadoLpZQL6MEQ7BzMDLdupYiHQ/z/Rk999Wf844ziBRe3zMZ7xNUBgag 9adlp3VZ8mdfZtQq5xcSxn7kc34O0mHW2LPGbREFeKDXsPIpt4Z7r/4krjY23d8D917v +l8A== X-Gm-Message-State: AO0yUKVIOdvU0vbkcSUb+X89kGgQTQDMbCg3o7T4I4rKSY6iWKOzg4bK Y5hR90G8vEnNUZhQ+3dJ23t4S87LBjE= X-Google-Smtp-Source: AK7set/RDx2Q/q8+xQ/wBj0JHpGlpkdHhYTrIvcRnNY52I5ncG20uiJsXzDjRIaDjDFnQ7PFnDPPkA== X-Received: by 2002:a05:600c:997:b0:3eb:432d:8279 with SMTP id w23-20020a05600c099700b003eb432d8279mr729661wmp.13.1677542290782; Mon, 27 Feb 2023 15:58:10 -0800 (PST) Original-Received: from krug (87-196-72-142.net.novis.pt. [87.196.72.142]) by smtp.gmail.com with ESMTPSA id l4-20020a5d4804000000b002c59c6abc10sm8201125wrq.115.2023.02.27.15.58.09 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 27 Feb 2023 15:58:10 -0800 (PST) In-Reply-To: <87v8jmn9ya.fsf@gmx.de> (Michael Albinus's message of "Mon, 27 Feb 2023 21:13:17 +0100") 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:256924 Archived-At: --=-=-= Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Michael Albinus writes: > Jo=C3=A3o T=C3=A1vora writes: > > Hi Jo=C3=A3o, > >> 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: --=-=-= Content-Type: text/plain; charset=utf-8 Content-Disposition: inline; filename=dockerfile Content-Transfer-Encoding: quoted-printable FROM ubuntu:latest RUN apt update && apt install openssh-server sudo openjdk-17-jdk openjdk-1= 7-jre git wget -y # Create a user =E2=80=9Csshuser=E2=80=9D and group =E2=80=9Csshgroup=E2=80= =9D 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 directo= ry by default. COPY id_rsa.pub /home/sshuser/.ssh/authorized_keys # change ownership of the key file.=20 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-rep= ro 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"] --=-=-= Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable 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.=20=20 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=3D/home/sshuser/yacy_search_server/source/net/yacy/y= acy.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-remo= te-path))' \ -f eglot Jo=C3=A3o --=-=-=--