Subject: Re: bug#71446: 30.0.50; em-extpipe-test-14 fails on MS-Windows
From: Eli Zaretskii <[email-masked]>
To: Jim Porter <[email-masked]>
Cc: [email-masked], [email-masked]
Date: Sat, 15 Jun 2024 12:34:17 +0300
List-Id: <debbugs-submit.debbugs.gnu.org>

> Date: Sun, 9 Jun 2024 14:03:18 -0700
> From: Jim Porter <[email-masked]>
> Cc: [email-masked]
> 
> On 6/8/2024 10:22 PM, Eli Zaretskii wrote:
> > The failure is as follows:
> [snip]
> >    Test em-extpipe-test-14 condition:
> >        Command logs: command: "tac *<c:/Users/EliZ/AppData/Local/Temp/emacs-test-hYLZuB-em-extpipe"
> > 
> > 		    ----------------------------------------
> > 		    [process] started external process `cmdproxy.exe'
> > 
> > 		    d\:/gnu/git/emacs/trunk/nt/cmdproxy.exe -c tac\ \<c\:/Users/EliZ/AppData/Local/Temp/emacs-test-hYLZuB-em-extpipe
> > 		    ----------------------------------------
> > 		    [process] received output from process `cmdproxy.exe'
> > 
> > 		    tac: standard input: read error
> > 
> > 		    ----------------------------------------
> > 		    [process] sentinel for external process `cmdproxy.exe': "exited abnormally with code 1
> > 		    "
> > 		    ----------------------------------------
> > 		    [process] finished external process `cmdproxy.exe'
> [snip]
> > 
> > AFAIU, the problem is that this invokes 'tac' with redirection, but
> > the redirected file name uses Unix-style forward slashes, which
> > doesn't work on Windows: the file name after "<" must use backslashes.
> 
> Are you sure? I tested on an MS-Windows system (no dev env there, but I 
> can run pre-built programs), and forward slashes seem ok.

You are right, they've probably changed this silently in the recent
Windows versions.  It definitely didn't work on Windows XP.

> I ran the 
> following without issue inside cmd.exe:
> 
>    tac <C:/Users/Jim/Documents/file.txt
> 
>    cmdproxy.exe -c "tac <C:/Users/Jim/Documents/file.txt"

Yes, it works outside of Emacs, so now the problem seems to be in the
other obscure details of this test, see below.

> > I also don't understand all those backslashes in
> > 
> >    d\:/gnu/git/emacs/trunk/nt/cmdproxy.exe -c tac\ \<c\:/Users/EliZ/AppData/Local/Temp/emacs-test-hYLZuB-em-extpipe
> > 
> > Are they real or just some artifact of printing the command?  If they
> > are real, and included in the command line, then perhaps my analysis
> > is incorrect and there are more fundamental problems here.
> 
> Those should just be an artifact of printing the command. I've changed 
> that logging to use the current system's quoting style, so you should 
> hopefully see something like the following in the logs now:
> 
>    "d:/gnu/[...]/cmdproxy.exe" "-c" "tac 
> <c:/[...]/emacs-test-hYLZuB-em-extpipe"

I now see this:

      Command logs: command: "tac *<c:/Users/EliZ/AppData/Local/Temp/emacs-test-vPFymJ-em-extpipe"

		    ----------------------------------------
		    [process] started external process `cmdproxy.exe'

		    "d:/gnu/git/emacs/trunk/nt/cmdproxy.exe" "-c" "tac <c:/Users/EliZ/AppData/Local/Temp/emacs-test-vPFymJ-em-extpipe"
		    ----------------------------------------
		    [process] received output from process `cmdproxy.exe'

		    tac: standard input: read error

		    ----------------------------------------
		    [process] sentinel for external process `cmdproxy.exe': "exited abnormally with code 1
		    "
		    ----------------------------------------
		    [process] finished external process `cmdproxy.exe'

So 'tac' still fails.  But the problem seems to be that running the
tests invokes MSYS tac.exe; if I move it out of the way (which then
invokes the native MinGW port of 'tac'), the test passes.  So I think
we can safely close this bug now.