2018-10-10 15:44:36 +02:00
|
|
|
version: 1.0.{build}
|
|
|
|
|
|
|
|
clone_depth: 50
|
|
|
|
|
2018-12-12 01:26:21 +01:00
|
|
|
# Appveyor images are named after the Visual Studio version they contain.
|
|
|
|
# But we compile using MinGW, not Visual Studio.
|
|
|
|
# We use these images because they have different Windows versions.
|
2018-11-05 07:21:58 +01:00
|
|
|
image:
|
2019-10-20 11:39:48 +02:00
|
|
|
# Windows Server 2019
|
|
|
|
- Visual Studio 2019
|
2019-02-27 22:40:15 +01:00
|
|
|
# Windows Server 2012 R2
|
|
|
|
- Visual Studio 2015
|
2018-11-05 07:21:58 +01:00
|
|
|
|
2018-10-10 15:44:36 +02:00
|
|
|
environment:
|
|
|
|
compiler: mingw
|
|
|
|
|
|
|
|
matrix:
|
|
|
|
- target: i686-w64-mingw32
|
|
|
|
compiler_path: mingw32
|
|
|
|
mingw_prefix: mingw-w64-i686
|
2020-03-14 15:15:19 +01:00
|
|
|
hardening: --enable-all-bugs-are-fatal
|
2018-10-10 15:44:36 +02:00
|
|
|
- target: x86_64-w64-mingw32
|
|
|
|
compiler_path: mingw64
|
|
|
|
mingw_prefix: mingw-w64-x86_64
|
2018-11-15 09:57:39 +01:00
|
|
|
# hardening doesn't work with mingw-w64-x86_64-gcc, because it's gcc 8
|
2018-10-10 15:44:36 +02:00
|
|
|
hardening: --disable-gcc-hardening
|
|
|
|
|
2019-02-27 07:11:47 +01:00
|
|
|
matrix:
|
|
|
|
# Don't keep building failing jobs
|
|
|
|
fast_finish: true
|
2019-10-20 11:39:48 +02:00
|
|
|
# Skip the 32-bit Windows Server 2019 job, and the 64-bit Windows Server
|
2019-02-27 07:11:47 +01:00
|
|
|
# 2012 R2 job, to speed up the build.
|
|
|
|
# The environment variables must be listed without the 'environment' tag.
|
|
|
|
exclude:
|
2019-10-20 11:39:48 +02:00
|
|
|
- image: Visual Studio 2019
|
2019-02-27 07:11:47 +01:00
|
|
|
target: i686-w64-mingw32
|
|
|
|
compiler_path: mingw32
|
|
|
|
mingw_prefix: mingw-w64-i686
|
2020-03-14 15:15:19 +01:00
|
|
|
hardening: --enable-all-bugs-are-fatal
|
2019-02-27 07:11:47 +01:00
|
|
|
- image: Visual Studio 2015
|
|
|
|
target: x86_64-w64-mingw32
|
|
|
|
compiler_path: mingw64
|
|
|
|
mingw_prefix: mingw-w64-x86_64
|
|
|
|
# hardening doesn't work with mingw-w64-x86_64-gcc, because it's gcc 8
|
|
|
|
hardening: --disable-gcc-hardening
|
|
|
|
|
2018-10-10 15:44:36 +02:00
|
|
|
install:
|
|
|
|
- ps: >-
|
|
|
|
Function Execute-Command ($commandPath)
|
|
|
|
{
|
|
|
|
& $commandPath $args 2>&1
|
|
|
|
if ( $LastExitCode -ne 0 ) {
|
|
|
|
$host.SetShouldExit( $LastExitCode )
|
|
|
|
}
|
|
|
|
}
|
|
|
|
Function Execute-Bash ()
|
|
|
|
{
|
|
|
|
Execute-Command 'c:\msys64\usr\bin\bash' '-e' '-c' $args
|
|
|
|
}
|
2018-11-15 09:57:39 +01:00
|
|
|
<# mingw packages start with ${env:mingw_prefix}
|
|
|
|
# unprefixed packages are from MSYS2, which is like Cygwin. Avoid them.
|
|
|
|
#
|
|
|
|
# Use pacman --debug to show package downloads and install locations
|
2020-03-19 08:35:49 +01:00
|
|
|
#
|
|
|
|
# All installed library dlls must be copied to the test and app
|
|
|
|
# directories, before running tor's tests. (See below.)
|
2018-11-15 09:57:39 +01:00
|
|
|
#>
|
2020-06-02 15:07:54 +02:00
|
|
|
Execute-Command "C:\msys64\usr\bin\pacman" -Syu --verbose --noconfirm pacman ;
|
|
|
|
- ps: >-
|
2019-11-11 03:56:08 +01:00
|
|
|
Execute-Command "C:\msys64\usr\bin\pacman" -Sy --verbose --needed --noconfirm ${env:mingw_prefix}-libevent ${env:mingw_prefix}-openssl ${env:mingw_prefix}-pkg-config ${env:mingw_prefix}-xz ${env:mingw_prefix}-zstd ;
|
2018-10-10 15:44:36 +02:00
|
|
|
|
|
|
|
build_script:
|
|
|
|
- ps: >-
|
|
|
|
if ($env:compiler -eq "mingw") {
|
2018-11-15 09:57:39 +01:00
|
|
|
<# use the MSYS2 compiler and user binaries to build and install #>
|
2018-10-10 15:44:36 +02:00
|
|
|
$oldpath = ${env:Path} -split ';'
|
|
|
|
$buildpath = @("C:\msys64\${env:compiler_path}\bin", "C:\msys64\usr\bin") + $oldpath
|
|
|
|
$env:Path = @($buildpath) -join ';'
|
|
|
|
$env:build = @("${env:APPVEYOR_BUILD_FOLDER}", $env:target) -join '\'
|
|
|
|
Set-Location "${env:APPVEYOR_BUILD_FOLDER}"
|
|
|
|
Execute-Bash 'autoreconf -i'
|
|
|
|
mkdir "${env:build}"
|
|
|
|
Set-Location "${env:build}"
|
|
|
|
Execute-Bash "which ${env:target}-gcc"
|
|
|
|
Execute-Bash "${env:target}-gcc --version"
|
2018-11-15 09:57:39 +01:00
|
|
|
<# compile for mingw
|
|
|
|
# mingw zstd doesn't come with a pkg-config file, so we manually
|
|
|
|
# configure its flags. liblzma just works.
|
|
|
|
#>
|
2020-07-07 15:20:28 +02:00
|
|
|
Execute-Bash "ZSTD_CFLAGS='-L/${env:compiler_path}/include' ZSTD_LIBS='-L/${env:compiler_path}/lib -lzstd' ../configure --prefix=/${env:compiler_path} --build=${env:target} --host=${env:target} --with-openssl-dir=/${env:compiler_path} --disable-asciidoc --enable-fatal-warnings ${env:hardening} CFLAGS='-D__USE_MINGW_ANSI_STDIO=0'"
|
2019-09-23 21:04:54 +02:00
|
|
|
Execute-Bash "V=1 make -k -j2"
|
|
|
|
Execute-Bash "V=1 make -k -j2 install"
|
2018-10-10 15:44:36 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
test_script:
|
|
|
|
- ps: >-
|
|
|
|
if ($env:compiler -eq "mingw") {
|
2018-11-15 09:57:39 +01:00
|
|
|
<# use the MSYS2 compiler binaries to make check #>
|
2018-10-10 15:44:36 +02:00
|
|
|
$oldpath = ${env:Path} -split ';'
|
|
|
|
$buildpath = @("C:\msys64\${env:compiler_path}\bin") + $oldpath
|
|
|
|
$env:Path = $buildpath -join ';'
|
|
|
|
Set-Location "${env:build}"
|
2020-03-19 08:35:49 +01:00
|
|
|
<# Some compiler dlls must be copied to the test and app
|
|
|
|
# directories, before running tor's tests.
|
|
|
|
#>
|
|
|
|
Copy-Item "C:/msys64/${env:compiler_path}/bin/libssp-0.dll","C:/msys64/${env:compiler_path}/bin/zlib1.dll" -Destination "${env:build}/src/test"
|
|
|
|
Copy-Item "C:/msys64/${env:compiler_path}/bin/libssp-0.dll","C:/msys64/${env:compiler_path}/bin/zlib1.dll" -Destination "${env:build}/src/app"
|
|
|
|
<# All installed library dlls must be copied to the test and app
|
|
|
|
# directories, before running tor's tests.
|
|
|
|
# (See install command above.)
|
|
|
|
#>
|
|
|
|
Copy-Item "C:/${env:compiler_path}/bin/libcrypto*.dll","C:/${env:compiler_path}/bin/libssl*.dll","C:/${env:compiler_path}/bin/liblzma*.dll","C:/${env:compiler_path}/bin/libevent*.dll","C:/${env:compiler_path}/bin/libzstd*.dll" -Destination "${env:build}/src/test"
|
|
|
|
Copy-Item "C:/${env:compiler_path}/bin/libcrypto*.dll","C:/${env:compiler_path}/bin/libssl*.dll","C:/${env:compiler_path}/bin/liblzma*.dll","C:/${env:compiler_path}/bin/libevent*.dll","C:/${env:compiler_path}/bin/libzstd*.dll" -Destination "${env:build}/src/app"
|
2020-03-19 20:28:55 +01:00
|
|
|
Execute-Bash "VERBOSE=1 TOR_SKIP_TESTCASES=crypto/openssl_version make -k -j2 check"
|
2018-10-10 15:44:36 +02:00
|
|
|
}
|
|
|
|
|
2018-11-15 12:04:17 +01:00
|
|
|
on_finish:
|
2018-10-10 15:44:36 +02:00
|
|
|
- ps: >-
|
2019-09-30 07:14:21 +02:00
|
|
|
<# if we failed before install:, these functions won't be defined #>
|
|
|
|
Function Execute-Command ($commandPath)
|
|
|
|
{
|
|
|
|
& $commandPath $args 2>&1
|
|
|
|
if ( $LastExitCode -ne 0 ) {
|
|
|
|
$host.SetShouldExit( $LastExitCode )
|
|
|
|
}
|
|
|
|
}
|
|
|
|
Function Execute-Bash ()
|
|
|
|
{
|
|
|
|
Execute-Command 'c:\msys64\usr\bin\bash' '-e' '-c' $args
|
|
|
|
}
|
2018-10-10 15:44:36 +02:00
|
|
|
if ($env:compiler -eq "mingw") {
|
2018-11-15 09:57:39 +01:00
|
|
|
<# use the MSYS2 user binaries to archive failures #>
|
2018-10-10 15:44:36 +02:00
|
|
|
$oldpath = ${env:Path} -split ';'
|
|
|
|
$buildpath = @("C:\msys64\usr\bin") + $oldpath
|
|
|
|
$env:Path = @($buildpath) -join ';'
|
|
|
|
Set-Location "${env:build}"
|
2018-11-15 09:57:39 +01:00
|
|
|
<# store logs as appveyor artifacts: see the artifacts tab #>
|
2018-10-10 15:44:36 +02:00
|
|
|
Execute-Bash "7z a logs.zip config.log || true"
|
|
|
|
Execute-Bash "7z a logs.zip test-suite.log || true"
|
|
|
|
Execute-Bash "appveyor PushArtifact logs.zip || true"
|
|
|
|
Execute-Bash "tail -1000 config.log || true"
|
|
|
|
Execute-Bash "cat test-suite.log || true"
|
|
|
|
}
|
2018-11-15 12:04:17 +01:00
|
|
|
|
2018-11-15 09:57:39 +01:00
|
|
|
# notify the IRC channel of any failures
|
2018-11-15 12:04:17 +01:00
|
|
|
on_failure:
|
2018-10-10 15:44:36 +02:00
|
|
|
- cmd: C:\Python27\python.exe %APPVEYOR_BUILD_FOLDER%\scripts\test\appveyor-irc-notify.py irc.oftc.net:6697 tor-ci failure
|