From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Eli Zaretskii Newsgroups: gmane.emacs.bugs Subject: bug#71655: Eshell external commands do not work under GNU Emacs for Windows Date: Wed, 19 Jun 2024 22:22:57 +0300 Message-ID: <86v824ohym.fsf@gnu.org> References: <86y170oifx.fsf@gnu.org> Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="8284"; mail-complaints-to="usenet@ciao.gmane.io" Cc: 71655@debbugs.gnu.org, james@literate-devops.io To: Jim Porter Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Wed Jun 19 21:24:31 2024 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 1sK0v0-0001ya-64 for geb-bug-gnu-emacs@m.gmane-mx.org; Wed, 19 Jun 2024 21:24:30 +0200 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1sK0uW-00031j-K6; Wed, 19 Jun 2024 15:24:00 -0400 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 1sK0uV-00031G-2s for bug-gnu-emacs@gnu.org; Wed, 19 Jun 2024 15:23:59 -0400 Original-Received: from debbugs.gnu.org ([2001:470:142:5::43]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1sK0uU-0001Oi-RH for bug-gnu-emacs@gnu.org; Wed, 19 Jun 2024 15:23:58 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1sK0uY-0004iz-5z for bug-gnu-emacs@gnu.org; Wed, 19 Jun 2024 15:24:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Eli Zaretskii Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Wed, 19 Jun 2024 19:24:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 71655 X-GNU-PR-Package: emacs Original-Received: via spool by 71655-submit@debbugs.gnu.org id=B71655.171882499418067 (code B ref 71655); Wed, 19 Jun 2024 19:24:02 +0000 Original-Received: (at 71655) by debbugs.gnu.org; 19 Jun 2024 19:23:14 +0000 Original-Received: from localhost ([127.0.0.1]:55986 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1sK0tl-0004hJ-Tp for submit@debbugs.gnu.org; Wed, 19 Jun 2024 15:23:14 -0400 Original-Received: from eggs.gnu.org ([209.51.188.92]:48430) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1sK0tj-0004h4-58 for 71655@debbugs.gnu.org; Wed, 19 Jun 2024 15:23:12 -0400 Original-Received: from fencepost.gnu.org ([2001:470:142:3::e]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1sK0ta-0001By-50; Wed, 19 Jun 2024 15:23:02 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=References:Subject:In-Reply-To:To:From:Date: mime-version; bh=cEapNk13+5TnRByDwAPwb5e9v2yh7nMl8DriVLMND8Y=; b=HjWPadIEwrBT MrJWFw+5ZRpjvShte827f/yTYLesmuCKwr8l4SocDig9W4rG8rqUO/RIHeNY5HaVerPSDwzoT7iH4 uxI8Gt+ZOIOmsWW39GX8b8/vM1dzWdEqxNq0npWs0JYfzwW4IoKJ4NUsiFfjoSZbyzOK3VGm80vX+ HHiOQZHEiC4huZeOGPta6Pz28o7WBovR62qSWXdXXPBWKSo0Jhts+T83Uodvv2Sexq3z4y5rkIuI1 WP9QaHEN6EH060dUsKiDk5KDPFh6/cw4yMIPG35GI1XDYhDam0fA1RJtlLJUxPBPdpoSmigUYk36I IXS+kR+LCV6z529czmCj/A==; In-Reply-To: <86y170oifx.fsf@gnu.org> (message from Eli Zaretskii on Wed, 19 Jun 2024 22:12:34 +0300) 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:287502 Archived-At: > Cc: 71655@debbugs.gnu.org > Date: Wed, 19 Jun 2024 22:12:34 +0300 > From: Eli Zaretskii > > (Eshell) $ ls -l C:/Users/MyUser/AppData/Local/Microsoft/WindowsApps/winget.exe > > What do you see? Does what you see explain the error? > > I think this page explains what is going on: > > https://stackoverflow.com/questions/58296925/what-is-zero-byte-executable-files-in-windows That being said, both M-! and call-process succeed in invoking this "program" okay, so there's something Eshell does that gets in the way. Here's the backtrace from the error: Debugger entered--Lisp error: (file-error "Opening input file" "Invalid argument" "C:/Users/EliZ/AppData/Local/Microsoft/WindowsApps/winget.exe") insert-file-contents("C:/Users/EliZ/AppData/Local/Microsoft/WindowsApps/winget.exe" nil 0 256 nil) insert-file-contents-literally("C:/Users/EliZ/AppData/Local/Microsoft/WindowsApps/winget.exe" nil 0 256) eshell-script-interpreter("C:/Users/EliZ/AppData/Local/Microsoft/WindowsApps/winget.exe") eshell-find-interpreter("winget" ("--help") nil) eshell-connection-local-command("winget" ("--help")) eshell-external-command("winget" ("--help")) eshell-plain-command("winget" ("--help")) eshell-named-command("winget" ("--help")) eval((eshell-named-command '"winget" '("--help"))) eshell-do-eval((eshell-named-command '"winget" '("--help")) nil) eshell-do-eval((unwind-protect (eshell-named-command '"winget" '("--help")) (mapc #'funcall eshell-this-command-hook)) nil) #f(compiled-function () #)() funcall(#f(compiled-function () #)) (let ((eshell-this-command-hook '(ignore))) (funcall '#f(compiled-function () #))) eval((let ((eshell-this-command-hook '(ignore))) (funcall '#f(compiled-function () #)))) eshell-do-eval((let ((eshell-this-command-hook '(ignore))) (unwind-protect (eshell-named-command '"winget" '("--help")) (mapc #'funcall eshell-this-command-hook))) nil) (condition-case err (eshell-do-eval '(let ((eshell-this-command-hook '(ignore))) (unwind-protect (eshell-named-command '"winget" '("--help")) (mapc #'funcall eshell-this-command-hook))) nil) ((debug error) (eshell-errorn (error-message-string err)) (eshell-close-handles 1))) eval((condition-case err (eshell-do-eval '(let ((eshell-this-command-hook '...)) (unwind-protect (eshell-named-command '"winget" '...) (mapc #'funcall eshell-this-command-hook))) nil) ((debug error) (eshell-errorn (error-message-string err)) (eshell-close-handles 1)))) eshell-do-eval((condition-case err (eshell-do-eval '(let ((eshell-this-command-hook '...)) (unwind-protect (eshell-named-command '"winget" '...) (mapc #'funcall eshell-this-command-hook))) nil) ((debug error) (eshell-errorn (error-message-string err)) (eshell-close-handles 1))) nil) eshell-do-eval((condition-case err (eshell-do-eval '(let ((eshell-this-command-hook '...)) (unwind-protect (eshell-named-command '"winget" '...) (mapc #'funcall eshell-this-command-hook))) nil) ((debug error) (eshell-errorn (error-message-string err)) (eshell-close-handles 1))) nil) #f(compiled-function () #)() funcall(#f(compiled-function () #)) (let ((eshell-current-handles '[nil (((t) . 2) t) (((t) . 2) t)])) (funcall '#f(compiled-function () #))) eval((let ((eshell-current-handles '[nil ((... . 2) t) ((... . 2) t)])) (funcall '#f(compiled-function () #)))) eshell-do-eval((let ((eshell-current-handles '[nil ((... . 2) t) ((... . 2) t)])) (condition-case err (eshell-do-eval '(let ((eshell-this-command-hook ...)) (unwind-protect (eshell-named-command ... ...) (mapc ... eshell-this-command-hook))) nil) ((debug error) (eshell-errorn (error-message-string err)) (eshell-close-handles 1)))) nil) eshell-do-eval((progn (let ((eshell-current-handles '[nil (... t) (... t)])) (condition-case err (eshell-do-eval '(let (...) (unwind-protect ... ...)) nil) ((debug error) (eshell-errorn (error-message-string err)) (eshell-close-handles 1))))) nil) eshell-do-eval((unwind-protect (progn (let ((eshell-current-handles '[nil ... ...])) (condition-case err (eshell-do-eval '(let ... ...) nil) ((debug error) (eshell-errorn (error-message-string err)) (eshell-close-handles 1))))) (run-hooks 'eshell-post-command-hook)) nil) eshell-do-eval((progn 'nil (unwind-protect (progn (let ((eshell-current-handles '...)) (condition-case err (eshell-do-eval '... nil) ((debug error) (eshell-errorn ...) (eshell-close-handles 1))))) (run-hooks 'eshell-post-command-hook))) nil) #f(compiled-function () #)() funcall(#f(compiled-function () #)) (let ((eshell-current-handles '[nil (((t) . 2) t) (((t) . 2) t)]) (eshell-current-subjob-p 'nil)) (funcall '#f(compiled-function () #))) eval((let ((eshell-current-handles '[nil ((... . 2) t) ((... . 2) t)]) (eshell-current-subjob-p 'nil)) (funcall '#f(compiled-function () #)))) eshell-do-eval((let ((eshell-current-handles '[nil ((... . 2) t) ((... . 2) t)]) eshell-current-subjob-p) (progn 'nil (unwind-protect (progn (let ((eshell-current-handles ...)) (condition-case err (eshell-do-eval ... nil) (... ... ...)))) (run-hooks 'eshell-post-command-hook))))) eshell-resume-eval((nil (let ((eshell-current-handles '[nil (... t) (... t)]) eshell-current-subjob-p) (progn 'nil (unwind-protect (progn (let (...) (condition-case err ... ...))) (run-hooks 'eshell-post-command-hook)))) nil)) eshell-eval-command((let ((eshell-current-handles '[nil ((... . 2) t) ((... . 2) t)]) eshell-current-subjob-p) (progn 'nil (unwind-protect (progn (let ((eshell-current-handles ...)) (condition-case err (eshell-do-eval ... nil) (... ... ...)))) (run-hooks 'eshell-post-command-hook)))) "winget --help") eshell-send-input(nil) funcall-interactively(eshell-send-input nil) call-interactively(eshell-send-input nil nil) command-execute(eshell-send-input) Jim, why does Eshell want to read the executable file winget.exe? If that's because it wants to find the signature by which it will deduce the interpreter, then doing that for zero-size files is not useful, and should probably be skipped?