From: Viktor Szakats Date: Thu, 21 Dec 2023 03:59:20 +0000 (+0000) Subject: appveyor: replace PowerShell with bash + parallel autotools X-Git-Tag: curl-8_6_0~180 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=2d4d0c1fd32f5cc3f946c407c8eccd5477b287df;p=thirdparty%2Fcurl.git appveyor: replace PowerShell with bash + parallel autotools PowerShell works (after a steep development curve), but one property of it stuck and kept causing unresolvable usability issues: With `$ErrorActionPreference=Stop`, it does abort on failures, but shows only the first line of the error message. In `Continue` mode, it shows the full error message, but doesn't stop on all errors. Another issue is PowerShell considering any stderr output as if the command failed (this has been improved in 7.2 (2021-Nov), but fixed versions aren't running in CI and will not be for a long time in all test images.) Thus, we're going with bash. Also: - use `-j2` with autotools tests, making them finish 5-15 minutes per job faster. - omit `POSIX_PATH_PREFIX`. - use `WINDIR`. - prefer forward slashes. Follow-up to: 75078a415d9c769419aed4153d3d525a8eba95af #11999 Ref: #12444 Fixes #12560 Closes #12572 --- diff --git a/.azure-pipelines.yml b/.azure-pipelines.yml index 049e467336..12ecad3f8a 100644 --- a/.azure-pipelines.yml +++ b/.azure-pipelines.yml @@ -37,7 +37,7 @@ trigger: - '.cirrus.yml' - '.github/*' - '.github/workflows/*' - - 'appveyor.yml' + - 'appveyor.*' - 'packages/*' - 'plan9/*' @@ -51,7 +51,7 @@ pr: - '.cirrus.yml' - '.github/*' - '.github/workflows/*' - - 'appveyor.yml' + - 'appveyor.*' - 'packages/*' - 'plan9/*' diff --git a/.cirrus.yml b/.cirrus.yml index 8878205e5d..3d327259c3 100644 --- a/.cirrus.yml +++ b/.cirrus.yml @@ -32,7 +32,7 @@ freebsd_task: '.azure-pipelines.yml', '.circleci/**', '.github/**', - 'appveyor.yml', + 'appveyor.*', 'CMake/**', 'packages/**', 'plan9/**', diff --git a/.github/labeler.yml b/.github/labeler.yml index 4f87314d28..916219c046 100644 --- a/.github/labeler.yml +++ b/.github/labeler.yml @@ -84,7 +84,7 @@ CI: - '.circleci/**' - '.cirrus.yml' - '.github/**' - - 'appveyor.yml' + - 'appveyor.*' - 'scripts/ci*' - 'tests/azure.pm' - 'tests/appveyor.pm' @@ -481,7 +481,7 @@ Windows: - all: - changed-files: - any-glob-to-all-files: - - 'appveyor.yml' + - 'appveyor.*' - 'CMake/Platforms/WindowsCache.cmake' - 'lib/*win32*' - 'lib/curl_multibyte.*' diff --git a/.github/workflows/awslc.yml b/.github/workflows/awslc.yml index 2505a46022..c600d72d50 100644 --- a/.github/workflows/awslc.yml +++ b/.github/workflows/awslc.yml @@ -14,7 +14,7 @@ on: - '.azure-pipelines.yml' - '.circleci/**' - '.cirrus.yml' - - 'appveyor.yml' + - 'appveyor.*' - 'packages/**' - 'plan9/**' - 'projects/**' @@ -27,7 +27,7 @@ on: - '.azure-pipelines.yml' - '.circleci/**' - '.cirrus.yml' - - 'appveyor.yml' + - 'appveyor.*' - 'packages/**' - 'plan9/**' - 'projects/**' diff --git a/.github/workflows/codeql-analysis.yml b/.github/workflows/codeql-analysis.yml index 800b01ac9d..40d6545882 100644 --- a/.github/workflows/codeql-analysis.yml +++ b/.github/workflows/codeql-analysis.yml @@ -14,7 +14,7 @@ on: - '.azure-pipelines.yml' - '.circleci/**' - '.cirrus.yml' - - 'appveyor.yml' + - 'appveyor.*' - 'docs/**' - 'packages/**' - 'plan9/**' @@ -29,7 +29,7 @@ on: - '.azure-pipelines.yml' - '.circleci/**' - '.cirrus.yml' - - 'appveyor.yml' + - 'appveyor.*' - 'docs/**' - 'packages/**' - 'plan9/**' diff --git a/.github/workflows/fuzz.yml b/.github/workflows/fuzz.yml index a382dcb6ad..247a1c0abe 100644 --- a/.github/workflows/fuzz.yml +++ b/.github/workflows/fuzz.yml @@ -15,7 +15,7 @@ on: - '.azure-pipelines.yml' - '.circleci/**' - '.cirrus.yml' - - 'appveyor.yml' + - 'appveyor.*' - 'CMake/**' - 'packages/**' - 'plan9/**' @@ -31,7 +31,7 @@ on: - '.azure-pipelines.yml' - '.circleci/**' - '.cirrus.yml' - - 'appveyor.yml' + - 'appveyor.*' - 'CMake/**' - 'packages/**' - 'plan9/**' diff --git a/.github/workflows/linux.yml b/.github/workflows/linux.yml index b4ad111f80..81e489ff27 100644 --- a/.github/workflows/linux.yml +++ b/.github/workflows/linux.yml @@ -14,7 +14,7 @@ on: - '.azure-pipelines.yml' - '.circleci/**' - '.cirrus.yml' - - 'appveyor.yml' + - 'appveyor.*' - 'packages/**' - 'plan9/**' - 'projects/**' @@ -27,7 +27,7 @@ on: - '.azure-pipelines.yml' - '.circleci/**' - '.cirrus.yml' - - 'appveyor.yml' + - 'appveyor.*' - 'packages/**' - 'plan9/**' - 'projects/**' diff --git a/.github/workflows/linux32.yml b/.github/workflows/linux32.yml index 1afc9cac4f..e3fca3d1d2 100644 --- a/.github/workflows/linux32.yml +++ b/.github/workflows/linux32.yml @@ -15,7 +15,7 @@ on: - '.azure-pipelines.yml' - '.circleci/**' - '.cirrus.yml' - - 'appveyor.yml' + - 'appveyor.*' - 'CMake/**' - 'packages/**' - 'plan9/**' @@ -30,7 +30,7 @@ on: - '.azure-pipelines.yml' - '.circleci/**' - '.cirrus.yml' - - 'appveyor.yml' + - 'appveyor.*' - 'CMake/**' - 'packages/**' - 'plan9/**' diff --git a/.github/workflows/macos.yml b/.github/workflows/macos.yml index 4a7d6917cc..49bb86cb48 100644 --- a/.github/workflows/macos.yml +++ b/.github/workflows/macos.yml @@ -14,7 +14,7 @@ on: - '.azure-pipelines.yml' - '.circleci/**' - '.cirrus.yml' - - 'appveyor.yml' + - 'appveyor.*' - 'packages/**' - 'plan9/**' - 'projects/**' @@ -27,7 +27,7 @@ on: - '.azure-pipelines.yml' - '.circleci/**' - '.cirrus.yml' - - 'appveyor.yml' + - 'appveyor.*' - 'packages/**' - 'plan9/**' - 'projects/**' diff --git a/.github/workflows/ngtcp2-linux.yml b/.github/workflows/ngtcp2-linux.yml index 3be5c108f2..84149f57c1 100644 --- a/.github/workflows/ngtcp2-linux.yml +++ b/.github/workflows/ngtcp2-linux.yml @@ -15,7 +15,7 @@ on: - '.azure-pipelines.yml' - '.circleci/**' - '.cirrus.yml' - - 'appveyor.yml' + - 'appveyor.*' - 'CMake/**' - 'packages/**' - 'plan9/**' @@ -30,7 +30,7 @@ on: - '.azure-pipelines.yml' - '.circleci/**' - '.cirrus.yml' - - 'appveyor.yml' + - 'appveyor.*' - 'CMake/**' - 'packages/**' - 'plan9/**' diff --git a/.github/workflows/quiche-linux.yml b/.github/workflows/quiche-linux.yml index abc71a5725..fd1740295e 100644 --- a/.github/workflows/quiche-linux.yml +++ b/.github/workflows/quiche-linux.yml @@ -15,7 +15,7 @@ on: - '.azure-pipelines.yml' - '.circleci/**' - '.cirrus.yml' - - 'appveyor.yml' + - 'appveyor.*' - 'CMake/**' - 'packages/**' - 'plan9/**' @@ -30,7 +30,7 @@ on: - '.azure-pipelines.yml' - '.circleci/**' - '.cirrus.yml' - - 'appveyor.yml' + - 'appveyor.*' - 'CMake/**' - 'packages/**' - 'plan9/**' diff --git a/.github/workflows/torture.yml b/.github/workflows/torture.yml index b5f187d8c9..a50b37f140 100644 --- a/.github/workflows/torture.yml +++ b/.github/workflows/torture.yml @@ -15,7 +15,7 @@ on: - '.azure-pipelines.yml' - '.circleci/**' - '.cirrus.yml' - - 'appveyor.yml' + - 'appveyor.*' - 'CMake/**' - 'packages/**' - 'plan9/**' @@ -30,7 +30,7 @@ on: - '.azure-pipelines.yml' - '.circleci/**' - '.cirrus.yml' - - 'appveyor.yml' + - 'appveyor.*' - 'CMake/**' - 'packages/**' - 'plan9/**' diff --git a/.github/workflows/wolfssl.yml b/.github/workflows/wolfssl.yml index f607c0bcc8..d8f0fd4271 100644 --- a/.github/workflows/wolfssl.yml +++ b/.github/workflows/wolfssl.yml @@ -15,7 +15,7 @@ on: - '.azure-pipelines.yml' - '.circleci/**' - '.cirrus.yml' - - 'appveyor.yml' + - 'appveyor.*' - 'CMake/**' - 'packages/**' - 'plan9/**' @@ -30,7 +30,7 @@ on: - '.azure-pipelines.yml' - '.circleci/**' - '.cirrus.yml' - - 'appveyor.yml' + - 'appveyor.*' - 'CMake/**' - 'packages/**' - 'plan9/**' diff --git a/appveyor.sh b/appveyor.sh new file mode 100644 index 0000000000..4a345ff889 --- /dev/null +++ b/appveyor.sh @@ -0,0 +1,156 @@ +#!/usr/bin/env bash +#*************************************************************************** +# _ _ ____ _ +# Project ___| | | | _ \| | +# / __| | | | |_) | | +# | (__| |_| | _ <| |___ +# \___|\___/|_| \_\_____| +# +# Copyright (C) Daniel Stenberg, , et al. +# +# This software is licensed as described in the file COPYING, which +# you should have received as part of this distribution. The terms +# are also available at https://curl.se/docs/copyright.html. +# +# You may opt to use, copy, modify, merge, publish, distribute and/or sell +# copies of the Software, and permit persons to whom the Software is +# furnished to do so, under the terms of the COPYING file. +# +# This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY +# KIND, either express or implied. +# +# SPDX-License-Identifier: curl +# +########################################################################### + +# shellcheck disable=SC3040,SC2039 +set -eux; [ -n "${BASH:-}${ZSH_NAME:-}" ] && set -o pipefail + +# build + +if [ "${APPVEYOR_BUILD_WORKER_IMAGE}" = 'Visual Studio 2022' ]; then + openssl_root_win='C:/OpenSSL-v30-Win64' +else + openssl_root_win='C:/OpenSSL-v111-Win64' +fi +openssl_root="$(cygpath -u "${openssl_root_win}")" + +if [ "${BUILD_SYSTEM}" = 'CMake' ]; then + options='' + [[ "${TARGET:-}" = *'ARM64'* ]] && SKIP_RUN='ARM64 architecture' + [ "${OPENSSL}" = 'ON' ] && options+=" -DOPENSSL_ROOT_DIR=${openssl_root_win}" + [ "${OPENSSL}" = 'ON' ] && options+=" -DOPENSSL_ROOT_DIR=${openssl_root_win}" + [ "${PRJ_CFG}" = 'Debug' ] && options+=' -DCMAKE_RUNTIME_OUTPUT_DIRECTORY_DEBUG=' + [ "${PRJ_CFG}" = 'Release' ] && options+=' -DCMAKE_RUNTIME_OUTPUT_DIRECTORY_RELEASE=' + [[ "${PRJ_GEN}" = *'Visual Studio'* ]] && options+=' -DCMAKE_VS_GLOBALS=TrackFileAccess=false' + # Fails to run without this run due to missing MSVCR90.dll + [ "${PRJ_GEN}" = 'Visual Studio 9 2008' ] && options+=' -DCURL_STATIC_CRT=ON' + # shellcheck disable=SC2086 + cmake -B _bld "-G${PRJ_GEN}" ${TARGET:-} ${options} \ + "-DCURL_USE_OPENSSL=${OPENSSL}" \ + "-DCURL_USE_SCHANNEL=${SCHANNEL}" \ + "-DHTTP_ONLY=${HTTP_ONLY}" \ + "-DBUILD_SHARED_LIBS=${SHARED}" \ + "-DBUILD_TESTING=${TESTING}" \ + "-DENABLE_WEBSOCKETS=${WEBSOCKETS:-}" \ + "-DCMAKE_UNITY_BUILD=${UNITY}" \ + '-DCURL_WERROR=ON' \ + "-DENABLE_DEBUG=${DEBUG}" \ + "-DENABLE_UNICODE=${ENABLE_UNICODE}" \ + '-DCMAKE_INSTALL_PREFIX=C:/CURL' \ + "-DCMAKE_BUILD_TYPE=${PRJ_CFG}" + # shellcheck disable=SC2086 + cmake --build _bld --config "${PRJ_CFG}" --parallel 2 --clean-first -- ${BUILD_OPT:-} + if [ "${SHARED}" = 'ON' ]; then + cp -f -p _bld/lib/*.dll _bld/src/ + fi + if [ "${OPENSSL}" = 'ON' ]; then + cp -f -p "${openssl_root}"/*.dll _bld/src/ + fi + curl='_bld/src/curl.exe' +elif [ "${BUILD_SYSTEM}" = 'VisualStudioSolution' ]; then + ( + cd projects + ./generate.bat "${VC_VERSION}" + msbuild.exe -maxcpucount "-property:Configuration=${PRJ_CFG}" "Windows\\${VC_VERSION}\\curl-all.sln" + ) + curl="build/Win32/${VC_VERSION}/${PRJ_CFG}/curld.exe" +elif [ "${BUILD_SYSTEM}" = 'winbuild_vs2015' ]; then + ./buildconf.bat + ( + cd winbuild + cat << EOF > _make.bat + call "C:/Program Files/Microsoft SDKs/Windows/v7.1/Bin/SetEnv.cmd" /x64 + call "C:/Program Files (x86)/Microsoft Visual Studio 14.0/VC/vcvarsall.bat" x86_amd64 + nmake -f Makefile.vc mode=dll VC=14 "SSL_PATH=${openssl_root_win}" WITH_SSL=dll MACHINE=x64 DEBUG=${DEBUG} ENABLE_UNICODE=${ENABLE_UNICODE} +EOF + ./_make.bat + rm _make.bat + ) + curl="builds/libcurl-vc14-x64-${PATHPART}-dll-ssl-dll-ipv6-sspi/bin/curl.exe" +elif [ "${BUILD_SYSTEM}" = 'winbuild_vs2017' ]; then + ./buildconf.bat + ( + cd winbuild + cat << EOF > _make.bat + call "C:/Program Files (x86)/Microsoft Visual Studio/2017/Community/VC/Auxiliary/Build/vcvars64.bat" + nmake -f Makefile.vc mode=dll VC=14.10 "SSL_PATH=${openssl_root_win}" WITH_SSL=dll MACHINE=x64 DEBUG=${DEBUG} ENABLE_UNICODE=${ENABLE_UNICODE} +EOF + ./_make.bat + rm _make.bat + ) + curl="builds/libcurl-vc14.10-x64-${PATHPART}-dll-ssl-dll-ipv6-sspi/bin/curl.exe" +elif [ "${BUILD_SYSTEM}" = 'autotools' ]; then + autoreconf -fi + ( + mkdir _bld + cd _bld + # shellcheck disable=SC2086 + ../configure ${CONFIG_ARGS:-} + make -j2 V=1 + make -j2 V=1 examples + cd tests + make -j2 V=1 + ) + curl='_bld/src/curl.exe' +fi + +find . -name '*.exe' -o -name '*.dll' +if [ -z "${SKIP_RUN:-}" ]; then + "${curl}" --version +else + echo "Skip running curl.exe. Reason: ${SKIP_RUN}" +fi + +if false; then + for log in CMakeFiles/CMakeConfigureLog.yaml CMakeFiles/CMakeOutput.log CMakeFiles/CMakeError.log; do + [ -r "_bld/${log}" ] && cat "_bld/${log}" + done +fi + +if [ "${TESTING}" = 'ON' ] && [ "${BUILD_SYSTEM}" = 'CMake' ]; then + cmake --build _bld --config "${PRJ_CFG}" --parallel 2 --target testdeps +fi + +# test + +if [ "${TESTING}" = 'ON' ]; then + acurl='' + [ -x "$(cygpath -u "C:/msys64/usr/bin/curl.exe")" ] && acurl="-ac $(cygpath -u "C:/msys64/usr/bin/curl.exe")" + [ -x "$(cygpath -u "${WINDIR}/System32/curl.exe")" ] && acurl="-ac $(cygpath -u "${WINDIR}/System32/curl.exe")" + if [ "${BUILD_SYSTEM}" = 'CMake' ]; then + ls _bld/lib/*.dll >/dev/null 2>&1 && cp -f -p _bld/lib/*.dll _bld/tests/libtest/ + TFLAGS="${acurl} ${DISABLED_TESTS:-}" cmake --build _bld --config "${PRJ_CFG}" --target test-ci + elif [ "${BUILD_SYSTEM}" = 'autotools' ]; then + ( + cd _bld + make -j2 V=1 TFLAGS="${acurl} ${DISABLED_TESTS:-}" test-ci + ) + else + ( + cd _bld/tests + # shellcheck disable=SC2086 + ./runtests.pl -a -p !flaky -r -rm ${acurl} ${DISABLED_TESTS:-} + ) + fi +fi diff --git a/appveyor.yml b/appveyor.yml index 86a5f8b64d..f4911452ae 100644 --- a/appveyor.yml +++ b/appveyor.yml @@ -85,7 +85,6 @@ environment: HTTP_ONLY: 'OFF' TESTING: 'ON' DISABLED_TESTS: '!1139 !1501' - ADD_PATH: 'C:\msys64\usr\bin' - job_name: 'CMake, VS2022, Debug, x64, Schannel, Static, Unicode' APPVEYOR_BUILD_WORKER_IMAGE: 'Visual Studio 2022' BUILD_SYSTEM: CMake @@ -97,7 +96,6 @@ environment: HTTP_ONLY: 'OFF' TESTING: 'ON' DISABLED_TESTS: '!1139 !1501' - ADD_PATH: 'C:\msys64\usr\bin' - job_name: 'CMake, VS2022, Debug, x64, no SSL, Static' APPVEYOR_BUILD_WORKER_IMAGE: 'Visual Studio 2022' BUILD_SYSTEM: CMake @@ -109,7 +107,6 @@ environment: HTTP_ONLY: 'OFF' TESTING: 'ON' DISABLED_TESTS: '!1139 !1501' - ADD_PATH: 'C:\msys64\usr\bin' - job_name: 'CMake, VS2022, Debug, x64, no SSL, Static, HTTP only' APPVEYOR_BUILD_WORKER_IMAGE: 'Visual Studio 2022' BUILD_SYSTEM: CMake @@ -121,7 +118,6 @@ environment: HTTP_ONLY: 'ON' TESTING: 'ON' DISABLED_TESTS: '!1139 !1501' - ADD_PATH: 'C:\msys64\usr\bin' # generated CMake-based MSYS Makefiles builds (mingw cross-compiling) - job_name: 'CMake, mingw-w64, gcc 13, Debug, x64, Schannel, Static, Unicode, Unity' APPVEYOR_BUILD_WORKER_IMAGE: 'Visual Studio 2022' @@ -133,7 +129,7 @@ environment: HTTP_ONLY: 'OFF' TESTING: 'ON' DISABLED_TESTS: '!1086 !1139 !1451 !1501' - ADD_PATH: 'C:\msys64\mingw64\bin;C:\msys64\usr\bin' + ADD_PATH: 'C:/msys64/mingw64/bin' MSYS2_ARG_CONV_EXCL: '/*' BUILD_OPT: -k UNITY: 'ON' @@ -147,7 +143,7 @@ environment: HTTP_ONLY: 'OFF' TESTING: 'ON' DISABLED_TESTS: '!1086 !1139 !1451 !1501' - ADD_PATH: 'C:\mingw-w64\x86_64-7.2.0-posix-seh-rt_v5-rev1\mingw64\bin;C:\msys64\usr\bin' + ADD_PATH: 'C:/mingw-w64/x86_64-7.2.0-posix-seh-rt_v5-rev1/mingw64/bin' MSYS2_ARG_CONV_EXCL: '/*' BUILD_OPT: -k - job_name: 'CMake, mingw-w64, gcc 9, Debug, x64, Schannel, Static, Unity' @@ -161,7 +157,7 @@ environment: TESTING: 'ON' # test 286 disabled due to https://github.com/curl/curl/issues/12040 DISABLED_TESTS: '~286 !1086 !1139 !1451 !1501' - ADD_PATH: 'C:\msys64\mingw64\bin;C:\msys64\usr\bin' + ADD_PATH: 'C:/msys64/mingw64/bin' MSYS2_ARG_CONV_EXCL: '/*' BUILD_OPT: -k UNITY: 'ON' @@ -175,7 +171,7 @@ environment: HTTP_ONLY: 'OFF' TESTING: 'ON' DISABLED_TESTS: '!1086 !1139 !1451 !1501' - ADD_PATH: 'C:\mingw-w64\i686-6.3.0-posix-dwarf-rt_v5-rev1\mingw32\bin;C:\msys64\usr\bin' + ADD_PATH: 'C:/mingw-w64/i686-6.3.0-posix-dwarf-rt_v5-rev1/mingw32/bin' MSYS2_ARG_CONV_EXCL: '/*' BUILD_OPT: -k # winbuild-based builds @@ -248,21 +244,18 @@ environment: BUILD_SYSTEM: autotools TESTING: 'ON' DISABLED_TESTS: '!19 !1233' - ADD_PATH: 'C:\msys64\usr\bin' CONFIG_ARGS: '--enable-debug --enable-werror --disable-threaded-resolver --disable-proxy --without-ssl --enable-websockets' - job_name: 'autotools, msys2, Debug, x86_64, no SSL' APPVEYOR_BUILD_WORKER_IMAGE: 'Visual Studio 2017' BUILD_SYSTEM: autotools TESTING: 'ON' DISABLED_TESTS: '!19 !504 !704 !705 !1233' - ADD_PATH: 'C:\msys64\usr\bin' CONFIG_ARGS: '--enable-debug --enable-werror --disable-threaded-resolver --without-ssl --enable-websockets' - job_name: 'autotools, msys2, Release, x86_64, no SSL' APPVEYOR_BUILD_WORKER_IMAGE: 'Visual Studio 2017' BUILD_SYSTEM: autotools TESTING: 'ON' DISABLED_TESTS: '!19 !504 !704 !705 !1233' - ADD_PATH: 'C:\msys64\usr\bin' CONFIG_ARGS: '--enable-warnings --enable-werror --without-ssl --enable-websockets' # autotools-based Cygwin build - job_name: 'autotools, cygwin, Debug, x86_64, no SSL' @@ -270,154 +263,23 @@ environment: BUILD_SYSTEM: autotools TESTING: 'ON' DISABLED_TESTS: '' - ADD_PATH: 'C:\cygwin64\bin' + ADD_SHELL: 'C:/cygwin64/bin' CONFIG_ARGS: '--enable-debug --enable-werror --disable-threaded-resolver --without-ssl --enable-websockets' - POSIX_PATH_PREFIX: '/cygdrive' install: - ps: | - if($env:ADD_PATH -ne $null) { - $env:PATH = "$env:ADD_PATH;$env:PATH" - } - -build_script: - - ps: | - function Pull-BatchFile-Env { - param([string]$Path, [string]$Parameters) - $tempFile = [IO.Path]::GetTempFileName() - cmd.exe /c " `"$Path`" $Parameters && set " > $tempFile - Get-Content $tempFile | ForEach-Object { if($_ -match '^(.*?)=(.*)$') { Set-Content "env:\$($matches[1])" $matches[2] } } - Remove-Item $tempFile - } - - $ErrorActionPreference = 'Stop' - - if($env:APPVEYOR_BUILD_WORKER_IMAGE -eq 'Visual Studio 2022') { - $openssl_root = 'C:\OpenSSL-v30-Win64' + if($env:ADD_SHELL -ne $null) { + $env:PATH = "$env:ADD_SHELL;$env:PATH" } else { - $openssl_root = 'C:\OpenSSL-v111-Win64' - } - - if($env:BUILD_SYSTEM -eq 'CMake') { - - $options = @('-DCURL_WERROR=ON') - $options += "-G$env:PRJ_GEN" - if($env:TARGET -ne $null) { - $options += "$env:TARGET" - if($env:TARGET.Contains('ARM64')) { - $env:SKIP_RUN = 'ARM64 architecture' - } - } - $options += "-DCURL_USE_OPENSSL=$env:OPENSSL" - if($env:OPENSSL -eq 'ON') { - $options += "-DOPENSSL_ROOT_DIR=$openssl_root" - } - $options += "-DCURL_USE_SCHANNEL=$env:SCHANNEL" - $options += "-DHTTP_ONLY=$env:HTTP_ONLY" - $options += "-DBUILD_SHARED_LIBS=$env:SHARED" - $options += "-DBUILD_TESTING=$env:TESTING" - $options += "-DENABLE_WEBSOCKETS=$env:WEBSOCKETS" - $options += "-DCMAKE_UNITY_BUILD=$env:UNITY" - $options += "-DENABLE_DEBUG=$env:DEBUG" - $options += "-DENABLE_UNICODE=$env:ENABLE_UNICODE" - $options += '-DCMAKE_INSTALL_PREFIX=C:/CURL' - $options += "-DCMAKE_BUILD_TYPE=$env:PRJ_CFG" - if($env:PRJ_CFG -eq 'Debug') { - $options += '-DCMAKE_RUNTIME_OUTPUT_DIRECTORY_DEBUG=' - } - elseif ($env:PRJ_CFG -eq 'Release') { - $options += '-DCMAKE_RUNTIME_OUTPUT_DIRECTORY_RELEASE=' - } - if($env:PRJ_GEN.Contains('Visual Studio')) { - $options += '-DCMAKE_VS_GLOBALS=TrackFileAccess=false' - } - if($env:PRJ_GEN -eq 'Visual Studio 9 2008') { - # Without this it fails to run due to missing MSVCR90.dll - $options += '-DCURL_STATIC_CRT=ON' - } - - Write-Host 'CMake options:' $options - cmake -B _bld $options - cmake --build _bld --config $env:PRJ_CFG --parallel 2 --clean-first -- $env:BUILD_OPT - if($env:SHARED -eq 'ON') { - Copy-Item -Path 'C:\Projects\curl\_bld\lib\*.dll' -Destination 'C:\projects\curl\_bld\src' - } - if($env:OPENSSL -eq 'ON') { - Copy-Item -Path "$openssl_root\*.dll" -Destination 'C:\projects\curl\_bld\src' - } - $curl = '.\_bld\src\curl.exe' - } - elseif($env:BUILD_SYSTEM -eq 'VisualStudioSolution') { - cd projects - .\generate.bat $env:VC_VERSION - msbuild.exe -maxcpucount "-property:Configuration=$env:PRJ_CFG" "Windows\$env:VC_VERSION\curl-all.sln" - $curl = "..\build\Win32\$env:VC_VERSION\$env:PRJ_CFG\curld.exe" - } - elseif($env:BUILD_SYSTEM -eq 'winbuild_vs2015') { - .\buildconf.bat - cd winbuild - Pull-BatchFile-Env 'C:\Program Files\Microsoft SDKs\Windows\v7.1\Bin\SetEnv.cmd' /x64 - Pull-BatchFile-Env 'C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\vcvarsall.bat' x86_amd64 - nmake /nologo /f Makefile.vc mode=dll VC=14 "SSL_PATH=$openssl_root" WITH_SSL=dll MACHINE=x64 DEBUG=$env:DEBUG ENABLE_UNICODE=$env:ENABLE_UNICODE - $curl = "..\builds\libcurl-vc14-x64-$env:PATHPART-dll-ssl-dll-ipv6-sspi\bin\curl.exe" - } - elseif($env:BUILD_SYSTEM -eq 'winbuild_vs2017') { - .\buildconf.bat - cd winbuild - Pull-BatchFile-Env 'C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\VC\Auxiliary\Build\vcvars64.bat' - nmake /nologo /f Makefile.vc mode=dll VC=14.10 "SSL_PATH=$openssl_root" WITH_SSL=dll MACHINE=x64 DEBUG=$env:DEBUG ENABLE_UNICODE=$env:ENABLE_UNICODE - $curl = "..\builds\libcurl-vc14.10-x64-$env:PATHPART-dll-ssl-dll-ipv6-sspi\bin\curl.exe" + $env:PATH = "C:/msys64/usr/bin;$env:PATH" } - elseif($env:BUILD_SYSTEM -eq 'autotools') { - & bash -e -c "cd $env:POSIX_PATH_PREFIX/c/projects/curl && autoreconf -fi 2>&1 && mkdir _bld && cd _bld && ../configure $env:CONFIG_ARGS 2>&1 && make V=1 && make V=1 examples && cd tests && make V=1" - $curl = '.\_bld\src\curl.exe' - } - - Get-ChildItem -Path C:\projects\curl -Include ('*.exe', '*.dll') -Recurse -Name - if($env:SKIP_RUN -eq $null) { - cmd.exe /c "`"$curl`" -V 2>&1" - if(-not $?) { - Write-Host "Error running curl: '$curl':" ("0x" + $LastExitCode.ToString("X")) - exit 1 - } - } - else { - Write-Host "Skip running curl.exe. Reason: $env:SKIP_RUN" - } - - if($false) { - if(Test-Path _bld/CMakeFiles/CMakeConfigureLog.yaml) { cat _bld/CMakeFiles/CMakeConfigureLog.yaml } - if(Test-Path _bld/CMakeFiles/CMakeOutput.log) { cat _bld/CMakeFiles/CMakeOutput.log } - if(Test-Path _bld/CMakeFiles/CMakeError.log) { cat _bld/CMakeFiles/CMakeError.log } - if(Test-Path config.log) { cat _bld/config.log } - } - - if($env:TESTING -eq 'ON' -and $env:BUILD_SYSTEM -eq 'CMake') { - cmake --build _bld --config $env:PRJ_CFG --parallel 2 --target testdeps + if($env:ADD_PATH -ne $null) { + $env:PATH = "$env:ADD_PATH;$env:PATH" } -test_script: - - ps: | - if(Test-Path 'C:/msys64/usr/bin/curl.exe') { - $acurl="-ac $env:POSIX_PATH_PREFIX/c/msys64/usr/bin/curl.exe" - } - if(Test-Path 'C:/Windows/System32/curl.exe') { - $acurl="-ac $env:POSIX_PATH_PREFIX/c/Windows/System32/curl.exe" - } - if($env:TESTING -eq 'ON') { - if($env:BUILD_SYSTEM -eq 'CMake') { - Copy-Item -Path 'C:\Projects\curl\_bld\lib\*.dll' -Destination 'C:\projects\curl\_bld\tests\libtest' - $env:TFLAGS="$acurl $env:DISABLED_TESTS" - cmake --build _bld --config $env:PRJ_CFG --target test-ci - } - elseif($env:BUILD_SYSTEM -eq 'autotools') { - & bash -e -c "cd $env:POSIX_PATH_PREFIX/c/projects/curl/_bld && make V=1 TFLAGS='$acurl $env:DISABLED_TESTS' test-ci" - } - else { - & bash -e -c "cd $env:POSIX_PATH_PREFIX/c/projects/curl/_bld/tests && ./runtests.pl -a -p !flaky -r -rm $acurl $env:DISABLED_TESTS" - } - } +build_script: + - cmd: sh -c ./appveyor.sh clone_depth: 10