.appveyor.yml 4.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102
  1. version: 1.0.{build}
  2. clone_depth: 50
  3. # Appveyor images are named after the Visual Studio version they contain.
  4. # But we compile using MinGW, not Visual Studio.
  5. # We use these images because they have different Windows versions.
  6. image:
  7. # Windows Server 2012 R2
  8. - Visual Studio 2015
  9. # Windows Server 2016
  10. - Visual Studio 2017
  11. environment:
  12. compiler: mingw
  13. matrix:
  14. - target: i686-w64-mingw32
  15. compiler_path: mingw32
  16. mingw_prefix: mingw-w64-i686
  17. hardening:
  18. - target: x86_64-w64-mingw32
  19. compiler_path: mingw64
  20. mingw_prefix: mingw-w64-x86_64
  21. # hardening doesn't work with mingw-w64-x86_64-gcc, because it's gcc 8
  22. hardening: --disable-gcc-hardening
  23. install:
  24. - ps: >-
  25. Function Execute-Command ($commandPath)
  26. {
  27. & $commandPath $args 2>&1
  28. if ( $LastExitCode -ne 0 ) {
  29. $host.SetShouldExit( $LastExitCode )
  30. }
  31. }
  32. Function Execute-Bash ()
  33. {
  34. Execute-Command 'c:\msys64\usr\bin\bash' '-e' '-c' $args
  35. }
  36. <# mingw packages start with ${env:mingw_prefix}
  37. # unprefixed packages are from MSYS2, which is like Cygwin. Avoid them.
  38. #
  39. # Use pacman --debug to show package downloads and install locations
  40. #>
  41. Execute-Command "C:\msys64\usr\bin\pacman" -Sy --verbose --needed --noconfirm ${env:mingw_prefix}-libevent ${env:mingw_prefix}-pkg-config ${env:mingw_prefix}-xz ${env:mingw_prefix}-zstd ;
  42. build_script:
  43. - ps: >-
  44. if ($env:compiler -eq "mingw") {
  45. <# use the MSYS2 compiler and user binaries to build and install #>
  46. $oldpath = ${env:Path} -split ';'
  47. $buildpath = @("C:\msys64\${env:compiler_path}\bin", "C:\msys64\usr\bin") + $oldpath
  48. $env:Path = @($buildpath) -join ';'
  49. $env:build = @("${env:APPVEYOR_BUILD_FOLDER}", $env:target) -join '\'
  50. Set-Location "${env:APPVEYOR_BUILD_FOLDER}"
  51. Execute-Bash 'autoreconf -i'
  52. mkdir "${env:build}"
  53. Set-Location "${env:build}"
  54. Execute-Bash "which ${env:target}-gcc"
  55. Execute-Bash "${env:target}-gcc --version"
  56. <# compile for mingw
  57. # mingw zstd doesn't come with a pkg-config file, so we manually
  58. # configure its flags. liblzma just works.
  59. #>
  60. 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}"
  61. Execute-Bash "V=1 make -j2"
  62. Execute-Bash "V=1 make -j2 install"
  63. }
  64. test_script:
  65. - ps: >-
  66. if ($env:compiler -eq "mingw") {
  67. <# use the MSYS2 compiler binaries to make check #>
  68. $oldpath = ${env:Path} -split ';'
  69. $buildpath = @("C:\msys64\${env:compiler_path}\bin") + $oldpath
  70. $env:Path = $buildpath -join ';'
  71. Set-Location "${env:build}"
  72. Copy-Item "C:/msys64/${env:compiler_path}/bin/libssp-0.dll" -Destination "${env:build}/src/test"
  73. Copy-Item "C:/msys64/${env:compiler_path}/bin/zlib1.dll" -Destination "${env:build}/src/test"
  74. Execute-Bash "VERBOSE=1 make -j2 check"
  75. }
  76. on_finish:
  77. - ps: >-
  78. if ($env:compiler -eq "mingw") {
  79. <# use the MSYS2 user binaries to archive failures #>
  80. $oldpath = ${env:Path} -split ';'
  81. $buildpath = @("C:\msys64\usr\bin") + $oldpath
  82. $env:Path = @($buildpath) -join ';'
  83. Set-Location "${env:build}"
  84. <# store logs as appveyor artifacts: see the artifacts tab #>
  85. Execute-Bash "7z a logs.zip config.log || true"
  86. Execute-Bash "7z a logs.zip test-suite.log || true"
  87. Execute-Bash "appveyor PushArtifact logs.zip || true"
  88. Execute-Bash "tail -1000 config.log || true"
  89. Execute-Bash "cat test-suite.log || true"
  90. }
  91. # notify the IRC channel of any failures
  92. on_failure:
  93. - cmd: C:\Python27\python.exe %APPVEYOR_BUILD_FOLDER%\scripts\test\appveyor-irc-notify.py irc.oftc.net:6697 tor-ci failure