Remove the correct directory from PATH for MinGW AppVeyor builds

We need to remove the directory containing sh.exe from the PATH as
otherwise mingw32-make seems to use it and not cmd.exe for executing the
commands in the makefile, but the wrong directory was being removed in
appveyor.yml, having no effect.

Fix this and undo 5f2ccde269 which
compensated for it by (almost) clearing the PATH entirely which, in
turn, broke one of our unit tests (and could break other things in the
future, as having an empty PATH is rather unexpected).

Also use the full path for head program now that its directory is not in
the PATH any more. Alternative could be to use PowerShell, but while

powershell -Command "'gcc','mingw32-make','ar'|%%{ iex \"$_ --version\"|select -first 1 }"

does work, it looks really ugly, so avoid it for now.

See https://github.com/wxWidgets/wxWidgets/pull/142

See #17274.
This commit is contained in:
Vadim Zeitlin 2017-11-25 15:59:16 +01:00
parent 4e4617a9e6
commit f10bd1279d
2 changed files with 4 additions and 5 deletions

View File

@ -33,7 +33,7 @@ install: git submodule update --init
before_build:
- ps: |
$env:PATH = $env:PATH -replace "C:\\Program Files \(x86\)\\Git\\bin",""
$env:PATH = $env:PATH -replace "C:\\Program Files\\Git\\usr\\bin",""
if (($env:compiler -ne "msys2") -and ($env:compiler -ne "cygwin")) {
gc include\wx\msw\setup0.h |
%{$_ -replace "define wxUSE_STL 0", "define wxUSE_STL $env:wxUSE_STL"} |

View File

@ -20,10 +20,9 @@ goto :eof
cd build\msw
path C:\MinGW\bin;%path%
echo --- Tools versions:
g++ --version | head -1
mingw32-make --version | head -1
ar --version | head -1
path C:\MinGW\bin;
g++ --version | "C:\Program Files\Git\usr\bin\head" -n 1
mingw32-make --version | "C:\Program Files\Git\usr\bin\head" -n 1
ar --version | "C:\Program Files\Git\usr\bin\head" -n 1
echo.
echo --- Starting the build
echo.