[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: With SHELL=cmd, make fails to execute bat file paths starting with .

From: Eli Zaretskii
Subject: Re: With SHELL=cmd, make fails to execute bat file paths starting with ../
Date: Fri, 03 May 2013 22:10:41 +0300

> Date: Fri, 3 May 2013 19:17:37 +0200
> From: Erik Carstensen <address@hidden>
> This makefile reproduces the problem:
> SHELL=cmd.exe
> default:
>     ./x.bat ""
>     ./x.bat
> The first line succeeds on make 3.82, while the second line fails. With
> master, both lines fail (because the first one is short-circuited as well)

The failure should be expected, because cmd.exe does not generally
support forward slashes.  Use .\x.bat instead.

> It seems that the problem happens only when it is a path to a bat file, and
> the path starts with '../' or './'. Other relative paths, or paths with
> backslashes, all work.

As expected.

> I have one suggestion: Rather than pursuing the Sisyphean task to invoke
> CreateProcess correctly on bat files, why don't you just give up the
> short-circuiting for all .bat files, and go through the cmd.exe invocation
> path (i.e., create a temporary bat file with the command invocation)
> whenever argv[0] ends with .bat?

You are welcome to send patches.  But just based on the above example,
I don't yet see any compelling reason to change anything in the
current development sources, because what should work works, and what
shouldn't sometimes doesn't work and sometimes does (because cmd.exe
itself is inconsistent in its support of forward slashes, and that
even changes between Windows versions).

reply via email to

[Prev in Thread] Current Thread [Next in Thread]