From c6d2990a737957df7dd0e6ee8cf899167816306e Mon Sep 17 00:00:00 2001 From: Nick Mathewson Date: Wed, 10 Oct 2018 09:44:36 -0400 Subject: [PATCH 1/4] Install only one of the two mingw architectures in appveyor Closes ticket 27765 This commit also changes the appveyor file to a unified line ending style, since the old one was pretty confused. Use "-b" to see the real differences. --- .appveyor.yml | 150 +++++++++++++++++++++++++------------------------- 1 file changed, 76 insertions(+), 74 deletions(-) diff --git a/.appveyor.yml b/.appveyor.yml index 768c540e5c..f56d8d6cb3 100644 --- a/.appveyor.yml +++ b/.appveyor.yml @@ -1,74 +1,76 @@ -version: 1.0.{build} - -clone_depth: 50 - -environment: - compiler: mingw - - matrix: - - target: i686-w64-mingw32 - compiler_path: mingw32 - openssl_path: /c/OpenSSL-Win32 - hardening: - - target: x86_64-w64-mingw32 - compiler_path: mingw64 - openssl_path: /c/OpenSSL-Win64 - hardening: --disable-gcc-hardening - -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 - } - Execute-Command "C:\msys64\usr\bin\pacman" -Sy --needed --noconfirm openssl-devel openssl libevent-devel libevent mingw-w64-i686-libevent mingw-w64-x86_64-libevent mingw-w64-i686-openssl mingw-w64-x86_64-openssl mingw-w64-i686-zstd mingw-w64-x86_64-zstd - -build_script: -- ps: >- - if ($env:compiler -eq "mingw") { - $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" - Execute-Bash "../configure --prefix=/${env:compiler_path} --build=${env:target} --host=${env:target} --disable-asciidoc --enable-fatal-warnings --with-openssl-dir=${env:openssl_path} ${env:hardening}" - Execute-Bash "V=1 make -j2" - Execute-Bash "V=1 make -j2 install" - } - -test_script: -- ps: >- - if ($env:compiler -eq "mingw") { - $oldpath = ${env:Path} -split ';' - $buildpath = @("C:\msys64\${env:compiler_path}\bin") + $oldpath - $env:Path = $buildpath -join ';' - Set-Location "${env:build}" - Execute-Bash "VERBOSE=1 make -j2 check" - } - -on_failure: -- ps: >- - if ($env:compiler -eq "mingw") { - $oldpath = ${env:Path} -split ';' - $buildpath = @("C:\msys64\usr\bin") + $oldpath - $env:Path = @($buildpath) -join ';' - Set-Location "${env:build}" - 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" - } -- cmd: C:\Python27\python.exe %APPVEYOR_BUILD_FOLDER%\scripts\test\appveyor-irc-notify.py irc.oftc.net:6697 tor-ci failure +version: 1.0.{build} + +clone_depth: 50 + +environment: + compiler: mingw + + matrix: + - target: i686-w64-mingw32 + compiler_path: mingw32 + openssl_path: /c/OpenSSL-Win32 + mingw_prefix: mingw-w64-i686 + hardening: + - target: x86_64-w64-mingw32 + compiler_path: mingw64 + openssl_path: /c/OpenSSL-Win64 + mingw_prefix: mingw-w64-x86_64 + hardening: --disable-gcc-hardening + +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 + } + Execute-Command "C:\msys64\usr\bin\pacman" -Sy --needed --noconfirm openssl-devel openssl libevent-devel libevent ${env:mingw_prefix}-libevent ${env:mingw_prefix}-openssl ${env:mingw_prefix}-zstd + +build_script: +- ps: >- + if ($env:compiler -eq "mingw") { + $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" + Execute-Bash "../configure --prefix=/${env:compiler_path} --build=${env:target} --host=${env:target} --disable-asciidoc --enable-fatal-warnings --with-openssl-dir=${env:openssl_path} ${env:hardening}" + Execute-Bash "V=1 make -j2" + Execute-Bash "V=1 make -j2 install" + } + +test_script: +- ps: >- + if ($env:compiler -eq "mingw") { + $oldpath = ${env:Path} -split ';' + $buildpath = @("C:\msys64\${env:compiler_path}\bin") + $oldpath + $env:Path = $buildpath -join ';' + Set-Location "${env:build}" + Execute-Bash "VERBOSE=1 make -j2 check" + } + +on_failure: +- ps: >- + if ($env:compiler -eq "mingw") { + $oldpath = ${env:Path} -split ';' + $buildpath = @("C:\msys64\usr\bin") + $oldpath + $env:Path = @($buildpath) -join ';' + Set-Location "${env:build}" + 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" + } +- cmd: C:\Python27\python.exe %APPVEYOR_BUILD_FOLDER%\scripts\test\appveyor-irc-notify.py irc.oftc.net:6697 tor-ci failure From 1b57bbba02de14a52e161295270052ab7f5bee47 Mon Sep 17 00:00:00 2001 From: Nick Mathewson Date: Wed, 10 Oct 2018 09:49:02 -0400 Subject: [PATCH 2/4] Appveyor: Don't try to install the mingw openssl package This package conflicts with a preinstalled mingw openssl. Fixes bug 27943. I think this was an appveyor change, not a Tor bug. --- .appveyor.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.appveyor.yml b/.appveyor.yml index f56d8d6cb3..7d8927ee35 100644 --- a/.appveyor.yml +++ b/.appveyor.yml @@ -30,7 +30,7 @@ install: { Execute-Command 'c:\msys64\usr\bin\bash' '-e' '-c' $args } - Execute-Command "C:\msys64\usr\bin\pacman" -Sy --needed --noconfirm openssl-devel openssl libevent-devel libevent ${env:mingw_prefix}-libevent ${env:mingw_prefix}-openssl ${env:mingw_prefix}-zstd + Execute-Command "C:\msys64\usr\bin\pacman" -Sy --needed --noconfirm openssl-devel openssl libevent-devel libevent ${env:mingw_prefix}-libevent ${env:mingw_prefix}-zstd ; build_script: - ps: >- From 8c0009a8de4f6e67d738ab15352fdf59885fafec Mon Sep 17 00:00:00 2001 From: Nick Mathewson Date: Wed, 10 Oct 2018 10:20:01 -0400 Subject: [PATCH 3/4] Changes file for apveyor changes --- changes/tickets_27764_27943 | 5 +++++ 1 file changed, 5 insertions(+) create mode 100644 changes/tickets_27764_27943 diff --git a/changes/tickets_27764_27943 b/changes/tickets_27764_27943 new file mode 100644 index 0000000000..e8468545f1 --- /dev/null +++ b/changes/tickets_27764_27943 @@ -0,0 +1,5 @@ + o Minor bugfixes (CI, appveyor): + - Only install the necessary mingw packages during our appveyor + builds. This change makes the build a little faster, and prevents a + conflict with a preinstalled mingw openssl that appveyor now ships. + Fixes bugs 27943 and 27765; bugfix on 0.3.4.2-alpha. From c6b5b43d92cce4623293e7163e6ed935290b3a02 Mon Sep 17 00:00:00 2001 From: Nick Mathewson Date: Wed, 10 Oct 2018 11:10:29 -0400 Subject: [PATCH 4/4] fixup! Changes file for apveyor changes --- changes/{tickets_27764_27943 => tickets_27765_27943} | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename changes/{tickets_27764_27943 => tickets_27765_27943} (100%) diff --git a/changes/tickets_27764_27943 b/changes/tickets_27765_27943 similarity index 100% rename from changes/tickets_27764_27943 rename to changes/tickets_27765_27943