From f10bd1279d1ba49e57eb2fa87605c22b94d631b9 Mon Sep 17 00:00:00 2001 From: Vadim Zeitlin Date: Sat, 25 Nov 2017 15:59:16 +0100 Subject: [PATCH] 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 5f2ccde269278860d7afbe1ca101a1b69370fbfb 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. --- appveyor.yml | 2 +- build/tools/appveyor.bat | 7 +++---- 2 files changed, 4 insertions(+), 5 deletions(-) diff --git a/appveyor.yml b/appveyor.yml index 4dad5245ed..1ce5ccc578 100644 --- a/appveyor.yml +++ b/appveyor.yml @@ -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"} | diff --git a/build/tools/appveyor.bat b/build/tools/appveyor.bat index 373ef3ead9..43135dc7d7 100644 --- a/build/tools/appveyor.bat +++ b/build/tools/appveyor.bat @@ -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.