From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED.blaine.gmane.org!not-for-mail From: Juanma Barranquero Newsgroups: gmane.emacs.bugs Subject: bug#36270: executable-find does not find shell commands on MSYS2 Date: Tue, 18 Jun 2019 01:42:29 +0200 Message-ID: Mime-Version: 1.0 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Injection-Info: blaine.gmane.org; posting-host="blaine.gmane.org:195.159.176.226"; logging-data="147255"; mail-complaints-to="usenet@blaine.gmane.org" To: 36270@debbugs.gnu.org Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Tue Jun 18 01:44:13 2019 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([209.51.188.17]) by blaine.gmane.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.89) (envelope-from ) id 1hd1II-000cAb-Kf for geb-bug-gnu-emacs@m.gmane.org; Tue, 18 Jun 2019 01:44:10 +0200 Original-Received: from localhost ([::1]:52648 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.86_2) (envelope-from ) id 1hd1IG-00014n-V3 for geb-bug-gnu-emacs@m.gmane.org; Mon, 17 Jun 2019 19:44:08 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:50087) by lists.gnu.org with esmtp (Exim 4.86_2) (envelope-from ) id 1hd1IB-00014Q-In for bug-gnu-emacs@gnu.org; Mon, 17 Jun 2019 19:44:04 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1hd1IA-0002xh-AQ for bug-gnu-emacs@gnu.org; Mon, 17 Jun 2019 19:44:03 -0400 Original-Received: from debbugs.gnu.org ([209.51.188.43]:58158) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1hd1IA-0002xb-7O for bug-gnu-emacs@gnu.org; Mon, 17 Jun 2019 19:44:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1hd1IA-0000lW-24 for bug-gnu-emacs@gnu.org; Mon, 17 Jun 2019 19:44:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Juanma Barranquero Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Mon, 17 Jun 2019 23:44:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: report 36270 X-GNU-PR-Package: emacs X-Debbugs-Original-To: Bug-Gnu-Emacs Original-Received: via spool by submit@debbugs.gnu.org id=B.15608149912868 (code B ref -1); Mon, 17 Jun 2019 23:44:01 +0000 Original-Received: (at submit) by debbugs.gnu.org; 17 Jun 2019 23:43:11 +0000 Original-Received: from localhost ([127.0.0.1]:43469 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1hd1HL-0000kA-7Y for submit@debbugs.gnu.org; Mon, 17 Jun 2019 19:43:11 -0400 Original-Received: from lists.gnu.org ([209.51.188.17]:59076) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1hd1HJ-0000k1-E5 for submit@debbugs.gnu.org; Mon, 17 Jun 2019 19:43:09 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:49950) by lists.gnu.org with esmtp (Exim 4.86_2) (envelope-from ) id 1hd1HI-0000vo-5N for bug-gnu-emacs@gnu.org; Mon, 17 Jun 2019 19:43:09 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1hd1HG-00027s-OH for bug-gnu-emacs@gnu.org; Mon, 17 Jun 2019 19:43:08 -0400 Original-Received: from mail-qt1-x829.google.com ([2607:f8b0:4864:20::829]:37447) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1hd1HG-000279-Ix for bug-gnu-emacs@gnu.org; Mon, 17 Jun 2019 19:43:06 -0400 Original-Received: by mail-qt1-x829.google.com with SMTP id y57so13101680qtk.4 for ; Mon, 17 Jun 2019 16:43:06 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:from:date:message-id:subject:to :content-transfer-encoding; bh=Z5SygoWcAdLYXycEIHpMjjBuTvR/p/OysI2/ara6I4s=; b=ckwEbNC9OxGxJwpPcgXlUmqxlhjLQQntiHx9xecImHKQh74BnOPLsMQgiLaICBft/3 dtG60OBWv9HQtghgO5cZwxrH5lNTX+eUwvnG4FNfFBmPdYKFLmYJRvd0woSgNycyomGv tE9Ml63BxzkX/J1O7BRkus273abGdJj9cMDxZ5Hk2ii+ewV7uFjyFNWY0TUamYgaFqzc 8T/5T8X0W62bfXij4VVBZ4LmP4nwI6POC4OCThRByw5LLEeMxyI1BCUYEx16ND8Mq/aa 8NiQMfyJ8/ly7n/h8ry4bk2icxNWfcBdii4S+OtI83fz9IZksOf9EcwKF0vZVOp7R0pv hoyA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:from:date:message-id:subject:to :content-transfer-encoding; bh=Z5SygoWcAdLYXycEIHpMjjBuTvR/p/OysI2/ara6I4s=; b=lJFSyMnthFry/l8yHhunkmbvpvSm6VOajcwiWT1Tc9PteW5AX1+HBIPjviG5Ixbv3F fM4Eljbh8eIVlxaGD/Sh33VPKOPSvpzW6vgJrVUw/ijgVjCs+0LIgZMZNlUpvIQamVG9 /Cy4YwgX7bACnmsPb0/DjtpROuKcoce5A351SSbScSHjTX55S4qFP4gtlcAkOvjuyNFk P/B8dsJ/h9X41kUCXjPVs+G45eASPK731BX+wRL7d8mhFSvBxBCadWNdiiShSRgPhAwM yR6E5Vuo/KpzylhAH1D8rvHtOULIm2+2teb+FLQSkCl5mBkhTrD8/NR9jK1V59FwKKuf 5+Xg== X-Gm-Message-State: APjAAAWShHhvsDkdt7Nsfa+ZH5TmUVE16vpDF3+i74Ok5/+WPLSLSY1s 66a5rJkkofJ2X1fjzIKg2SxTJdDPGDqEX52nBj3NXlqIZXU= X-Google-Smtp-Source: APXvYqxRk7dppJQO01/W+gLtOSGd1WaLzL1F7MQLzcKb143qyQnUfe7vZ9g2pBrpSiLw3jq3fRqdAvoEm2OExgwfJS4= X-Received: by 2002:a0c:8a23:: with SMTP id 32mr24655580qvt.231.1560814985604; Mon, 17 Jun 2019 16:43:05 -0700 (PDT) X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 209.51.188.43 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.org@gnu.org Original-Sender: "bug-gnu-emacs" Xref: news.gmane.org gmane.emacs.bugs:160753 Archived-At: c:\Tools\msys64 is the root of my MSYS2 / MingW64 installation. >From the mingw64 console: Juanma@ODIEFAST MINGW64 /d/Devel/emacs/repo/trunk $ mount C:/Tools/msys64 on / type ntfs (binary,noacl,auto) C:/Tools/msys64/usr/bin on /bin type ntfs (binary,noacl,auto) C: on /c type ntfs (binary,noacl,posix=3D0,user,noumount,auto) Juanma@ODIEFAST MINGW64 /d/Devel/emacs/repo/trunk $ which ci /usr/bin/ci Juanma@ODIEFAST MINGW64 /d/Devel/emacs/repo/trunk $ ls -l /usr/bin/ci -rwxr-xr-x 1 Juanma Juanma 806 Jun 1 2017 /usr/bin/ci Juanma@ODIEFAST MINGW64 /d/Devel/emacs/repo/trunk $ file /usr/bin/ci /usr/bin/ci: POSIX shell script, ASCII text executable Juanma@ODIEFAST MINGW64 /d/Devel/emacs/repo/trunk $ ci --version ci (GNU RCS) 5.9.4 Copyright (C) 2010-2017 Thien-Thi Nguyen Copyright (C) 1990-1995 Paul Eggert Copyright (C) 1982,1988,1989 Walter F. Tichy, Purdue CS License GPLv3+: GNU GPL version 3 or later This is free software: you are free to change and redistribute it. There is NO WARRANTY, to the extent permitted by law. Then, from Emacs (master or release branch): ELISP> (setq shell-file-name "c:/Tools/msys64/usr/bin/bash.exe") "c:/Tools/msys64/usr/bin/bash.exe" ELISP> (shell-command-to-string "ci --version") "ci (GNU RCS) 5.9.4 Copyright (C) 2010-2017 Thien-Thi Nguyen Copyright (C) 1990-1995 Paul Eggert Copyright (C) 1982,1988,1989 Walter F. Tichy, Purdue CS License GPLv3+: GNU GPL version 3 or later This is free software: you are free to change and redistribute it. There is NO WARRANTY, to the extent permitted by law. " ELISP> (executable-find "ci") nil ELISP> (locate-file "ci" exec-path exec-suffixes) "c:/Tools/msys64/usr/bin/ci" ELISP> (locate-file "ci" exec-path exec-suffixes 1) nil executable-find passes 1 to locate-file: ;; Use 1 rather than file-executable-p to better match the ;; behavior of call-process. (let ((default-directory (file-name-quote default-directory 'top))) (locate-file command exec-path exec-suffixes 1)))) Now, it is true that call-process will not find the shell command: ELISP> (call-process "c:/Tools/msys64/usr/bin/ci" nil t) *** Eval error *** Searching for program: No such file or directory, c:/Tools/msys64/usr/bin/ci but 'executable-find' is not defined in terms of call-process, but finding commands in the exec-path: (executable-find COMMAND &optional REMOTE) Search for COMMAND in =E2=80=98exec-path=E2=80=99 and return the absolute f= ile name. Return nil if COMMAND is not found anywhere in =E2=80=98exec-path=E2=80=99. so there's at least some tension between these two interpretations, IMO. It's weird that you can make shell-command to execute a program (with a relative, not absolute, name, like "ci"), and yet executable-find fails to find it in the exec-path, where it, in fact, is located.