Skip to content

Commit

Permalink
[CI] Support mingw in 32 bits
Browse files Browse the repository at this point in the history
  • Loading branch information
v1v committed Jul 9, 2020
1 parent be0e98a commit b2e1996
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 4 deletions.
14 changes: 11 additions & 3 deletions .ci/scripts/install-tools.bat
Original file line number Diff line number Diff line change
@@ -1,6 +1,13 @@
set GOPATH=%WORKSPACE%
set MAGEFILE_CACHE=%WORKSPACE%\.magefile
set PATH=%WORKSPACE%\bin;C:\ProgramData\chocolatey\bin;C:\tools\mingw64\bin;%PATH%
set PATH=%WORKSPACE%\bin;C:\ProgramData\chocolatey\bin;%PATH%

REM Configure GCC for either 32 or 64 bits
IF EXIST "%PROGRAMFILES(X86)%" (
set PATH=C:\tools\mingw64\bin;%PATH%
) ELSE (
set PATH=C:\tools\mingw32\bin;%PATH%
)

where /q curl
IF ERRORLEVEL 1 (
Expand Down Expand Up @@ -28,14 +35,15 @@ go get github.com/magefile/mage
mage -version
where mage

if not exist C:\Python38\python.exe (
IF not exist C:\Python38\python.exe (
REM Install python 3.8.
choco install python -y -r --no-progress --version 3.8.2 || echo ERROR && exit /b
)
python --version
where python

if not exist C:\tools\mingw64\bin\gcc.exe (
where /q gcc
IF ERRORLEVEL 1 (
REM Install mingw 5.3.0
choco install mingw -y -r --no-progress --version 5.3.0 || echo ERROR && exit /b
)
Expand Down
4 changes: 3 additions & 1 deletion .ci/windows.groovy
Original file line number Diff line number Diff line change
Expand Up @@ -419,14 +419,16 @@ def withBeatsEnvWin(Closure body) {
// NOTE: to support Windows 7 32 bits the arch in the go context path is required.
def arch = is32bit() ? '386' : 'amd64'
def goRoot = "${env.USERPROFILE}\\.gvm\\versions\\go${GO_VERSION}.windows.${arch}"
// NOTE: to support Windows 7 32 bits the arch in the mingw context path is required.
def mingwArch = is32bit() ? '32' : '64'

withEnv([
"HOME=${env.WORKSPACE}",
"DEV_ARCH=${arch}",
"DEV_OS=windows",
"GOPATH=${env.WORKSPACE}",
"GOROOT=${goRoot}",
"PATH=${env.WORKSPACE}\\bin;${goRoot}\\bin;${chocoPath};${chocoPython3Path};C:\\tools\\mingw64\\bin;${env.PATH}",
"PATH=${env.WORKSPACE}\\bin;${goRoot}\\bin;${chocoPath};${chocoPython3Path};C:\\tools\\mingw${mingwArch}\\bin;${env.PATH}",
"MAGEFILE_CACHE=${env.WORKSPACE}\\.magefile",
"TEST_COVERAGE=true",
"RACE_DETECTOR=true",
Expand Down

0 comments on commit b2e1996

Please sign in to comment.