Description
./configure
for -msvc freely interchanges between windows/msys commands, which results in it being quite fragile: it's a good idea to treat msys as a purely unix-like environment, and then have a single escape-hatch to execute windows commands (eg. via cmd).
Ways this can currently break (these are just the ones I personally ran into):
- Having cmake installed in msys. The msys version of cmake does not support visual studio - this is by design: http://www.cmake.org/Bug/view.php?id=14797
- Having a program/script named
reg
on the path. This will cause./configure
's reg invocations to fail, as it expects them to call the windowsreg
utility. - Not having msys inherit PATH from windows: this is perfectly valid, and was at one point required to build rust in msys, if rust was installed on PATH in windows.
- In several places, the escaping is broken and only works by chance. For example, on this line
include_path=$(cmd /c "\"$vcvarsall\" $msvc_part && cmd /c echo %INCLUDE%")
, msys path conversion will convert/c
intoC:\
, and the value of%INCLUDE%
will not include the additions thatvcvarsall
would normally make. As yet, I've been unable to determine the correct escape sequence to use (//c
will produce the desired/c
, but that will uncover a host of new escaping issues...)
The quick way to solve most of these problems is to run all commands intended to run in the windows environment via cmd
: this eliminates potential for conflicts to a single item, cmd
, and will ensure those commands find the windows versions of programs. However it does not solve the escaping issue.
Moving to a cargo-based build system and dropping the msys dependency altogether will of course fix this much more effectively!