From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.ciao.gmane.io!not-for-mail From: yyoncho Newsgroups: gmane.emacs.devel Subject: Re: tramp and executable-find Date: Sat, 20 Jun 2020 21:27:38 +0300 Message-ID: References: <871rm9u5hw.fsf@gmail.com> <87blldzntb.fsf@gmx.de> <877dw1zl8y.fsf@gmx.de> Mime-Version: 1.0 Content-Type: multipart/alternative; boundary="000000000000c5772405a8882ae9" Injection-Info: ciao.gmane.io; posting-host="ciao.gmane.io:159.69.161.202"; logging-data="1094"; mail-complaints-to="usenet@ciao.gmane.io" Cc: emacs-devel To: Michael Albinus Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Sat Jun 20 20:28:30 2020 Return-path: Envelope-to: ged-emacs-devel@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 1jmiEA-00008y-Bf for ged-emacs-devel@m.gmane-mx.org; Sat, 20 Jun 2020 20:28:30 +0200 Original-Received: from localhost ([::1]:34572 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jmiE9-00037e-EI for ged-emacs-devel@m.gmane-mx.org; Sat, 20 Jun 2020 14:28:29 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:60400) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1jmiDZ-0002fM-KI for emacs-devel@gnu.org; Sat, 20 Jun 2020 14:27:53 -0400 Original-Received: from mail-lj1-x22b.google.com ([2a00:1450:4864:20::22b]:37298) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1jmiDX-0004h7-Q8 for emacs-devel@gnu.org; Sat, 20 Jun 2020 14:27:53 -0400 Original-Received: by mail-lj1-x22b.google.com with SMTP id e4so15044830ljn.4 for ; Sat, 20 Jun 2020 11:27:51 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=IRTSR6McxkbqEndWZSY4WnxRQfbHfxD/L8L99+nP9Cg=; b=DUQSS2I6YIHxRO7DhW8/MZ6ZjyCCEat3ZjjTO/HOA0cno4J/bhpRje5Q92K7OGJ5/h xK9DmAU2yv1dSlYYIkmXR5IKxOB4sTYSeQ5qDhgYcHNBzIlYAEsr1+YC3LWUMD2ydip7 +0HqEQh02fUEh3BCm54ZI7Tn9b8Tc8XZP/OpSFSPttEyZkvjAbZwnAFpu3OWCbBmzARf 0IaLSaJblr8NwaO66ohOvBRH6hzhghav0g856wCQ+wI/3TLhwu5dm2ZKSv0HGBIvjnyV c23bsMSBDYGNztx1sy/seA7KuDzhrTovDkO6Oa/dxDdTDDdbgDlPAjGUCO1dCJujScrm ezfw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=IRTSR6McxkbqEndWZSY4WnxRQfbHfxD/L8L99+nP9Cg=; b=mgkrhP7wurS35AMSROniq0Jii/Mdh3fgegn8mZTgBODlSSgAJjWA7N5+eHIiwxSxcs LP1CASC48B7I7V7XaNiqOtO7Nr8l+q6HjOM2JJ7YnoD1vBKfiA5NAuREYUQnoXNYOiEa KTR2yoH/4fa/gsFtr05pId89U9B7fgBFhiRz7aCCauZEkQIMsuLN4TTKW+r8gMC33nGR b1LGeCJ4ruM/8Gqt3Yjd+C1KzBV+SigDZdKHwpDOsUWz4yC4ny0YG8biX1BjyUvXjvnS 7Rr9of6w4AUYQ6oi5NB7wPhuYvPr8GIb3Lm2zizov9RC7+Eb6EIdmsEAYgeaN6lkS+k8 wC+Q== X-Gm-Message-State: AOAM530WcodNRVt62M310IXOtaPjI++ofvstZN9DSfhLDoPo5aHnjXEi EBdp/FGUUl9yanaWtmTQvc+7v4+wvINKsW0o1VmbL/Um X-Google-Smtp-Source: ABdhPJz5myvzM7t1wwuTor9h1rgu9hom0GVWv7pogOTLldSn+g37Dd5bfvT6v5we6mQjhSgc7WkUChrYCxf9EugBv6I= X-Received: by 2002:a2e:8ec9:: with SMTP id e9mr4879346ljl.152.1592677670152; Sat, 20 Jun 2020 11:27:50 -0700 (PDT) In-Reply-To: Received-SPF: pass client-ip=2a00:1450:4864:20::22b; envelope-from=yyoncho@gmail.com; helo=mail-lj1-x22b.google.com X-detected-operating-system: by eggs.gnu.org: No matching host in p0f cache. That's all we know. X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_FROM=0.001, HTML_MESSAGE=0.001, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=_AUTOLEARN X-Spam_action: no action X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Original-Sender: "Emacs-devel" Xref: news.gmane.io gmane.emacs.devel:252455 Archived-At: --000000000000c5772405a8882ae9 Content-Type: text/plain; charset="UTF-8" Here it is an example: Copy ls from /bin/ and name it lss. Then: ;; works (let ((default-directory "")) (executable-find "lss" 'remote)) ;; does not work (let ((default-directory "")) (executable-find "/bin/lss" 'remote)) Thanks, Ivan On Sat, Jun 20, 2020 at 9:23 PM yyoncho wrote: > Hi Michael, > > The examples that do not work on my side are when using a full > file path when the binary is not on remote PATH. > > Thanks, > Ivan > > On Sat, Jun 20, 2020 at 8:43 PM Michael Albinus > wrote: > >> yyoncho writes: >> >> > Hi Michael, >> >> Hi Ivan, >> >> > Can you comment on remote flag mentioned by Philip as well? >> > >> > Here it is the docs for it: >> > >> > REMOTE is non-nil, search on the remote host indicated by >> > `default-directory' instead. >> >> Right, I forgot this. Sorry. So let's go back to your question: >> >> >> As part of investigating >> >> https://github.com/emacs-lsp/lsp-mode/issues/1688 I noticed that >> >> executable-find does not return the binary when it is not on the >> >> remote PATH(or at least this is what I see) even if you specify the >> >> full path to the binary. Can you comment if this is the expected >> >> behaviour? >> >> The crucial point is `default-directory'. In my local environment, I >> have for example >> >> --8<---------------cut here---------------start------------->8--- >> (let ((default-directory "/tmp")) >> (executable-find "emacs")) >> "/usr/local/bin/emacs" >> >> (let ((default-directory "/tmp")) >> (executable-find "emacs" 'remote)) >> "/usr/local/bin/emacs" >> >> (let ((default-directory "/ssh:ford:")) >> (executable-find "emacs")) >> "/usr/local/bin/emacs" >> >> (let ((default-directory "/ssh:ford:")) >> (executable-find "emacs" 'remote)) >> "/opt/bin/emacs" >> --8<---------------cut here---------------end--------------->8--- >> >> You get the remote path only if `default-directory' is a remote file >> name, and the REMOTE argument of `executable-find' is non-nil. And this >> is understandable: if `default-directory' is not a remote file name, >> `executable-find' does not know which remote host it shall use for search. >> >> > Thanks, >> > Ivan >> >> Best regards, Michael. >> > --000000000000c5772405a8882ae9 Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable
Here it is an example:

Copy ls from /bi= n/ and name it lss.

Then:

;; works=C2=A0
(let ((default-directory "<remote-path>"= ))
=C2=A0 (executable-find "lss" 'remote))=C2=A0
=

;; does not work
(let ((default-director= y "<remote-path>"))
=C2=A0 (executable-find "/bin/l= ss" 'remote))

Thanks,
Ivan
On Sat, Jun 20, 2020 at 9:23 PM yyoncho <yyoncho@gmail.com> wrote:
Hi Michael,

The examples that do not work on my side are when using a full
=
file path when the binary is not on remote PATH.

<= div>Thanks,
Ivan

On Sat, Jun 20, 2020 at 8:43 PM Michael Alb= inus <michae= l.albinus@gmx.de> wrote:
yyoncho <yyoncho@gmail.com> writes:

> Hi Michael,

Hi Ivan,

> Can you comment on remote flag mentioned by Philip as well?
>
> Here it is the docs for it:
>
> REMOTE is non-nil, search on the remote host indicated by
> `default-directory' instead.

Right, I forgot this. Sorry. So let's go back to your question:

>> As part of investigating
>> https://github.com/emacs-lsp/lsp-mode/iss= ues/1688 I noticed that
>> executable-find does not return the binary when it is not on the >> remote PATH(or at least this is what I see) even if you specify th= e
>> full path to the binary. Can you comment if this is the expected >> behaviour?

The crucial point is `default-directory'. In my local environment, I have for example

--8<---------------cut here---------------start------------->8---
(let ((default-directory "/tmp"))
=C2=A0 (executable-find "emacs"))
"/usr/local/bin/emacs"

(let ((default-directory "/tmp"))
=C2=A0 (executable-find "emacs" 'remote))
"/usr/local/bin/emacs"

(let ((default-directory "/ssh:ford:"))
=C2=A0 (executable-find "emacs"))
"/usr/local/bin/emacs"

(let ((default-directory "/ssh:ford:"))
=C2=A0 (executable-find "emacs" 'remote))
"/opt/bin/emacs"
--8<---------------cut here---------------end--------------->8---

You get the remote path only if `default-directory' is a remote file name, and the REMOTE argument of `executable-find' is non-nil. And this=
is understandable: if `default-directory' is not a remote file name, `executable-find' does not know which remote host it shall use for sear= ch.

> Thanks,
> Ivan

Best regards, Michael.
--000000000000c5772405a8882ae9--