make-w32
[Top][All Lists]
Advanced

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

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


From: Erik Carstensen
Subject: With SHELL=cmd, make fails to execute bat file paths starting with ../
Date: Fri, 3 May 2013 19:17:37 +0200

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)

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.

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? That shouldn't affect performance much (a cmd.exe process will be spawned in either case), and it seems that the 4k/8k command-line length limit applies to any invocations of bat files, even when executed directly with CreateProcess.

reply via email to

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