From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Jim Porter Newsgroups: gmane.emacs.bugs Subject: bug#71655: Eshell external commands do not work under GNU Emacs for Windows Date: Wed, 19 Jun 2024 12:40:12 -0700 Message-ID: References: <86y170oifx.fsf@gnu.org> <86v824ohym.fsf@gnu.org> Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="27700"; mail-complaints-to="usenet@ciao.gmane.io" Cc: 71655@debbugs.gnu.org, james@literate-devops.io To: Eli Zaretskii Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Wed Jun 19 21:42:34 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 1sK1CT-00075j-W2 for geb-bug-gnu-emacs@m.gmane-mx.org; Wed, 19 Jun 2024 21:42:34 +0200 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1sK1Bw-0000su-0i; Wed, 19 Jun 2024 15:42: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 1sK1Bu-0000s9-O0 for bug-gnu-emacs@gnu.org; Wed, 19 Jun 2024 15:41:58 -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 1sK1Bu-0004rW-Fn for bug-gnu-emacs@gnu.org; Wed, 19 Jun 2024 15:41:58 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1sK1Bx-0005KT-OH for bug-gnu-emacs@gnu.org; Wed, 19 Jun 2024 15:42:01 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Jim Porter Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Wed, 19 Jun 2024 19:42:01 +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.171882608520427 (code B ref 71655); Wed, 19 Jun 2024 19:42:01 +0000 Original-Received: (at 71655) by debbugs.gnu.org; 19 Jun 2024 19:41:25 +0000 Original-Received: from localhost ([127.0.0.1]:56548 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1sK1BN-0005JO-Eb for submit@debbugs.gnu.org; Wed, 19 Jun 2024 15:41:25 -0400 Original-Received: from mail-pl1-f169.google.com ([209.85.214.169]:44379) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1sK1BL-0005J7-4A for 71655@debbugs.gnu.org; Wed, 19 Jun 2024 15:41:23 -0400 Original-Received: by mail-pl1-f169.google.com with SMTP id d9443c01a7336-1f9c2847618so1194385ad.1 for <71655@debbugs.gnu.org>; Wed, 19 Jun 2024 12:41:19 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1718826014; x=1719430814; darn=debbugs.gnu.org; h=content-transfer-encoding:in-reply-to:from:references:cc:to :content-language:subject:mime-version:date:message-id:from:to:cc :subject:date:message-id:reply-to; bh=CK8hz4LxEC8FEUSar0dSbTbJ1JKQi4AD6vWGMU0oeJs=; b=DSgyMdDwJa0/X3y2NdleD7GdvXwKQSFe5Md625ZaFtQeJao+X7VBa8I8FxJa8ukTvW QcKrt6X8nCcK5CRxymkojpxPBzK5yFtkKfmGssxSyZTrXJeqze314xz0/mOZRr9YFj0R 7cec3jUoF4REQsbhxJo9znECksYeI51mOF/OW9faHbMM4FZ1Qs9DMa0yjDD/FMCO4k8g V4vFA6RWbiSSKnFAnkf4gicQtXVTYYlcxKZP5e04ga1tZhOmrdByEVwQpXcLUcY/QYtJ Ggrr13S8TCEIbPGktwHxpjR1nV1MuOzLr6NUbJIiKRAJrmci+ovIQEMwMhvvrHQZMX1/ rWYw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1718826014; x=1719430814; h=content-transfer-encoding:in-reply-to:from:references:cc:to :content-language:subject:mime-version:date:message-id :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=CK8hz4LxEC8FEUSar0dSbTbJ1JKQi4AD6vWGMU0oeJs=; b=lp6ngO3MO9ahM49VWOOEmtHgrZTr1XCMujVk9ONGw7vFtGIwAZLbFXWIxbAj9hPxJ0 8QEa3XbO7osuuRf0NYSJ8PLV75gVYJxQAioxL9cPbgb/FEcVa7QTpcwWZw81gBThUsjy ptyqOUrDx5ZXUbe4rsm3EfMoWQgdNfonhyR9AO2EuJOIbGmZK7Nu+IYC1VthmUoAvp7m a+bEUF5yQP+XOpwLbqZDEppgFFML+169N6cMJtHPX2vCUk+VjzY6ZHnHLGUqHRNapD8/ EIJC+JfQ9Gi79QsHMoAMMvUhmG5Ouj/wA3Z+nGsdzEljdH/RQgrj38y2oViVnXNgkL44 4c0w== X-Gm-Message-State: AOJu0Yw04cEgdCa3RTq8jNDd7Wm4u9Tu5G0sI6rU+hgKxF6FNYkr2p00 i/Cr+Mmk9VXmQVwC/Rt6iixWHfV8LT4159/cLzuIHKFhbfj+DjRT X-Google-Smtp-Source: AGHT+IHpJOB0KRyjEBGgfo1MFRwxoCC250F0vj9ubalhHu8lHTyiGDdQJod0tImIfOPxJQhgEDQg3A== X-Received: by 2002:a17:902:c412:b0:1f3:903:5c9a with SMTP id d9443c01a7336-1f9aa46dbebmr35689975ad.58.1718826013632; Wed, 19 Jun 2024 12:40:13 -0700 (PDT) Original-Received: from [192.168.1.2] (syn-023-240-098-037.res.spectrum.com. [23.240.98.37]) by smtp.googlemail.com with ESMTPSA id d9443c01a7336-1f9c3d82d05sm3712355ad.244.2024.06.19.12.40.12 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Wed, 19 Jun 2024 12:40:13 -0700 (PDT) Content-Language: en-US In-Reply-To: <86v824ohym.fsf@gnu.org> 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:287506 Archived-At: On 6/19/2024 12:22 PM, Eli Zaretskii wrote: > 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? It's trying to find a shebang, which I guess(?) is so that Eshell can support shebangs on MS-Windows. What's strange is that 'file-readable-p' is non-nil, but 'insert-file-contents-literally' fails. As far as I understand things, winget.exe isn't exactly a zero-byte file. They're reparse points that point to a real executable living in some locked-down folder, so they're like something symlinks I think? It seems like there's a small bug somewhere in 'insert-file-contents-literally'. On MS-Windows, "cat C:\Users\...\winget.exe" outputs the (binary) contents of winget.exe just fine (this is using the MSYS2 build of cat). So I think the real winget.exe file truly is readable. I don't know why 'insert-file-contents-literally' has a problem with it though. It'd be nice to figure out why that fails and fix it at the source, but on the other hand, maybe this only comes up when trying to read these .exe files? A more-targeted fix could be to just ignore errors in 'eshell-script-interpreter': if we can't insert the file, assume it doesn't have a shebang and try to run it like a normal program (which works fine in Emacs).