.appveyor.yml 3.6 KB

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