From 1b08c636f12d074ac99204ec38c574040823be4c Mon Sep 17 00:00:00 2001 From: Tyler Young Date: Wed, 15 Dec 2021 13:34:37 -0500 Subject: [PATCH 01/30] be more specific w/ build targets in appveyor-linux.yml add perf test after test run in appveyor-linux.yml make boringssl cache dependent on boringssl-target.txt cache apt's fetched libevent debs --- appveyor-linux.yml | 39 +++++++++++++++++++++++++++++++++------ boringssl-target.txt | 1 + tests/CMakeLists.txt | 11 +++++++++++ tests/localhost.key | 8 ++++++++ tests/localhost.pem | 11 +++++++++++ tests/localhostCA.key | 8 ++++++++ tests/localhostCA.pem | 12 ++++++++++++ 7 files changed, 84 insertions(+), 6 deletions(-) create mode 100644 boringssl-target.txt create mode 100644 tests/localhost.key create mode 100644 tests/localhost.pem create mode 100644 tests/localhostCA.key create mode 100644 tests/localhostCA.pem diff --git a/appveyor-linux.yml b/appveyor-linux.yml index c62a08ea0..059868fbc 100644 --- a/appveyor-linux.yml +++ b/appveyor-linux.yml @@ -9,13 +9,20 @@ build: off init: cache: -- boringssl -> appveyor-linux.yml # we define the commit in here +- $HOME/.apt +- boringssl -> boringssl-target.txt # we define the commit in here install: - sh: >- - if [[ -e boringssl/CMakeLists.txt ]] ; then + if [[ -e ~/.apt ]] ; then + + sudo mv $HOME/.apt/* /var/cache/apt/archives/ + + fi + + if [[ -e ./boringssl/CMakeLists.txt ]] ; then echo cached @@ -25,11 +32,11 @@ install: cd boringssl - git checkout a2278d4d2cabe73f6663e3299ea7808edfa306b9 + git checkout $(<../boringssl-target.txt) cmake . - make -j4 + make -j2 crypto ssl decrepit cd .. @@ -39,10 +46,30 @@ install: git submodule update --checkout --force --recursive + sudo apt update -qq + + sudo apt -y --no-install-recommends install libevent-dev + + mkdir -p $HOME/.apt + + sudo mv /var/cache/apt/archives/libevent*.deb $HOME/.apt/ + cmake -DBORINGSSL_DIR=$PWD/boringssl . - make + make -j2 lsquic build-tests test_script: -- sh: make test +- sh: >- + + make test + + make -j2 perf_server perf_client + + ./bin/perf_server -L notice -s ::1:8443 -c localhost,tests/localhost.pem,tests/localhost.key & + + PERF_SERVER_PID=$! + + time ./bin/perf_client -L info -s ::1:8443 -p 104857600:104857600 + + kill $PERF_SERVER_PID diff --git a/boringssl-target.txt b/boringssl-target.txt new file mode 100644 index 000000000..c3812d2fd --- /dev/null +++ b/boringssl-target.txt @@ -0,0 +1 @@ +a2278d4d2cabe73f6663e3299ea7808edfa306b9 \ No newline at end of file diff --git a/tests/CMakeLists.txt b/tests/CMakeLists.txt index 7aee69b62..a5ef42171 100644 --- a/tests/CMakeLists.txt +++ b/tests/CMakeLists.txt @@ -87,6 +87,9 @@ IF (NOT CMAKE_SYSTEM_NAME STREQUAL "Windows") LIST(APPEND TESTS h3_framing) ENDIF() +IF(NOT TARGET build-tests) + ADD_CUSTOM_TARGET(build-tests ALL) +ENDIF() FOREACH(TEST_NAME ${TESTS}) ADD_EXECUTABLE(test_${TEST_NAME} test_${TEST_NAME}.c ${ADDL_SOURCES}) @@ -108,6 +111,7 @@ FOREACH(TEST_NAME ${TESTS}) #ENDIF() ENDIF() ADD_TEST(${TEST_NAME} test_${TEST_NAME}) + ADD_DEPENDENCIES(build-tests test_${TEST_NAME}) ENDFOREACH() ADD_EXECUTABLE(test_stream test_stream.c ${ADDL_SOURCES}) @@ -119,6 +123,7 @@ ADD_TEST(stream test_stream) ADD_TEST(stream_hash test_stream -h) ADD_TEST(stream_A test_stream -A) ADD_TEST(stream_hash_A test_stream -A -h) +ADD_DEPENDENCIES(build-tests test_stream) IF(NOT MSVC) ADD_EXECUTABLE(graph_cubic graph_cubic.c ${ADDL_SOURCES}) @@ -130,6 +135,7 @@ ENDIF() ADD_EXECUTABLE(test_min_heap test_min_heap.c ../src/liblsquic/lsquic_min_heap.c) ADD_TEST(min_heap test_min_heap) +ADD_DEPENDENCIES(build-tests test_min_heap) SET(MALO_SRC test_malo.c ../src/liblsquic/lsquic_malo.c) ADD_EXECUTABLE(test_malo_pooled ${MALO_SRC}) @@ -139,6 +145,7 @@ ENDIF() SET_TARGET_PROPERTIES(test_malo_pooled PROPERTIES COMPILE_FLAGS "${CMAKE_C_FLAGS} -DLSQUIC_USE_POOLS=1") ADD_TEST(malo_pooled test_malo_pooled) +ADD_DEPENDENCIES(build-tests test_malo_pooled) ADD_EXECUTABLE(test_malo_nopool ${MALO_SRC}) IF(MSVC) @@ -147,15 +154,19 @@ ENDIF() SET_TARGET_PROPERTIES(test_malo_nopool PROPERTIES COMPILE_FLAGS "${CMAKE_C_FLAGS} -DLSQUIC_USE_POOLS=0") ADD_TEST(malo_nopool test_malo_nopool) +ADD_DEPENDENCIES(build-tests test_malo_nopool) ADD_EXECUTABLE(test_minmax test_minmax.c ../src/liblsquic/lsquic_minmax.c) IF(MSVC) TARGET_LINK_LIBRARIES(test_minmax ${GETOPT_LIB}) ENDIF() ADD_TEST(minmax test_minmax) +ADD_DEPENDENCIES(build-tests test_minmax) ADD_EXECUTABLE(test_rechist test_rechist.c ../src/liblsquic/lsquic_rechist.c) ADD_TEST(rechist test_rechist) +ADD_DEPENDENCIES(build-tests test_rechist) ADD_EXECUTABLE(test_trechist test_trechist.c ../src/liblsquic/lsquic_trechist.c) ADD_TEST(trechist test_trechist) +ADD_DEPENDENCIES(build-tests test_trechist) diff --git a/tests/localhost.key b/tests/localhost.key new file mode 100644 index 000000000..dc61a0052 --- /dev/null +++ b/tests/localhost.key @@ -0,0 +1,8 @@ +-----BEGIN EC PARAMETERS----- +BggqhkjOPQMBBw== +-----END EC PARAMETERS----- +-----BEGIN EC PRIVATE KEY----- +MHcCAQEEIKYZDgkl2uN2FqP8j0ZLaX9goZovbOU+Noa12JOqaIDQoAoGCCqGSM49 +AwEHoUQDQgAEWnNf81GlNs/qI6F1Fv8ied08380gifitwp6M1V7kJMvvTt0pak3s +/MvbsH3FXG2dHme3nPL9kBp4jFPiwVxtgg== +-----END EC PRIVATE KEY----- diff --git a/tests/localhost.pem b/tests/localhost.pem new file mode 100644 index 000000000..0290dd1ac --- /dev/null +++ b/tests/localhost.pem @@ -0,0 +1,11 @@ +-----BEGIN CERTIFICATE----- +MIIBqzCCAVKgAwIBAgIUB+6iEGqmXwkmwTeYgeU+Q+OSkfEwCgYIKoZIzj0EAwIw +ODEVMBMGA1UECgwMTG9jYWxob3N0IENBMQswCQYDVQQGEwJVUzESMBAGA1UEAwwJ +bG9jYWxob3N0MB4XDTIxMTIwNzE2MjczOVoXDTIyMTIwNzE2MjczOVowITELMAkG +A1UEBhMCVVMxEjAQBgNVBAMMCWxvY2FsaG9zdDBZMBMGByqGSM49AgEGCCqGSM49 +AwEHA0IABFpzX/NRpTbP6iOhdRb/InndPN/NIIn4rcKejNVe5CTL707dKWpN7PzL +27B9xVxtnR5nt5zy/ZAaeIxT4sFcbYKjUTBPMB8GA1UdIwQYMBaAFDD8bPRhSZvh +pr/ZyKZnSXGU2IH8MAkGA1UdEwQCMAAwCwYDVR0PBAQDAgTwMBQGA1UdEQQNMAuC +CWxvY2FsaG9zdDAKBggqhkjOPQQDAgNHADBEAiA3bXM3LeDw4PylTdZS3T/RmsNX +R56BmIzYJ67lJqMJaQIgAYvKTd/N4scrWR37SKShAk6yhx0WuFWMGLlIAFb7pbA= +-----END CERTIFICATE----- diff --git a/tests/localhostCA.key b/tests/localhostCA.key new file mode 100644 index 000000000..d3ff56f84 --- /dev/null +++ b/tests/localhostCA.key @@ -0,0 +1,8 @@ +-----BEGIN EC PARAMETERS----- +BggqhkjOPQMBBw== +-----END EC PARAMETERS----- +-----BEGIN EC PRIVATE KEY----- +MHcCAQEEIPd9auFKb76x8PAmJpkJS3EpXta9gTdQD+sUHc631TReoAoGCCqGSM49 +AwEHoUQDQgAEuqX0ncb6eVo5Rxrnipmt5yzt1bKhqEqCWEd7UCkoZ5RGBDtqOh8v +s3wdFpOLiojBV0+CVbnJbdYg3U9BZI/Rzw== +-----END EC PRIVATE KEY----- diff --git a/tests/localhostCA.pem b/tests/localhostCA.pem new file mode 100644 index 000000000..824d162bd --- /dev/null +++ b/tests/localhostCA.pem @@ -0,0 +1,12 @@ +-----BEGIN CERTIFICATE----- +MIIBxTCCAWugAwIBAgIUekflpcz/KPPXHkAGiZl70KnlFb8wCgYIKoZIzj0EAwIw +ODEVMBMGA1UECgwMTG9jYWxob3N0IENBMQswCQYDVQQGEwJVUzESMBAGA1UEAwwJ +bG9jYWxob3N0MB4XDTIxMTIwNzE2MjcxMVoXDTIyMTIwNzE2MjcxMVowODEVMBMG +A1UECgwMTG9jYWxob3N0IENBMQswCQYDVQQGEwJVUzESMBAGA1UEAwwJbG9jYWxo +b3N0MFkwEwYHKoZIzj0CAQYIKoZIzj0DAQcDQgAEuqX0ncb6eVo5Rxrnipmt5yzt +1bKhqEqCWEd7UCkoZ5RGBDtqOh8vs3wdFpOLiojBV0+CVbnJbdYg3U9BZI/Rz6NT +MFEwHQYDVR0OBBYEFDD8bPRhSZvhpr/ZyKZnSXGU2IH8MB8GA1UdIwQYMBaAFDD8 +bPRhSZvhpr/ZyKZnSXGU2IH8MA8GA1UdEwEB/wQFMAMBAf8wCgYIKoZIzj0EAwID +SAAwRQIgY3QiG7YAanbIaTLk+NSTpnfwkJCoyPlLkrFNQ9y4EccCIQDlcTRS7KPh +9e7KyRyHr3wJ2QBgMoDR7ywDaT1UE86EVg== +-----END CERTIFICATE----- From 6a23070f9e19de8f1bf8437d9486cef6821163a3 Mon Sep 17 00:00:00 2001 From: Tyler Young Date: Thu, 16 Dec 2021 11:56:13 -0500 Subject: [PATCH 02/30] extract mac from linux appveyor build --- CMakeLists.txt | 9 ++++++ appveyor-linux.yml | 1 - appveyor-macos.yml | 59 +++++++++++++++++++++++++++++++++++++ appveyor-windows-shared.cmd | 28 ++++++++++++++++++ 4 files changed, 96 insertions(+), 1 deletion(-) create mode 100644 appveyor-macos.yml create mode 100644 appveyor-windows-shared.cmd diff --git a/CMakeLists.txt b/CMakeLists.txt index f42dcc99d..1c1c356ba 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -222,6 +222,15 @@ IF(CMAKE_SYSTEM_NAME STREQUAL "FreeBSD" OR CMAKE_SYSTEM_NAME STREQUAL "Darwin") ENDIF() IF (CMAKE_SYSTEM_NAME STREQUAL Windows) + + IF(DEFINED ENV{VCPKG_ROOT} AND NOT DEFINED CMAKE_TOOLCHAIN_FILE) + SET(CMAKE_TOOLCHAIN_FILE "$ENV{VCPKG_ROOT}/scripts/buildsystems/vcpkg.cmake" + CACHE STRING "") + ENDIF() + + # actually load vcpkg.cmake + INCLUDE("${CMAKE_TOOLCHAIN_FILE}") + FIND_PATH(GETOPT_INCLUDE_DIR NAMES getopt.h) IF (GETOPT_INCLUDE_DIR) INCLUDE_DIRECTORIES(${GETOPT_INCLUDE_DIR}) diff --git a/appveyor-linux.yml b/appveyor-linux.yml index 059868fbc..13190ae2a 100644 --- a/appveyor-linux.yml +++ b/appveyor-linux.yml @@ -2,7 +2,6 @@ version: 2.{branch}.{build} image: - Ubuntu2004 -- MacOS build: off diff --git a/appveyor-macos.yml b/appveyor-macos.yml new file mode 100644 index 000000000..ff585247b --- /dev/null +++ b/appveyor-macos.yml @@ -0,0 +1,59 @@ +version: 2.{branch}.{build} + +image: +- MacOS + +build: off + +init: + +cache: +- boringssl -> boringssl-target.txt # we define the commit in here + +install: + +- sh: >- + + if [[ -e ./boringssl/CMakeLists.txt ]] ; then + + echo cached + + else + + git clone https://boringssl.googlesource.com/boringssl + + cd boringssl + + git checkout $(<../boringssl-target.txt) + + cmake . + + make -j2 crypto ssl decrepit + + cd .. + + fi + + git submodule init + + git submodule update --checkout --force --recursive + + cmake -DBORINGSSL_DIR=$PWD/boringssl . + + make -j2 lsquic build-tests + +test_script: + +- sh: >- + + make test + + make -j2 perf_server perf_client + + ./bin/perf_server -L notice -s ::1:8443 -c localhost,tests/localhost.pem,tests/localhost.key & + + PERF_SERVER_PID=$! + + time ./bin/perf_client -L info -s ::1:8443 -p 104857600:104857600 + + kill $PERF_SERVER_PID diff --git a/appveyor-windows-shared.cmd b/appveyor-windows-shared.cmd new file mode 100644 index 000000000..8836b8463 --- /dev/null +++ b/appveyor-windows-shared.cmd @@ -0,0 +1,28 @@ +vcpkg list + +if exist ".\boringssl\CMakeLists.txt" ( + echo cached +) else ( + git clone https://boringssl.googlesource.com/boringssl + cd boringssl + git checkout a2278d4d2cabe73f6663e3299ea7808edfa306b9 + cmake -DCMAKE_GENERATOR_PLATFORM=x64 --config Debug -DBUILD_SHARED_LIBS=ON -DOPENSSL_NO_ASM=1 . + msbuild /m ALL_BUILD.vcxproj + cd .. +) + +git submodule init + +git submodule update --checkout --force --recursive + +set VCPKG_ROOT=c:/tools/vcpkg/ + +cmake -DCMAKE_GENERATOR_PLATFORM=x64 -DLSQUIC_SHARED_LIB=ON -DBUILD_SHARED_LIBS=ON -DVCPKG_TARGET_TRIPLET=x64-windows -DCMAKE_BUILD_TYPE=Debug -DCMAKE_TOOLCHAIN_FILE=c:/tools/vcpkg/scripts/buildsystems/vcpkg.cmake -DBORINGSSL_DIR=%cd%\boringssl -DCMAKE_WINDOWS_EXPORT_ALL_SYMBOLS=ON . + +msbuild /m src/liblsquic/lsquic.vcxproj +msbuild /m build-tests.vcxproj + +msbuild /m RUN_TESTS.vcxproj + + + From 698dfe13b791a83c04152ed3988f32201c1f07b4 Mon Sep 17 00:00:00 2001 From: Tyler Young Date: Thu, 16 Dec 2021 12:08:40 -0500 Subject: [PATCH 03/30] separate windows static and shared builds add perf test for windows add .gitignore for generated files reduce build scope for windows builds through appveyor since appveyor sometimes times out connecting to github, add 10 attempt retry to submodule update --- .gitignore | 3 +++ appveyor-linux.yml | 18 +++++++++++++----- appveyor-macos.yml | 16 ++++++++++++---- appveyor-windows-shared.cmd | 28 +++++++++++++++++++--------- appveyor-windows-shared.yml | 33 +++++++++++++++++++++++++++++++++ appveyor-windows-test.cmd | 15 +++++++++++++++ appveyor-windows.cmd | 25 +++++++++++++++++++------ appveyor-windows.yml | 11 +++++------ 8 files changed, 119 insertions(+), 30 deletions(-) create mode 100644 .gitignore create mode 100644 appveyor-windows-shared.yml create mode 100644 appveyor-windows-test.cmd diff --git a/.gitignore b/.gitignore new file mode 100644 index 000000000..cf53a959d --- /dev/null +++ b/.gitignore @@ -0,0 +1,3 @@ +/bin/test_config.h +/src/liblsquic/lsquic_versions_to_string.c +/build diff --git a/appveyor-linux.yml b/appveyor-linux.yml index 13190ae2a..0c0debc76 100644 --- a/appveyor-linux.yml +++ b/appveyor-linux.yml @@ -3,14 +3,14 @@ version: 2.{branch}.{build} image: - Ubuntu2004 -build: off - -init: - cache: - $HOME/.apt - boringssl -> boringssl-target.txt # we define the commit in here +build: off + +init: + install: - sh: >- @@ -43,7 +43,15 @@ install: git submodule init - git submodule update --checkout --force --recursive + n=0 + + until git submodule update --checkout --force --recursive ; do + + [ "$n" -ge 10 ] && exit 1 + + n=$((n+1)) + + done sudo apt update -qq diff --git a/appveyor-macos.yml b/appveyor-macos.yml index ff585247b..e3147f3a6 100644 --- a/appveyor-macos.yml +++ b/appveyor-macos.yml @@ -3,13 +3,13 @@ version: 2.{branch}.{build} image: - MacOS +cache: +- boringssl -> boringssl-target.txt # we define the commit in here + build: off init: -cache: -- boringssl -> boringssl-target.txt # we define the commit in here - install: - sh: >- @@ -36,7 +36,15 @@ install: git submodule init - git submodule update --checkout --force --recursive + n=0 + + until git submodule update --checkout --force --recursive ; do + + [ "$n" -ge 10 ] && exit 1 + + n=$((n+1)) + + done cmake -DBORINGSSL_DIR=$PWD/boringssl . diff --git a/appveyor-windows-shared.cmd b/appveyor-windows-shared.cmd index 8836b8463..2170e4553 100644 --- a/appveyor-windows-shared.cmd +++ b/appveyor-windows-shared.cmd @@ -1,28 +1,38 @@ +setlocal EnableDelayedExpansion vcpkg list if exist ".\boringssl\CMakeLists.txt" ( - echo cached + echo boringssl cached ) else ( git clone https://boringssl.googlesource.com/boringssl cd boringssl - git checkout a2278d4d2cabe73f6663e3299ea7808edfa306b9 + for /f %%t in (boringssl-target.txt) do set BORINGSSL_TARGET=%%t + git checkout %BORINGSSL_TARGET% cmake -DCMAKE_GENERATOR_PLATFORM=x64 --config Debug -DBUILD_SHARED_LIBS=ON -DOPENSSL_NO_ASM=1 . - msbuild /m ALL_BUILD.vcxproj + msbuild /m crypto\crypto.vcxproj + if errorlevel 1 exit !errorlevel! + msbuild /m ssl\ssl.vcxproj + if errorlevel 1 exit !errorlevel! + msbuild /m decrepit\decrepit.vcxproj + if errorlevel 1 exit !errorlevel! cd .. ) git submodule init +set retry_submodule_update=0 +:retry_submodule_update +set /a retry_submodule_update+=1 git submodule update --checkout --force --recursive +if %retry_submodule_update% gtr 10 exit !errorlevel! +if errorlevel 1 goto :retry_submodule_update set VCPKG_ROOT=c:/tools/vcpkg/ cmake -DCMAKE_GENERATOR_PLATFORM=x64 -DLSQUIC_SHARED_LIB=ON -DBUILD_SHARED_LIBS=ON -DVCPKG_TARGET_TRIPLET=x64-windows -DCMAKE_BUILD_TYPE=Debug -DCMAKE_TOOLCHAIN_FILE=c:/tools/vcpkg/scripts/buildsystems/vcpkg.cmake -DBORINGSSL_DIR=%cd%\boringssl -DCMAKE_WINDOWS_EXPORT_ALL_SYMBOLS=ON . -msbuild /m src/liblsquic/lsquic.vcxproj -msbuild /m build-tests.vcxproj - -msbuild /m RUN_TESTS.vcxproj - - +msbuild /m src\liblsquic\lsquic.vcxproj +if errorlevel 1 exit !errorlevel! +msbuild /m tests\build-tests.vcxproj +if errorlevel 1 exit !errorlevel! diff --git a/appveyor-windows-shared.yml b/appveyor-windows-shared.yml new file mode 100644 index 000000000..2ae940105 --- /dev/null +++ b/appveyor-windows-shared.yml @@ -0,0 +1,33 @@ +version: 1.{branch}.{build} + +image: Visual Studio 2017 + +cache: +- c:\tools\vcpkg\installed +- boringssl -> boringssl-target.txt # we define the commit in here + +init: + +- cmd: '' + +install: + +- cmd: >- + + vcpkg install zlib:x64-windows + + vcpkg install libevent:x64-windows + + vcpkg install pcre:x64-windows + + vcpkg install getopt:x64-windows + + vcpkg integrate install + +build_script: + +- cmd: appveyor-windows-shared.cmd + +test_script: + +- cmd: appveyor-windows-test.cmd diff --git a/appveyor-windows-test.cmd b/appveyor-windows-test.cmd new file mode 100644 index 000000000..c110bfc16 --- /dev/null +++ b/appveyor-windows-test.cmd @@ -0,0 +1,15 @@ +msbuild /m RUN_TESTS.vcxproj +if errorlevel 1 exit !errorlevel! + +msbuild /m perf_server.vcxproj +if errorlevel 1 exit !errorlevel! +msbuild /m perf_client.vcxproj +if errorlevel 1 exit !errorlevel! + +.\bin\perf_server -L notice -s ::1:8443 -c localhost,tests/localhost.pem,tests/localhost.key + +echo Started @ %time% +.\bin\perf_client -L info -s ::1:8443 -p 104857600:104857600 +echo Finished @ %time% + +tskill perf_server diff --git a/appveyor-windows.cmd b/appveyor-windows.cmd index 354e21c81..c4268c385 100644 --- a/appveyor-windows.cmd +++ b/appveyor-windows.cmd @@ -1,23 +1,36 @@ vcpkg list if exist ".\boringssl\CMakeLists.txt" ( - echo cached + echo boringssl cached ) else ( git clone https://boringssl.googlesource.com/boringssl cd boringssl - git checkout a2278d4d2cabe73f6663e3299ea7808edfa306b9 + for /f %%t in (boringssl-target.txt) do set BORINGSSL_TARGET=%%t + git checkout %BORINGSSL_TARGET% cmake -DCMAKE_GENERATOR_PLATFORM=x64 --config Debug -DBUILD_SHARED_LIBS=OFF -DOPENSSL_NO_ASM=1 . - msbuild /m ALL_BUILD.vcxproj + msbuild /m crypto\crypto.vcxproj + if errorlevel 1 exit !errorlevel! + msbuild /m ssl\ssl.vcxproj + if errorlevel 1 exit !errorlevel! + msbuild /m decrepit\decrepit.vcxproj + if errorlevel 1 exit !errorlevel! cd .. ) git submodule init +set retry_submodule_update=0 +:retry_submodule_update +set /a retry_submodule_update+=1 git submodule update --checkout --force --recursive +if %retry_submodule_update% gtr 10 exit !errorlevel! +if errorlevel 1 goto :retry_submodule_update set VCPKG_ROOT=c:/tools/vcpkg/ -cmake -DCMAKE_GENERATOR_PLATFORM=x64 -DBUILD_SHARED_LIBS=OFF -DVCPKG_TARGET_TRIPLET=x64-windows-static -DCMAKE_BUILD_TYPE=Debug -DCMAKE_TOOLCHAIN_FILE=c:/tools/vcpkg/scripts/buildsystems/vcpkg.cmake -DGETOPT_INCLUDE_DIR=c:/tools/vcpkg/installed/x64-windows/include -DGETOPT_LIB=c:/tools/vcpkg/installed/x64-windows/lib/getopt.lib -DBORINGSSL_DIR=%cd%\boringssl . +cmake -DCMAKE_GENERATOR_PLATFORM=x64 -DBUILD_SHARED_LIBS=OFF -DVCPKG_TARGET_TRIPLET=x64-windows-static -DCMAKE_BUILD_TYPE=Debug -DCMAKE_TOOLCHAIN_FILE=c:/tools/vcpkg/scripts/buildsystems/vcpkg.cmake -DBORINGSSL_DIR=%cd%\boringssl . - -msbuild /m ALL_BUILD.vcxproj +msbuild /m src\liblsquic\lsquic.vcxproj +if errorlevel 1 exit !errorlevel! +msbuild /m tests\build-tests.vcxproj +if errorlevel 1 exit !errorlevel! diff --git a/appveyor-windows.yml b/appveyor-windows.yml index 1aee700c7..acc0b9dc7 100644 --- a/appveyor-windows.yml +++ b/appveyor-windows.yml @@ -2,6 +2,10 @@ version: 1.{branch}.{build} image: Visual Studio 2017 +cache: +- c:\tools\vcpkg\installed +- boringssl -> boringssl-target.txt # we define the commit in here + init: - cmd: '' @@ -19,15 +23,10 @@ install: vcpkg install getopt:x64-windows vcpkg integrate install - -cache: -- c:\tools\vcpkg\installed -- boringssl -> appveyor-windows.yml, appveyor-windows.cmd # we define the commit in here - build_script: - cmd: appveyor-windows.cmd test_script: -- cmd: msbuild /m RUN_TESTS.vcxproj +- cmd: appveyor-windows-test.cmd From 7bfa8ed5982fca3a745ac5e150373ee52181f72d Mon Sep 17 00:00:00 2001 From: Tyler Young Date: Fri, 17 Dec 2021 12:13:20 -0500 Subject: [PATCH 04/30] improve vcpkg integration --- CMakeLists.txt | 16 +++++++++++++--- appveyor-linux.yml | 3 +++ appveyor-macos.yml | 3 +++ appveyor-windows-shared.yml | 3 +++ appveyor-windows.yml | 3 +++ tests/CMakeLists.txt | 16 ++++++++-------- 6 files changed, 33 insertions(+), 11 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 1c1c356ba..325cfebfe 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -229,19 +229,29 @@ IF (CMAKE_SYSTEM_NAME STREQUAL Windows) ENDIF() # actually load vcpkg.cmake + MESSAGE(STATUS "Loading ${CMAKE_TOOLCHAIN_FILE}") INCLUDE("${CMAKE_TOOLCHAIN_FILE}") - FIND_PATH(GETOPT_INCLUDE_DIR NAMES getopt.h) + IF(CONFIG STREQUAL "Debug") + SET(VCPKG_INSTALLED_DIR_X64_WINDOWS "${VCPKG_INSTALLED_DIR}/x64-windows/Debug") + ELSE() + SET(VCPKG_INSTALLED_DIR_X64_WINDOWS "${VCPKG_INSTALLED_DIR}/x64-windows") + ENDIF() + + FIND_PATH(GETOPT_INCLUDE_DIR NAMES getopt.h PATHS "${VCPKG_INSTALLED_DIR_X64_WINDOWS}/include") + IF (GETOPT_INCLUDE_DIR) INCLUDE_DIRECTORIES(${GETOPT_INCLUDE_DIR}) ELSE() MESSAGE(FATAL_ERROR "getopt.h was not found") ENDIF() - FIND_LIBRARY(GETOPT_LIB getopt) + + FIND_LIBRARY(GETOPT_LIB getopt PATHS "${VCPKG_INSTALLED_DIR_X64_WINDOWS}/lib") + IF(GETOPT_LIB) MESSAGE(STATUS "Found getopt: ${GETOPT_LIB}") ELSE() - MESSAGE(STATUS "getopt not found") + MESSAGE(STATUS "getopt library was not found") ENDIF() ENDIF() diff --git a/appveyor-linux.yml b/appveyor-linux.yml index 0c0debc76..3aaa5df58 100644 --- a/appveyor-linux.yml +++ b/appveyor-linux.yml @@ -7,6 +7,9 @@ cache: - $HOME/.apt - boringssl -> boringssl-target.txt # we define the commit in here +environment: + APPVEYOR_SAVE_CACHE_ON_ERROR: true + build: off init: diff --git a/appveyor-macos.yml b/appveyor-macos.yml index e3147f3a6..99b46dda9 100644 --- a/appveyor-macos.yml +++ b/appveyor-macos.yml @@ -6,6 +6,9 @@ image: cache: - boringssl -> boringssl-target.txt # we define the commit in here +environment: + APPVEYOR_SAVE_CACHE_ON_ERROR: true + build: off init: diff --git a/appveyor-windows-shared.yml b/appveyor-windows-shared.yml index 2ae940105..1e289bae0 100644 --- a/appveyor-windows-shared.yml +++ b/appveyor-windows-shared.yml @@ -6,6 +6,9 @@ cache: - c:\tools\vcpkg\installed - boringssl -> boringssl-target.txt # we define the commit in here +environment: + APPVEYOR_SAVE_CACHE_ON_ERROR: true + init: - cmd: '' diff --git a/appveyor-windows.yml b/appveyor-windows.yml index acc0b9dc7..c44e94ea3 100644 --- a/appveyor-windows.yml +++ b/appveyor-windows.yml @@ -6,6 +6,9 @@ cache: - c:\tools\vcpkg\installed - boringssl -> boringssl-target.txt # we define the commit in here +environment: + APPVEYOR_SAVE_CACHE_ON_ERROR: true + init: - cmd: '' diff --git a/tests/CMakeLists.txt b/tests/CMakeLists.txt index a5ef42171..005fcf314 100644 --- a/tests/CMakeLists.txt +++ b/tests/CMakeLists.txt @@ -98,17 +98,17 @@ FOREACH(TEST_NAME ${TESTS}) ELSE() TARGET_LINK_LIBRARIES(test_${TEST_NAME} ${LIBS} ${GETOPT_LIB} ${LIB_FLAGS}) # copy any dependencies local to the tests - #IF (${CMAKE_VERSION} VERSION_LESS "3.21.0") + IF (${CMAKE_VERSION} VERSION_LESS "3.21.0") ADD_CUSTOM_COMMAND(TARGET test_${TEST_NAME} POST_BUILD - COMMAND ${CMAKE_COMMAND} -E copy \"$ENV{VCPKG_ROOT}/installed/x64-windows$<$:/debug>/bin/getopt.dll\" \"$\" + COMMAND ${CMAKE_COMMAND} -E copy \"${VCPKG_INSTALLED_DIR_X64_WINDOWS}/bin/getopt.dll\" \"$\" COMMAND_EXPAND_LISTS ) - #ELSE() - # ADD_CUSTOM_COMMAND(TARGET test_${TEST_NAME} POST_BUILD - # COMMAND if not \"\"=="$" ${CMAKE_COMMAND} -E copy $ $ - # COMMAND_EXPAND_LISTS - # ) - #ENDIF() + ELSE() + ADD_CUSTOM_COMMAND(TARGET test_${TEST_NAME} POST_BUILD + COMMAND if not \"\"=="$" ${CMAKE_COMMAND} -E copy $ $ + COMMAND_EXPAND_LISTS + ) + ENDIF() ENDIF() ADD_TEST(${TEST_NAME} test_${TEST_NAME}) ADD_DEPENDENCIES(build-tests test_${TEST_NAME}) From 4f6af099e19941ee41016f71950e8facc83a896b Mon Sep 17 00:00:00 2001 From: Tyler Young Date: Mon, 10 Jan 2022 11:32:57 -0500 Subject: [PATCH 05/30] improve vcpkg integration use pcre2 over pcre on windows (avoids weird import linkage issue under shared build) try installing debs directly from cache instead of apt updating copy depended dlls as needed for tests, bins fix regex lookup xplat --- CMakeLists.txt | 142 +++++++++++++++++----------- appveyor-linux.yml | 41 +++++--- appveyor-macos.yml | 24 +++-- appveyor-windows-shared.cmd | 16 +++- appveyor-windows-shared.yml | 7 +- appveyor-windows-test.cmd | 15 +-- appveyor-windows.cmd | 17 +++- appveyor-windows.yml | 8 +- bin/CMakeLists.txt | 184 +++++++++++++++++++++++++----------- bin/http_server.c | 9 +- bin/test_common.c | 8 +- bin/test_config.h.in | 2 + tests/CMakeLists.txt | 38 +++++--- 13 files changed, 347 insertions(+), 164 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 325cfebfe..679de5cfe 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -152,40 +152,48 @@ ELSE() ENDIF() IF (NOT DEFINED BORINGSSL_INCLUDE AND DEFINED BORINGSSL_DIR) - FIND_PATH(BORINGSSL_INCLUDE NAMES openssl/ssl.h - PATHS ${BORINGSSL_DIR}/include - NO_DEFAULT_PATH) + SET(BORINGSSL_INCLUDE "${BORINGSSL_DIR}/include") ENDIF() + # This must be done before adding other include directories to take # precedence over header files from other SSL installs. IF (BORINGSSL_INCLUDE) - MESSAGE(STATUS "BoringSSL include directory ${BORINGSSL_INCLUDE}") - INCLUDE_DIRECTORIES(${BORINGSSL_INCLUDE}) + MESSAGE(STATUS "BoringSSL include directory: ${BORINGSSL_INCLUDE}") + INCLUDE_DIRECTORIES(${BORINGSSL_INCLUDE}) ELSE() - MESSAGE(FATAL_ERROR "BoringSSL headers not found") + MESSAGE(FATAL_ERROR "BoringSSL headers not found") ENDIF() IF (NOT DEFINED BORINGSSL_LIB AND DEFINED BORINGSSL_DIR) - FOREACH(LIB_NAME ssl crypto decrepit) - IF (CMAKE_SYSTEM_NAME STREQUAL Windows) - FIND_LIBRARY(BORINGSSL_LIB_${LIB_NAME} - NAMES ${LIB_NAME} - PATHS ${BORINGSSL_DIR}/${LIB_NAME} - PATH_SUFFIXES Debug Release MinSizeRel RelWithDebInfo - NO_DEFAULT_PATH) - ELSE() - FIND_LIBRARY(BORINGSSL_LIB_${LIB_NAME} - NAMES lib${LIB_NAME}${LIB_SUFFIX} - PATHS ${BORINGSSL_DIR}/${LIB_NAME} - NO_DEFAULT_PATH) - ENDIF() - IF(BORINGSSL_LIB_${LIB_NAME}) - MESSAGE(STATUS "Found ${LIB_NAME} library: ${BORINGSSL_LIB_${LIB_NAME}}") + FOREACH(LIB_NAME ssl crypto decrepit) + IF (CMAKE_SYSTEM_NAME STREQUAL Windows) + FIND_LIBRARY(BORINGSSL_LIB_${LIB_NAME} + NAMES ${LIB_NAME} + PATHS ${BORINGSSL_DIR}/${LIB_NAME} + PATH_SUFFIXES Debug Release MinSizeRel RelWithDebInfo + NO_DEFAULT_PATH) + + IF(DEFINED BORINGSSL_DIR) + file(GLOB_RECURSE BORINGSSL_DLL_${LIB_NAME} + "${BORINGSSL_DIR}/**/${LIB_NAME}.dll") ELSE() - MESSAGE(STATUS "${LIB_NAME} library not found") + file(GLOB_RECURSE BORINGSSL_DLL_${LIB_NAME} + "${BORINGSSL_INCLUDE}/../**/${LIB_NAME}.dll") ENDIF() - ENDFOREACH() + ELSE() + FIND_LIBRARY(BORINGSSL_LIB_${LIB_NAME} + NAMES lib${LIB_NAME}${LIB_SUFFIX} + PATHS ${BORINGSSL_DIR}/${LIB_NAME} + NO_DEFAULT_PATH) + ENDIF() + + IF(BORINGSSL_LIB_${LIB_NAME}) + MESSAGE(STATUS "Found ${LIB_NAME} library: ${BORINGSSL_LIB_${LIB_NAME}}") + ELSE() + MESSAGE(STATUS "${LIB_NAME} library not found") + ENDIF() + ENDFOREACH() ELSE() @@ -221,38 +229,64 @@ IF(CMAKE_SYSTEM_NAME STREQUAL "FreeBSD" OR CMAKE_SYSTEM_NAME STREQUAL "Darwin") link_directories( /usr/local/lib ) ENDIF() -IF (CMAKE_SYSTEM_NAME STREQUAL Windows) - - IF(DEFINED ENV{VCPKG_ROOT} AND NOT DEFINED CMAKE_TOOLCHAIN_FILE) - SET(CMAKE_TOOLCHAIN_FILE "$ENV{VCPKG_ROOT}/scripts/buildsystems/vcpkg.cmake" - CACHE STRING "") - ENDIF() - - # actually load vcpkg.cmake - MESSAGE(STATUS "Loading ${CMAKE_TOOLCHAIN_FILE}") - INCLUDE("${CMAKE_TOOLCHAIN_FILE}") - - IF(CONFIG STREQUAL "Debug") - SET(VCPKG_INSTALLED_DIR_X64_WINDOWS "${VCPKG_INSTALLED_DIR}/x64-windows/Debug") - ELSE() - SET(VCPKG_INSTALLED_DIR_X64_WINDOWS "${VCPKG_INSTALLED_DIR}/x64-windows") - ENDIF() - - FIND_PATH(GETOPT_INCLUDE_DIR NAMES getopt.h PATHS "${VCPKG_INSTALLED_DIR_X64_WINDOWS}/include") - - IF (GETOPT_INCLUDE_DIR) - INCLUDE_DIRECTORIES(${GETOPT_INCLUDE_DIR}) - ELSE() - MESSAGE(FATAL_ERROR "getopt.h was not found") - ENDIF() - - FIND_LIBRARY(GETOPT_LIB getopt PATHS "${VCPKG_INSTALLED_DIR_X64_WINDOWS}/lib") +IF (MSVC) - IF(GETOPT_LIB) - MESSAGE(STATUS "Found getopt: ${GETOPT_LIB}") - ELSE() - MESSAGE(STATUS "getopt library was not found") - ENDIF() + IF(DEFINED ENV{VCPKG_ROOT} AND NOT DEFINED CMAKE_TOOLCHAIN_FILE) + SET(CMAKE_TOOLCHAIN_FILE "$ENV{VCPKG_ROOT}/scripts/buildsystems/vcpkg.cmake" + CACHE STRING "") + ELSEIF(NOT DEFINED ENV{VCPKG_ROOT} AND DEFINED CMAKE_TOOLCHAIN_FILE) + MESSAGE(STATUS "Attempting to guess VCPKG_ROOT...") + STRING(TOLOWER ${CMAKE_TOOLCHAIN_FILE} _VCPKG_ROOT) + STRING(REGEX REPLACE "^(.*)[\\/]scripts[\\/]buildsystems[\\/]vcpkg.cmake$" "\\1" + _VCPKG_ROOT "${_VCPKG_ROOT}") + SET(ENV{VCPKG_ROOT} "${_VCPKG_ROOT}") + ENDIF() + + MESSAGE(STATUS "VCPKG_ROOT: $ENV{VCPKG_ROOT}") + + # actually load vcpkg.cmake + MESSAGE(STATUS "Loading ${CMAKE_TOOLCHAIN_FILE}") + INCLUDE("${CMAKE_TOOLCHAIN_FILE}") + + IF(NOT DEFINED VCPKG_INSTALLED_DIR AND DEFINED _VCPKG_INSTALLED_DIR) + SET(VCPKG_INSTALLED_DIR "${_VCPKG_INSTALLED_DIR}") + ENDIF() + IF(NOT DEFINED VCPKG_INSTALLED_DIR AND DEFINED ENV{VCPKG_ROOT}) + SET(VCPKG_INSTALLED_DIR "$ENV{VCPKG_ROOT}/installed") + ENDIF() + MESSAGE(STATUS "VCPKG_INSTALLED_DIR: ${VCPKG_INSTALLED_DIR}") + + SET(VCPKG_INSTALLED_DIR_TRIPLET "${VCPKG_INSTALLED_DIR}/${VCPKG_TARGET_TRIPLET}") + + # add includes directory + MESSAGE(STATUS "Including ${VCPKG_INSTALLED_DIR_TRIPLET}/include") + INCLUDE_DIRECTORIES("${VCPKG_INSTALLED_DIR_TRIPLET}/include") + + SET(VCPKG_INSTALLED_DIR_X64_WINDOWS "${VCPKG_INSTALLED_DIR}/x64-windows") + + IF(CONFIG STREQUAL "Debug") + SET(VCPKG_DEBUG "/Debug") + ELSE() + SET(VCPKG_DEBUG "") + ENDIF() + + MESSAGE(STATUS "Looking for getopt.h (hint: ${VCPKG_INSTALLED_DIR_X64_WINDOWS}/include)") + # getopt is always shared on windows + FIND_PATH(GETOPT_INCLUDE_DIR NAMES getopt.h HINTS "${VCPKG_INSTALLED_DIR_X64_WINDOWS}/include") + + IF (GETOPT_INCLUDE_DIR) + INCLUDE_DIRECTORIES(${GETOPT_INCLUDE_DIR}) + ELSE() + MESSAGE(FATAL_ERROR "getopt.h was not found") + ENDIF() + + FIND_LIBRARY(GETOPT_LIB getopt PATHS "${VCPKG_INSTALLED_DIR_X64_WINDOWS}${VCPKG_DEBUG}/lib") + + IF(GETOPT_LIB) + MESSAGE(STATUS "Found getopt: ${GETOPT_LIB}") + ELSE() + MESSAGE(STATUS "getopt library was not found") + ENDIF() ENDIF() # Find zlib and libevent header files and library files diff --git a/appveyor-linux.yml b/appveyor-linux.yml index 3aaa5df58..3687a1c68 100644 --- a/appveyor-linux.yml +++ b/appveyor-linux.yml @@ -18,32 +18,45 @@ install: - sh: >- - if [[ -e ~/.apt ]] ; then + if compgen -G "~/.apt/libevent-dev*.deb" ; then - sudo mv $HOME/.apt/* /var/cache/apt/archives/ + sudo apt install -y ~/.apt/libevent-dev*.deb + + else + + sudo apt update -qq + + sudo apt -y --no-install-recommends install libevent-dev fi - if [[ -e ./boringssl/CMakeLists.txt ]] ; then - echo cached + if [[ -f ./boringssl/include/openssl/ssl.h ]] ; then + + echo boringssl cached else git clone https://boringssl.googlesource.com/boringssl - cd boringssl + fi - git checkout $(<../boringssl-target.txt) + cd boringssl - cmake . + if [[ -d .git ]] ; then - make -j2 crypto ssl decrepit + git reset --hard $(<../boringssl-target.txt) - cd .. + rm -rf .git fi + cmake . + + make -j2 crypto ssl decrepit + + cd .. + git submodule init n=0 @@ -56,13 +69,9 @@ install: done - sudo apt update -qq - - sudo apt -y --no-install-recommends install libevent-dev - mkdir -p $HOME/.apt - sudo mv /var/cache/apt/archives/libevent*.deb $HOME/.apt/ + sudo mv -v /var/cache/apt/archives/libevent-dev*.deb $HOME/.apt/ cmake -DBORINGSSL_DIR=$PWD/boringssl . @@ -72,10 +81,14 @@ test_script: - sh: >- + make help + make test make -j2 perf_server perf_client + find . -name perf_server -o -name perf_client + ./bin/perf_server -L notice -s ::1:8443 -c localhost,tests/localhost.pem,tests/localhost.key & PERF_SERVER_PID=$! diff --git a/appveyor-macos.yml b/appveyor-macos.yml index 99b46dda9..658d58826 100644 --- a/appveyor-macos.yml +++ b/appveyor-macos.yml @@ -17,26 +17,32 @@ install: - sh: >- - if [[ -e ./boringssl/CMakeLists.txt ]] ; then + if [[ -f ./boringssl/include/openssl/ssl.h ]] ; then - echo cached + echo boringssl cached else git clone https://boringssl.googlesource.com/boringssl - cd boringssl + fi - git checkout $(<../boringssl-target.txt) + cd boringssl - cmake . + if [[ -d .git ]] ; then - make -j2 crypto ssl decrepit + git reset --hard $(<../boringssl-target.txt) - cd .. + rm -rf .git fi + cmake . + + make -j2 crypto ssl decrepit + + cd .. + git submodule init n=0 @@ -57,10 +63,14 @@ test_script: - sh: >- + make help + make test make -j2 perf_server perf_client + find . -name perf_server -o -name perf_client + ./bin/perf_server -L notice -s ::1:8443 -c localhost,tests/localhost.pem,tests/localhost.key & PERF_SERVER_PID=$! diff --git a/appveyor-windows-shared.cmd b/appveyor-windows-shared.cmd index 2170e4553..cb315a9d4 100644 --- a/appveyor-windows-shared.cmd +++ b/appveyor-windows-shared.cmd @@ -1,13 +1,23 @@ setlocal EnableDelayedExpansion +for /f "usebackq delims=#" %%a in (`"%programfiles(x86)%\Microsoft Visual Studio\Installer\vswhere" -latest -property installationPath`) do call "%%~a\VC\Auxiliary\Build\vcvars64.bat" + +set VCPKG_ROOT=c:/tools/vcpkg/ + +pushd c:\tools\vcpkg\ +dir /a /s /b *pcre*.h +popd + vcpkg list -if exist ".\boringssl\CMakeLists.txt" ( +for /f %%t in (boringssl-target.txt) do set BORINGSSL_TARGET=%%t + +if exist ".\boringssl\include\openssl\ssl.h" ( echo boringssl cached ) else ( git clone https://boringssl.googlesource.com/boringssl cd boringssl - for /f %%t in (boringssl-target.txt) do set BORINGSSL_TARGET=%%t git checkout %BORINGSSL_TARGET% + rd /s /q .git cmake -DCMAKE_GENERATOR_PLATFORM=x64 --config Debug -DBUILD_SHARED_LIBS=ON -DOPENSSL_NO_ASM=1 . msbuild /m crypto\crypto.vcxproj if errorlevel 1 exit !errorlevel! @@ -27,8 +37,6 @@ git submodule update --checkout --force --recursive if %retry_submodule_update% gtr 10 exit !errorlevel! if errorlevel 1 goto :retry_submodule_update -set VCPKG_ROOT=c:/tools/vcpkg/ - cmake -DCMAKE_GENERATOR_PLATFORM=x64 -DLSQUIC_SHARED_LIB=ON -DBUILD_SHARED_LIBS=ON -DVCPKG_TARGET_TRIPLET=x64-windows -DCMAKE_BUILD_TYPE=Debug -DCMAKE_TOOLCHAIN_FILE=c:/tools/vcpkg/scripts/buildsystems/vcpkg.cmake -DBORINGSSL_DIR=%cd%\boringssl -DCMAKE_WINDOWS_EXPORT_ALL_SYMBOLS=ON . msbuild /m src\liblsquic\lsquic.vcxproj diff --git a/appveyor-windows-shared.yml b/appveyor-windows-shared.yml index 1e289bae0..bcd2a7589 100644 --- a/appveyor-windows-shared.yml +++ b/appveyor-windows-shared.yml @@ -3,8 +3,8 @@ version: 1.{branch}.{build} image: Visual Studio 2017 cache: -- c:\tools\vcpkg\installed -- boringssl -> boringssl-target.txt # we define the commit in here +- c:\tools\vcpkg\installed -> appveyor-windows-shared.yml +- boringssl -> appveyor-windows-shared.cmd,boringssl-target.txt # we define the commit in here environment: APPVEYOR_SAVE_CACHE_ON_ERROR: true @@ -21,7 +21,7 @@ install: vcpkg install libevent:x64-windows - vcpkg install pcre:x64-windows + vcpkg install pcre2:x64-windows vcpkg install getopt:x64-windows @@ -34,3 +34,4 @@ build_script: test_script: - cmd: appveyor-windows-test.cmd + diff --git a/appveyor-windows-test.cmd b/appveyor-windows-test.cmd index c110bfc16..2032ba0ee 100644 --- a/appveyor-windows-test.cmd +++ b/appveyor-windows-test.cmd @@ -1,15 +1,18 @@ +for /f "usebackq delims=#" %%a in (`"%programfiles(x86)%\Microsoft Visual Studio\Installer\vswhere" -latest -property installationPath`) do call "%%~a\VC\Auxiliary\Build\vcvars64.bat" + msbuild /m RUN_TESTS.vcxproj if errorlevel 1 exit !errorlevel! -msbuild /m perf_server.vcxproj +wevtutil qe Application /q:"*[System[TimeCreated[timediff(@SystemTime) <= 1209600000]]]" /f:text /c:1 + +msbuild /m bin\perf_server.vcxproj if errorlevel 1 exit !errorlevel! -msbuild /m perf_client.vcxproj +msbuild /m bin\perf_client.vcxproj if errorlevel 1 exit !errorlevel! -.\bin\perf_server -L notice -s ::1:8443 -c localhost,tests/localhost.pem,tests/localhost.key +start "" /B bin\Debug\perf_server -L notice -s ::1:8443 -c localhost,tests/localhost.pem,tests/localhost.key -echo Started @ %time% -.\bin\perf_client -L info -s ::1:8443 -p 104857600:104857600 -echo Finished @ %time% +bin\Debug\perf_client -L info -s ::1:8443 -p 104857600:104857600 tskill perf_server + diff --git a/appveyor-windows.cmd b/appveyor-windows.cmd index c4268c385..63c0531bb 100644 --- a/appveyor-windows.cmd +++ b/appveyor-windows.cmd @@ -1,12 +1,23 @@ +setlocal EnableDelayedExpansion +for /f "usebackq delims=#" %%a in (`"%programfiles(x86)%\Microsoft Visual Studio\Installer\vswhere" -latest -property installationPath`) do call "%%~a\VC\Auxiliary\Build\vcvars64.bat" + +set VCPKG_ROOT=c:/tools/vcpkg/ + +pushd c:\tools\vcpkg\ +dir /a /s /b *pcre*.h +popd + vcpkg list -if exist ".\boringssl\CMakeLists.txt" ( +for /f %%t in (boringssl-target.txt) do set BORINGSSL_TARGET=%%t + +if exist ".\boringssl\include\openssl\ssl.h" ( echo boringssl cached ) else ( git clone https://boringssl.googlesource.com/boringssl cd boringssl - for /f %%t in (boringssl-target.txt) do set BORINGSSL_TARGET=%%t git checkout %BORINGSSL_TARGET% + rd /s /q .git cmake -DCMAKE_GENERATOR_PLATFORM=x64 --config Debug -DBUILD_SHARED_LIBS=OFF -DOPENSSL_NO_ASM=1 . msbuild /m crypto\crypto.vcxproj if errorlevel 1 exit !errorlevel! @@ -26,8 +37,6 @@ git submodule update --checkout --force --recursive if %retry_submodule_update% gtr 10 exit !errorlevel! if errorlevel 1 goto :retry_submodule_update -set VCPKG_ROOT=c:/tools/vcpkg/ - cmake -DCMAKE_GENERATOR_PLATFORM=x64 -DBUILD_SHARED_LIBS=OFF -DVCPKG_TARGET_TRIPLET=x64-windows-static -DCMAKE_BUILD_TYPE=Debug -DCMAKE_TOOLCHAIN_FILE=c:/tools/vcpkg/scripts/buildsystems/vcpkg.cmake -DBORINGSSL_DIR=%cd%\boringssl . msbuild /m src\liblsquic\lsquic.vcxproj diff --git a/appveyor-windows.yml b/appveyor-windows.yml index c44e94ea3..f32a1ba70 100644 --- a/appveyor-windows.yml +++ b/appveyor-windows.yml @@ -3,8 +3,8 @@ version: 1.{branch}.{build} image: Visual Studio 2017 cache: -- c:\tools\vcpkg\installed -- boringssl -> boringssl-target.txt # we define the commit in here +- c:\tools\vcpkg\installed -> appveyor-windows.yml +- boringssl -> appveyor-windows.cmd,boringssl-target.txt # we define the commit in here environment: APPVEYOR_SAVE_CACHE_ON_ERROR: true @@ -21,11 +21,12 @@ install: vcpkg install libevent:x64-windows-static - vcpkg install pcre:x64-windows-static + vcpkg install pcre2:x64-windows-static vcpkg install getopt:x64-windows vcpkg integrate install + build_script: - cmd: appveyor-windows.cmd @@ -33,3 +34,4 @@ build_script: test_script: - cmd: appveyor-windows-test.cmd + diff --git a/bin/CMakeLists.txt b/bin/CMakeLists.txt index 28f2c756d..b3fe8f3b4 100644 --- a/bin/CMakeLists.txt +++ b/bin/CMakeLists.txt @@ -1,7 +1,64 @@ # Copyright (c) 2017 - 2021 LiteSpeed Technologies Inc. See LICENSE. LIST(APPEND LIBS ${EVENT_LIB}) -IF(MSVC) +# not working in appveyor-windows; odl cmake and vcpkg? +INCLUDE(CheckIncludeFile) + +CHECK_INCLUDE_FILE(regex.h HAVE_REGEX) +IF(NOT HAVE_REGEX) + + #CHECK_INCLUDE_FILE(pcre2posix.h HAVE_PCRE2) + + MESSAGE(STATUS "Checking ${VCPKG_INSTALLED_DIR_TRIPLET}/include") + + FIND_PATH(PCRE2_INCLUDE_DIR NAMES pcre2posix.h HINTS "${VCPKG_INSTALLED_DIR_TRIPLET}/include") + + IF (PCRE2_INCLUDE_DIR) + INCLUDE_DIRECTORIES(${PCRE2_INCLUDE_DIR}) + SET(HAVE_PCRE2 1) + ENDIF() + + + IF(HAVE_PCRE2) + MESSAGE(STATUS "Found pcre2posix.h") + FIND_LIBRARY(PCRE_LIB NAMES pcre2-32 pcre2-32-static) + IF(PCRE_LIB) + MESSAGE(STATUS "Found pcre2-32: ${PCRE_LIB}") + LIST(APPEND LIBS ${PCRE_LIB}) + ELSE() + MESSAGE(STATUS "pcre2-32 not found: http_server won't work") + ENDIF() + + FIND_LIBRARY(PCREPOSIX_LIB NAMES pcre2-posix pcre2-posix-static) + IF(PCREPOSIX_LIB) + MESSAGE(STATUS "Found pcre2-posix: ${PCREPOSIX_LIB}") + LIST(APPEND LIBS ${PCREPOSIX_LIB}) + ELSE() + MESSAGE(STATUS "pcre2-posix not found: http_server won't work") + ENDIF() + + IF(MSVC AND NOT VCPKG_TARGET_TRIPLET MATCHES "-static$") + FIND_PATH(PCRE_DLL "pcre2-32.dll" HINTS "${VCPKG_INSTALLED_DIR_X64_WINDOWS}/bin" REQUIRED) + FIND_PATH(PCREPOSIX_DLL "pcre2-posix.dll" HINTS "${VCPKG_INSTALLED_DIR_X64_WINDOWS}/bin" REQUIRED) + SET(PCRE_DLL "${PCRE_DLL}/pcre2-32.dll") + SET(PCREPOSIX_DLL "${PCREPOSIX_DLL}/pcre2-posix.dll") + MESSAGE(STATUS "Found pcre2-32.dll: ${PCRE_DLL}") + MESSAGE(STATUS "Found pcre2-posix.dll: ${PCREPOSIX_DLL}") + ENDIF() + ELSE() + MESSAGE(STATUS "pcre2posix.h not found.") + # NOT HAVE_PCRE2 + #CHECK_INCLUDE_FILE(pcreposix.h HAVE_PCRE) + FIND_PATH(PCRE_INCLUDE_DIR NAMES pcreposix.h HINTS "${VCPKG_INSTALLED_DIR_TRIPLET}/include") + + IF (PCRE_INCLUDE_DIR) + INCLUDE_DIRECTORIES(${PCRE_INCLUDE_DIR}) + SET(HAVE_PCRE 1) + ENDIF() + IF(NOT HAVE_PCRE) + MESSAGE(FATAL_ERROR "no supported regex library found (regex, pcre, pcre2)") + ENDIF() + MESSAGE(STATUS "Found pcreposix.h") FIND_LIBRARY(PCRE_LIB pcre) IF(PCRE_LIB) MESSAGE(STATUS "Found pcre: ${PCRE_LIB}") @@ -9,6 +66,7 @@ IF(MSVC) ELSE() MESSAGE(STATUS "pcre not found: http_server won't work") ENDIF() + FIND_LIBRARY(PCREPOSIX_LIB pcreposix) IF(PCREPOSIX_LIB) MESSAGE(STATUS "Found pcreposix: ${PCREPOSIX_LIB}") @@ -16,57 +74,80 @@ IF(MSVC) ELSE() MESSAGE(STATUS "pcreposix not found: http_server won't work") ENDIF() + + IF(MSVC AND NOT VCPKG_TARGET_TRIPLET MATCHES "-static$") + FIND_PATH(PCRE_DLL "pcre.dll" HINTS "${VCPKG_INSTALLED_DIR_X64_WINDOWS}/bin" REQUIRED) + FIND_PATH(PCREPOSIX_DLL "pcreposix.dll" HINTS "${VCPKG_INSTALLED_DIR_X64_WINDOWS}/bin" REQUIRED) + SET(PCRE_DLL "${PCRE_DLL}/pcre.dll") + SET(PCREPOSIX_DLL "${PCRE_DLL}/pcreposix.dll") + MESSAGE(STATUS "Found pcre.dll: ${PCRE_DLL}") + MESSAGE(STATUS "Found pcreposix.dll: ${PCREPOSIX_DLL}") + ENDIF() + ENDIF() + + IF (HAVE_PCRE OR HAVE_PCRE2) + SET(HAVE_REGEX 1) + ENDIF() +ENDIF() + +IF(MSVC) LIST(APPEND LIBS ws2_32) LIST(APPEND LIBS iphlpapi) LIST(APPEND LIBS ${GETOPT_LIB}) ENDIF() -add_executable(http_server http_server.c prog.c test_common.c test_cert.c) -IF(NOT MSVC) # TODO: port MD5 server and client to Windows -add_executable(md5_server md5_server.c prog.c test_common.c test_cert.c) -add_executable(md5_client md5_client.c prog.c test_common.c test_cert.c) +list(APPEND bin_targets http_client) +list(APPEND bin_targets http_server) +list(APPEND bin_targets echo_server) +list(APPEND bin_targets echo_client) +list(APPEND bin_targets duck_server) +list(APPEND bin_targets duck_client) +list(APPEND bin_targets perf_client) +list(APPEND bin_targets perf_server) +IF(NOT MSVC) +list(APPEND bin_targets md5_server) +list(APPEND bin_targets md5_client) ENDIF() -add_executable(echo_server echo_server.c prog.c test_common.c test_cert.c) -add_executable(echo_client echo_client.c prog.c test_common.c test_cert.c) -add_executable(duck_server duck_server.c prog.c test_common.c test_cert.c) -add_executable(duck_client duck_client.c prog.c test_common.c test_cert.c) -add_executable(perf_client perf_client.c prog.c test_common.c test_cert.c) -add_executable(perf_server perf_server.c prog.c test_common.c test_cert.c) - - -IF (NOT MSVC) - -add_executable(http_client - http_client.c - prog.c - test_common.c - test_cert.c -) -#MSVC -ELSE() +#MESSAGE(STATUS "bin_targets: ${bin_targets}") +#MESSAGE(STATUS "bin_targets LIBS: ${LIBS}") -add_executable(http_client - http_client.c - prog.c - test_common.c - test_cert.c -) - -ENDIF() +FOREACH(bin_target IN LISTS bin_targets) + add_executable(${bin_target} ${bin_target}.c prog.c test_common.c test_cert.c) + TARGET_LINK_LIBRARIES(${bin_target} ${LIBS}) +ENDFOREACH() -TARGET_LINK_LIBRARIES(http_client ${LIBS}) -TARGET_LINK_LIBRARIES(http_server ${LIBS}) -IF(NOT MSVC) -TARGET_LINK_LIBRARIES(md5_server ${LIBS}) -TARGET_LINK_LIBRARIES(md5_client ${LIBS}) +IF(MSVC) + FOREACH(bin_target IN LISTS bin_targets) + # copy any dependencies local to the targets + DD_CUSTOM_COMMAND(TARGET ${bin_target} POST_BUILD + COMMAND ${CMAKE_COMMAND} -E copy \"$\" \"$\" + COMMAND_EXPAND_LISTS + ) + ADD_CUSTOM_COMMAND(TARGET ${bin_target} POST_BUILD + COMMAND ${CMAKE_COMMAND} -E copy \"${VCPKG_INSTALLED_DIR_X64_WINDOWS}/bin/getopt.dll\" \"$\" + COMMAND_EXPAND_LISTS + ) + IF(EXISTS ${BORINGSSL_DLL_crypto}) + ADD_CUSTOM_COMMAND(TARGET ${bin_target} POST_BUILD + COMMAND ${CMAKE_COMMAND} -E copy \"${BORINGSSL_DLL_crypto}\" \"$\" + COMMAND_EXPAND_LISTS + ) + ENDIF() + IF(EXISTS ${BORINGSSL_DLL_ssl}) + ADD_CUSTOM_COMMAND(TARGET ${bin_target} POST_BUILD + COMMAND ${CMAKE_COMMAND} -E copy \"${BORINGSSL_DLL_ssl}\" \"$\" + COMMAND_EXPAND_LISTS + ) + ENDIF() + IF(EXISTS ${PCRE_DLL}) + ADD_CUSTOM_COMMAND(TARGET ${bin_target} POST_BUILD + COMMAND ${CMAKE_COMMAND} -E copy \"${PCRE_DLL}\" \"$\" + COMMAND_EXPAND_LISTS + ) + ENDIF() + ENDFOREACH() ENDIF() -TARGET_LINK_LIBRARIES(echo_server ${LIBS}) -TARGET_LINK_LIBRARIES(echo_client ${LIBS}) -TARGET_LINK_LIBRARIES(duck_server ${LIBS}) -TARGET_LINK_LIBRARIES(duck_client ${LIBS}) -TARGET_LINK_LIBRARIES(perf_client ${LIBS}) -TARGET_LINK_LIBRARIES(perf_server ${LIBS}) INCLUDE(CheckFunctionExists) @@ -95,18 +176,13 @@ CHECK_SYMBOL_EXISTS( HAVE_PREADV ) -INCLUDE(CheckIncludeFiles) - -IF (MSVC AND PCRE_LIB) -FIND_PATH(EVENT_INCLUDE_DIR NAMES pcreposix.h) -IF (EVENT_INCLUDE_DIR) - MESSAGE(STATUS "found pcreposix.h") - SET(HAVE_REGEX 1) -ELSE() - MESSAGE(FATAL_ERROR "event2/event.h was not found") -ENDIF() -ELSE() -CHECK_INCLUDE_FILES(regex.h HAVE_REGEX) +IF (MSVC) + FIND_PATH(EVENT_INCLUDE_DIR NAMES event2/event.h) + IF (EVENT_INCLUDE_DIR) + MESSAGE(STATUS "found event2/event.h") + ELSE() + MESSAGE(FATAL_ERROR "event2/event.h was not found") + ENDIF() ENDIF() CONFIGURE_FILE(${CMAKE_CURRENT_SOURCE_DIR}/test_config.h.in ${CMAKE_CURRENT_SOURCE_DIR}/test_config.h) diff --git a/bin/http_server.c b/bin/http_server.c index 3c2cc0776..e2a94400c 100644 --- a/bin/http_server.c +++ b/bin/http_server.c @@ -36,11 +36,18 @@ #include "test_cert.h" #include "prog.h" -#if HAVE_REGEX + #ifndef WIN32 +#if HAVE_REGEX #include +#endif #else +#if HAVE_PCRE2 +#include +#elif HAVE_PCRE #include +#else +#error Missing posix regular expression header. #endif #endif diff --git a/bin/test_common.c b/bin/test_common.c index 174fde748..bd2034181 100644 --- a/bin/test_common.c +++ b/bin/test_common.c @@ -31,11 +31,17 @@ #include "test_config.h" -#if HAVE_REGEX #ifndef WIN32 +#if HAVE_REGEX #include +#endif #else +#if HAVE_PCRE2 +#include +#elif HAVE_PCRE #include +#else +#error Missing posix regular expression header. #endif #endif diff --git a/bin/test_config.h.in b/bin/test_config.h.in index f7ea4a38c..0e61f879f 100644 --- a/bin/test_config.h.in +++ b/bin/test_config.h.in @@ -7,6 +7,8 @@ #cmakedefine HAVE_IP_DONTFRAG 1 #cmakedefine HAVE_IP_MTU_DISCOVER 1 #cmakedefine HAVE_REGEX 1 +#cmakedefine HAVE_PCRE 1 +#cmakedefine HAVE_PCRE2 1 #cmakedefine HAVE_PREADV 1 #define LSQUIC_DONTFRAG_SUPPORTED (HAVE_IP_DONTFRAG || HAVE_IP_MTU_DISCOVER) diff --git a/tests/CMakeLists.txt b/tests/CMakeLists.txt index 005fcf314..4758b06d1 100644 --- a/tests/CMakeLists.txt +++ b/tests/CMakeLists.txt @@ -93,23 +93,35 @@ ENDIF() FOREACH(TEST_NAME ${TESTS}) ADD_EXECUTABLE(test_${TEST_NAME} test_${TEST_NAME}.c ${ADDL_SOURCES}) + IF(NOT MSVC) - TARGET_LINK_LIBRARIES(test_${TEST_NAME} ${LIBS} ${LIB_FLAGS}) + TARGET_LINK_LIBRARIES(test_${TEST_NAME} ${LIBS} ${LIB_FLAGS}) ELSE() - TARGET_LINK_LIBRARIES(test_${TEST_NAME} ${LIBS} ${GETOPT_LIB} ${LIB_FLAGS}) - # copy any dependencies local to the tests - IF (${CMAKE_VERSION} VERSION_LESS "3.21.0") - ADD_CUSTOM_COMMAND(TARGET test_${TEST_NAME} POST_BUILD - COMMAND ${CMAKE_COMMAND} -E copy \"${VCPKG_INSTALLED_DIR_X64_WINDOWS}/bin/getopt.dll\" \"$\" - COMMAND_EXPAND_LISTS - ) - ELSE() - ADD_CUSTOM_COMMAND(TARGET test_${TEST_NAME} POST_BUILD - COMMAND if not \"\"=="$" ${CMAKE_COMMAND} -E copy $ $ - COMMAND_EXPAND_LISTS - ) + TARGET_LINK_LIBRARIES(test_${TEST_NAME} ${LIBS} ${GETOPT_LIB} ${LIB_FLAGS}) + + # copy any dependencies local to the tests + ADD_CUSTOM_COMMAND(TARGET test_${TEST_NAME} POST_BUILD + COMMAND ${CMAKE_COMMAND} -E copy \"$\" \"$\" + COMMAND_EXPAND_LISTS + ) + ADD_CUSTOM_COMMAND(TARGET test_${TEST_NAME} POST_BUILD + COMMAND ${CMAKE_COMMAND} -E copy \"${VCPKG_INSTALLED_DIR_X64_WINDOWS}/bin/getopt.dll\" \"$\" + COMMAND_EXPAND_LISTS + ) + IF(EXISTS ${BORINGSSL_DLL_crypto}) + ADD_CUSTOM_COMMAND(TARGET test_${TEST_NAME} POST_BUILD + COMMAND ${CMAKE_COMMAND} -E copy \"${BORINGSSL_DLL_crypto}\" \"$\" + COMMAND_EXPAND_LISTS + ) + ENDIF() + IF(EXISTS ${BORINGSSL_DLL_ssl}) + ADD_CUSTOM_COMMAND(TARGET test_${TEST_NAME} POST_BUILD + COMMAND ${CMAKE_COMMAND} -E copy \"${BORINGSSL_DLL_ssl}\" \"$\" + COMMAND_EXPAND_LISTS + ) ENDIF() ENDIF() + ADD_TEST(${TEST_NAME} test_${TEST_NAME}) ADD_DEPENDENCIES(build-tests test_${TEST_NAME}) ENDFOREACH() From 59d31d096fd424da1956c4146a9b7b1dfa4a73da Mon Sep 17 00:00:00 2001 From: Tyler Young Date: Mon, 10 Jan 2022 12:31:52 -0500 Subject: [PATCH 06/30] update vcpkg --- appveyor-update-vcpkg.cmd | 23 +++++++++++++++++++++++ appveyor-windows-shared.yml | 5 ++++- appveyor-windows.yml | 5 ++++- bin/CMakeLists.txt | 4 ++-- 4 files changed, 33 insertions(+), 4 deletions(-) create mode 100644 appveyor-update-vcpkg.cmd diff --git a/appveyor-update-vcpkg.cmd b/appveyor-update-vcpkg.cmd new file mode 100644 index 000000000..c35cb9dbd --- /dev/null +++ b/appveyor-update-vcpkg.cmd @@ -0,0 +1,23 @@ +setlocal EnableDelayedExpansion + +pushd c:\tools\vcpkg + +git remote update + +git status -uno | findstr /c:"Your branch is up to date with 'origin/master'" + +if errorlevel 1 ( + + echo Updating vcpkg... + + git pull + + git reset --hard HEAD + + git clean -fdx --exclude=c:\tools\vcpkg\installed + + bootstrap-vcpkg.bat + +) + +popd diff --git a/appveyor-windows-shared.yml b/appveyor-windows-shared.yml index bcd2a7589..10b33df83 100644 --- a/appveyor-windows-shared.yml +++ b/appveyor-windows-shared.yml @@ -3,11 +3,12 @@ version: 1.{branch}.{build} image: Visual Studio 2017 cache: -- c:\tools\vcpkg\installed -> appveyor-windows-shared.yml +- c:\tools\vcpkg -> appveyor-windows-shared.yml,appveyor-update-vcpkg.cmd,c:\tools\vcpkg\.git\refs\heads\master - boringssl -> appveyor-windows-shared.cmd,boringssl-target.txt # we define the commit in here environment: APPVEYOR_SAVE_CACHE_ON_ERROR: true + VCPKG_DISABLE_METRICS: 1 init: @@ -17,6 +18,8 @@ install: - cmd: >- + call appveyor-update-vcpkg.cmd + vcpkg install zlib:x64-windows vcpkg install libevent:x64-windows diff --git a/appveyor-windows.yml b/appveyor-windows.yml index f32a1ba70..66c858e64 100644 --- a/appveyor-windows.yml +++ b/appveyor-windows.yml @@ -3,11 +3,12 @@ version: 1.{branch}.{build} image: Visual Studio 2017 cache: -- c:\tools\vcpkg\installed -> appveyor-windows.yml +- c:\tools\vcpkg -> appveyor-windows.yml,appveyor-update-vcpkg.cmd,c:\tools\vcpkg\.git\refs\heads\master - boringssl -> appveyor-windows.cmd,boringssl-target.txt # we define the commit in here environment: APPVEYOR_SAVE_CACHE_ON_ERROR: true + VCPKG_DISABLE_METRICS: true init: @@ -17,6 +18,8 @@ install: - cmd: >- + call appveyor-update-vcpkg.cmd + vcpkg install zlib:x64-windows-static vcpkg install libevent:x64-windows-static diff --git a/bin/CMakeLists.txt b/bin/CMakeLists.txt index b3fe8f3b4..bda6a2290 100644 --- a/bin/CMakeLists.txt +++ b/bin/CMakeLists.txt @@ -120,8 +120,8 @@ ENDFOREACH() IF(MSVC) FOREACH(bin_target IN LISTS bin_targets) # copy any dependencies local to the targets - DD_CUSTOM_COMMAND(TARGET ${bin_target} POST_BUILD - COMMAND ${CMAKE_COMMAND} -E copy \"$\" \"$\" + ADD_CUSTOM_COMMAND(TARGET ${bin_target} POST_BUILD + COMMAND ${CMAKE_COMMAND} -E copy \"$\" \"$\" COMMAND_EXPAND_LISTS ) ADD_CUSTOM_COMMAND(TARGET ${bin_target} POST_BUILD From fdb4f2370f17e37eaa04f53d06a994996e57db8a Mon Sep 17 00:00:00 2001 From: Tyler Young Date: Mon, 10 Jan 2022 13:35:22 -0500 Subject: [PATCH 07/30] exclude installed and packages directory from git clean on vcpkg update --- appveyor-update-vcpkg.cmd | 2 +- appveyor-windows.yml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/appveyor-update-vcpkg.cmd b/appveyor-update-vcpkg.cmd index c35cb9dbd..a34d33aca 100644 --- a/appveyor-update-vcpkg.cmd +++ b/appveyor-update-vcpkg.cmd @@ -14,7 +14,7 @@ if errorlevel 1 ( git reset --hard HEAD - git clean -fdx --exclude=c:\tools\vcpkg\installed + git clean -fdx -e installed -e packages bootstrap-vcpkg.bat diff --git a/appveyor-windows.yml b/appveyor-windows.yml index 66c858e64..bd2c6531c 100644 --- a/appveyor-windows.yml +++ b/appveyor-windows.yml @@ -8,7 +8,7 @@ cache: environment: APPVEYOR_SAVE_CACHE_ON_ERROR: true - VCPKG_DISABLE_METRICS: true + VCPKG_DISABLE_METRICS: 1 init: From 3ce669619f434ddb507349670219f6b4f99fd1bf Mon Sep 17 00:00:00 2001 From: Tyler Young Date: Mon, 10 Jan 2022 13:51:01 -0500 Subject: [PATCH 08/30] handle static PCRE2 linkage with defining PCRE2_STATIC for bin targets --- bin/CMakeLists.txt | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/bin/CMakeLists.txt b/bin/CMakeLists.txt index bda6a2290..d969a0d97 100644 --- a/bin/CMakeLists.txt +++ b/bin/CMakeLists.txt @@ -24,6 +24,10 @@ IF(NOT HAVE_REGEX) FIND_LIBRARY(PCRE_LIB NAMES pcre2-32 pcre2-32-static) IF(PCRE_LIB) MESSAGE(STATUS "Found pcre2-32: ${PCRE_LIB}") + IF(PCRE_LIB MATCHES "-static") + MESSAGE(STATUS "pcre2 is static") + ADD_DEFINITIONS(-DPCRE2_STATIC) + ENDIF() LIST(APPEND LIBS ${PCRE_LIB}) ELSE() MESSAGE(STATUS "pcre2-32 not found: http_server won't work") From c67a3d56573a1b769c56134885408aba4449f236 Mon Sep 17 00:00:00 2001 From: Tyler Young Date: Mon, 10 Jan 2022 13:59:52 -0500 Subject: [PATCH 09/30] print windows system application event log after running tests even (especially) if they fail --- appveyor-windows-test.cmd | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/appveyor-windows-test.cmd b/appveyor-windows-test.cmd index 2032ba0ee..e915dbe57 100644 --- a/appveyor-windows-test.cmd +++ b/appveyor-windows-test.cmd @@ -1,10 +1,12 @@ for /f "usebackq delims=#" %%a in (`"%programfiles(x86)%\Microsoft Visual Studio\Installer\vswhere" -latest -property installationPath`) do call "%%~a\VC\Auxiliary\Build\vcvars64.bat" msbuild /m RUN_TESTS.vcxproj -if errorlevel 1 exit !errorlevel! +set testserror=%errorlevel% wevtutil qe Application /q:"*[System[TimeCreated[timediff(@SystemTime) <= 1209600000]]]" /f:text /c:1 +if %testserror% neq 0 exit %testserror% + msbuild /m bin\perf_server.vcxproj if errorlevel 1 exit !errorlevel! msbuild /m bin\perf_client.vcxproj From 5b19e2002e3a5101c1ac2c8503169c3b22e49b9b Mon Sep 17 00:00:00 2001 From: Tyler Young Date: Mon, 10 Jan 2022 14:16:18 -0500 Subject: [PATCH 10/30] fix pcre2 posix linkage --- bin/CMakeLists.txt | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/bin/CMakeLists.txt b/bin/CMakeLists.txt index d969a0d97..08b2c02b7 100644 --- a/bin/CMakeLists.txt +++ b/bin/CMakeLists.txt @@ -21,16 +21,16 @@ IF(NOT HAVE_REGEX) IF(HAVE_PCRE2) MESSAGE(STATUS "Found pcre2posix.h") - FIND_LIBRARY(PCRE_LIB NAMES pcre2-32 pcre2-32-static) + FIND_LIBRARY(PCRE_LIB NAMES pcre2-8 pcre2-8-static) IF(PCRE_LIB) - MESSAGE(STATUS "Found pcre2-32: ${PCRE_LIB}") + MESSAGE(STATUS "Found pcre2-8: ${PCRE_LIB}") IF(PCRE_LIB MATCHES "-static") MESSAGE(STATUS "pcre2 is static") ADD_DEFINITIONS(-DPCRE2_STATIC) ENDIF() LIST(APPEND LIBS ${PCRE_LIB}) ELSE() - MESSAGE(STATUS "pcre2-32 not found: http_server won't work") + MESSAGE(STATUS "pcre2-8 not found: http_server won't work") ENDIF() FIND_LIBRARY(PCREPOSIX_LIB NAMES pcre2-posix pcre2-posix-static) @@ -42,11 +42,11 @@ IF(NOT HAVE_REGEX) ENDIF() IF(MSVC AND NOT VCPKG_TARGET_TRIPLET MATCHES "-static$") - FIND_PATH(PCRE_DLL "pcre2-32.dll" HINTS "${VCPKG_INSTALLED_DIR_X64_WINDOWS}/bin" REQUIRED) + FIND_PATH(PCRE_DLL "pcre2-8.dll" HINTS "${VCPKG_INSTALLED_DIR_X64_WINDOWS}/bin" REQUIRED) FIND_PATH(PCREPOSIX_DLL "pcre2-posix.dll" HINTS "${VCPKG_INSTALLED_DIR_X64_WINDOWS}/bin" REQUIRED) - SET(PCRE_DLL "${PCRE_DLL}/pcre2-32.dll") + SET(PCRE_DLL "${PCRE_DLL}/pcre2-8.dll") SET(PCREPOSIX_DLL "${PCREPOSIX_DLL}/pcre2-posix.dll") - MESSAGE(STATUS "Found pcre2-32.dll: ${PCRE_DLL}") + MESSAGE(STATUS "Found pcre2-8.dll: ${PCRE_DLL}") MESSAGE(STATUS "Found pcre2-posix.dll: ${PCREPOSIX_DLL}") ENDIF() ELSE() From 406153c9cec65bdf98354c57735c81d59046b6fd Mon Sep 17 00:00:00 2001 From: Tyler Young Date: Mon, 10 Jan 2022 14:21:29 -0500 Subject: [PATCH 11/30] fix vcpkg update and clean up --- appveyor-update-vcpkg.cmd | 4 ++-- appveyor-windows-shared.yml | 4 ++++ appveyor-windows.yml | 4 ++++ 3 files changed, 10 insertions(+), 2 deletions(-) diff --git a/appveyor-update-vcpkg.cmd b/appveyor-update-vcpkg.cmd index a34d33aca..88a6a1273 100644 --- a/appveyor-update-vcpkg.cmd +++ b/appveyor-update-vcpkg.cmd @@ -14,10 +14,10 @@ if errorlevel 1 ( git reset --hard HEAD - git clean -fdx -e installed -e packages - bootstrap-vcpkg.bat ) +git clean -fdx -e installed -e packages + popd diff --git a/appveyor-windows-shared.yml b/appveyor-windows-shared.yml index 10b33df83..7f23aaa63 100644 --- a/appveyor-windows-shared.yml +++ b/appveyor-windows-shared.yml @@ -30,6 +30,10 @@ install: vcpkg integrate install + rd /s /q c:\tools\vcpkg\buildtrees + + rd /s /q c:\tools\vcpkg\downloads + build_script: - cmd: appveyor-windows-shared.cmd diff --git a/appveyor-windows.yml b/appveyor-windows.yml index bd2c6531c..bd5dfcea9 100644 --- a/appveyor-windows.yml +++ b/appveyor-windows.yml @@ -30,6 +30,10 @@ install: vcpkg integrate install + rd /s /q c:\tools\vcpkg\buildtrees + + rd /s /q c:\tools\vcpkg\downloads + build_script: - cmd: appveyor-windows.cmd From 54d0f727a2b7247cd098ce4ee012c57b7bcc56ed Mon Sep 17 00:00:00 2001 From: Tyler Young Date: Mon, 10 Jan 2022 14:29:44 -0500 Subject: [PATCH 12/30] quiet down vcpkg git operations make wevtutil louder --- appveyor-update-vcpkg.cmd | 6 +++--- appveyor-windows-test.cmd | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/appveyor-update-vcpkg.cmd b/appveyor-update-vcpkg.cmd index 88a6a1273..779b18b67 100644 --- a/appveyor-update-vcpkg.cmd +++ b/appveyor-update-vcpkg.cmd @@ -10,14 +10,14 @@ if errorlevel 1 ( echo Updating vcpkg... - git pull + git pull -q - git reset --hard HEAD + git reset -q --hard HEAD bootstrap-vcpkg.bat ) -git clean -fdx -e installed -e packages +git clean -qfdx -e installed -e packages popd diff --git a/appveyor-windows-test.cmd b/appveyor-windows-test.cmd index e915dbe57..41bf5e875 100644 --- a/appveyor-windows-test.cmd +++ b/appveyor-windows-test.cmd @@ -3,7 +3,7 @@ for /f "usebackq delims=#" %%a in (`"%programfiles(x86)%\Microsoft Visual Studio msbuild /m RUN_TESTS.vcxproj set testserror=%errorlevel% -wevtutil qe Application /q:"*[System[TimeCreated[timediff(@SystemTime) <= 1209600000]]]" /f:text /c:1 +wevtutil qe Application /q:"*[System[TimeCreated[timediff(@SystemTime) <= 1209600000]]]" /f:text if %testserror% neq 0 exit %testserror% From 0fc1c8cddf30e36facc3feaab47c4fc008a2813c Mon Sep 17 00:00:00 2001 From: Tyler Young Date: Mon, 10 Jan 2022 14:36:44 -0500 Subject: [PATCH 13/30] reduce msbuild verbosity --- appveyor-windows-shared.cmd | 10 +++++----- appveyor-windows-test.cmd | 6 +++--- appveyor-windows.cmd | 10 +++++----- 3 files changed, 13 insertions(+), 13 deletions(-) diff --git a/appveyor-windows-shared.cmd b/appveyor-windows-shared.cmd index cb315a9d4..f4eb668a1 100644 --- a/appveyor-windows-shared.cmd +++ b/appveyor-windows-shared.cmd @@ -19,11 +19,11 @@ if exist ".\boringssl\include\openssl\ssl.h" ( git checkout %BORINGSSL_TARGET% rd /s /q .git cmake -DCMAKE_GENERATOR_PLATFORM=x64 --config Debug -DBUILD_SHARED_LIBS=ON -DOPENSSL_NO_ASM=1 . - msbuild /m crypto\crypto.vcxproj + msbuild /m crypto\crypto.vcxproj /v:m if errorlevel 1 exit !errorlevel! - msbuild /m ssl\ssl.vcxproj + msbuild /m ssl\ssl.vcxproj /v:m if errorlevel 1 exit !errorlevel! - msbuild /m decrepit\decrepit.vcxproj + msbuild /m decrepit\decrepit.vcxproj /v:m if errorlevel 1 exit !errorlevel! cd .. ) @@ -39,8 +39,8 @@ if errorlevel 1 goto :retry_submodule_update cmake -DCMAKE_GENERATOR_PLATFORM=x64 -DLSQUIC_SHARED_LIB=ON -DBUILD_SHARED_LIBS=ON -DVCPKG_TARGET_TRIPLET=x64-windows -DCMAKE_BUILD_TYPE=Debug -DCMAKE_TOOLCHAIN_FILE=c:/tools/vcpkg/scripts/buildsystems/vcpkg.cmake -DBORINGSSL_DIR=%cd%\boringssl -DCMAKE_WINDOWS_EXPORT_ALL_SYMBOLS=ON . -msbuild /m src\liblsquic\lsquic.vcxproj +msbuild /m src\liblsquic\lsquic.vcxproj /v:n if errorlevel 1 exit !errorlevel! -msbuild /m tests\build-tests.vcxproj +msbuild /m tests\build-tests.vcxproj /v:n if errorlevel 1 exit !errorlevel! diff --git a/appveyor-windows-test.cmd b/appveyor-windows-test.cmd index 41bf5e875..e1fc43497 100644 --- a/appveyor-windows-test.cmd +++ b/appveyor-windows-test.cmd @@ -1,15 +1,15 @@ for /f "usebackq delims=#" %%a in (`"%programfiles(x86)%\Microsoft Visual Studio\Installer\vswhere" -latest -property installationPath`) do call "%%~a\VC\Auxiliary\Build\vcvars64.bat" -msbuild /m RUN_TESTS.vcxproj +msbuild /m RUN_TESTS.vcxproj /v:n set testserror=%errorlevel% wevtutil qe Application /q:"*[System[TimeCreated[timediff(@SystemTime) <= 1209600000]]]" /f:text if %testserror% neq 0 exit %testserror% -msbuild /m bin\perf_server.vcxproj +msbuild /m bin\perf_server.vcxproj /v:n if errorlevel 1 exit !errorlevel! -msbuild /m bin\perf_client.vcxproj +msbuild /m bin\perf_client.vcxproj /v:n if errorlevel 1 exit !errorlevel! start "" /B bin\Debug\perf_server -L notice -s ::1:8443 -c localhost,tests/localhost.pem,tests/localhost.key diff --git a/appveyor-windows.cmd b/appveyor-windows.cmd index 63c0531bb..1722daa69 100644 --- a/appveyor-windows.cmd +++ b/appveyor-windows.cmd @@ -19,11 +19,11 @@ if exist ".\boringssl\include\openssl\ssl.h" ( git checkout %BORINGSSL_TARGET% rd /s /q .git cmake -DCMAKE_GENERATOR_PLATFORM=x64 --config Debug -DBUILD_SHARED_LIBS=OFF -DOPENSSL_NO_ASM=1 . - msbuild /m crypto\crypto.vcxproj + msbuild /m crypto\crypto.vcxproj /v:m if errorlevel 1 exit !errorlevel! - msbuild /m ssl\ssl.vcxproj + msbuild /m ssl\ssl.vcxproj /v:m if errorlevel 1 exit !errorlevel! - msbuild /m decrepit\decrepit.vcxproj + msbuild /m decrepit\decrepit.vcxproj /v:m if errorlevel 1 exit !errorlevel! cd .. ) @@ -39,7 +39,7 @@ if errorlevel 1 goto :retry_submodule_update cmake -DCMAKE_GENERATOR_PLATFORM=x64 -DBUILD_SHARED_LIBS=OFF -DVCPKG_TARGET_TRIPLET=x64-windows-static -DCMAKE_BUILD_TYPE=Debug -DCMAKE_TOOLCHAIN_FILE=c:/tools/vcpkg/scripts/buildsystems/vcpkg.cmake -DBORINGSSL_DIR=%cd%\boringssl . -msbuild /m src\liblsquic\lsquic.vcxproj +msbuild /m src\liblsquic\lsquic.vcxproj /v:n if errorlevel 1 exit !errorlevel! -msbuild /m tests\build-tests.vcxproj +msbuild /m tests\build-tests.vcxproj /v:n if errorlevel 1 exit !errorlevel! From fa97db2a369cbe46890fa97ec34dbb1a3e7cae6d Mon Sep 17 00:00:00 2001 From: Tyler Young Date: Tue, 11 Jan 2022 09:44:37 -0500 Subject: [PATCH 14/30] try using ldd to figure out which incorrect is being used --- appveyor-update-vcpkg.cmd | 6 +++--- appveyor-windows-test.cmd | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/appveyor-update-vcpkg.cmd b/appveyor-update-vcpkg.cmd index 779b18b67..33b79a9ca 100644 --- a/appveyor-update-vcpkg.cmd +++ b/appveyor-update-vcpkg.cmd @@ -12,12 +12,12 @@ if errorlevel 1 ( git pull -q - git reset -q --hard HEAD - bootstrap-vcpkg.bat ) -git clean -qfdx -e installed -e packages +git reset -q --hard HEAD + +git clean -fdx -e installed -e packages popd diff --git a/appveyor-windows-test.cmd b/appveyor-windows-test.cmd index e1fc43497..4870fd76c 100644 --- a/appveyor-windows-test.cmd +++ b/appveyor-windows-test.cmd @@ -3,7 +3,7 @@ for /f "usebackq delims=#" %%a in (`"%programfiles(x86)%\Microsoft Visual Studio msbuild /m RUN_TESTS.vcxproj /v:n set testserror=%errorlevel% -wevtutil qe Application /q:"*[System[TimeCreated[timediff(@SystemTime) <= 1209600000]]]" /f:text +"C:\msys64\usr\bin\ldd.exe" "tests\Debug\test_cubic.exe" if %testserror% neq 0 exit %testserror% From d8142b210fd03f32b13bf76d9fb59cdb2f4a2df1 Mon Sep 17 00:00:00 2001 From: Tyler Young Date: Tue, 11 Jan 2022 10:03:25 -0500 Subject: [PATCH 15/30] try building w/ the vs 2022 image --- appveyor-windows-shared.yml | 2 +- appveyor-windows.yml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/appveyor-windows-shared.yml b/appveyor-windows-shared.yml index 7f23aaa63..72cf8702a 100644 --- a/appveyor-windows-shared.yml +++ b/appveyor-windows-shared.yml @@ -1,6 +1,6 @@ version: 1.{branch}.{build} -image: Visual Studio 2017 +image: Visual Studio 2022 cache: - c:\tools\vcpkg -> appveyor-windows-shared.yml,appveyor-update-vcpkg.cmd,c:\tools\vcpkg\.git\refs\heads\master diff --git a/appveyor-windows.yml b/appveyor-windows.yml index bd5dfcea9..f2d1e0682 100644 --- a/appveyor-windows.yml +++ b/appveyor-windows.yml @@ -1,6 +1,6 @@ version: 1.{branch}.{build} -image: Visual Studio 2017 +image: Visual Studio 2022 cache: - c:\tools\vcpkg -> appveyor-windows.yml,appveyor-update-vcpkg.cmd,c:\tools\vcpkg\.git\refs\heads\master From 2ce036c314cc071bd31b0afabc8a9b8406c4fa7a Mon Sep 17 00:00:00 2001 From: Tyler Young Date: Tue, 11 Jan 2022 10:21:55 -0500 Subject: [PATCH 16/30] fix mising zlib1.dll --- CMakeLists.txt | 5 +++++ bin/CMakeLists.txt | 6 ++++++ tests/CMakeLists.txt | 6 ++++++ 3 files changed, 17 insertions(+) diff --git a/CMakeLists.txt b/CMakeLists.txt index 679de5cfe..5a6d64430 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -299,6 +299,11 @@ ELSE() ENDIF() IF (CMAKE_SYSTEM_NAME STREQUAL Windows) FIND_LIBRARY(ZLIB_LIB zlib) + + # TODO: if zlib is not through vcpkg, need to do something else + IF (NOT VCPKG_TARGET_TRIPLET MATCHES "-static$" AND NOT EXISTS ${ZLIB_DLL}) + FILE(GLOB_RECURSE ZLIB_DLL "${VCPKG_INSTALLED_DIR_X64_WINDOWS}/bin/zlib1.dll") + ENDIF() ELSEIF(CMAKE_SYSTEM_NAME STREQUAL Darwin) # XXX somehow FIND_LIBRARY() does not find zlib on Travis? SET(ZLIB_LIB z) diff --git a/bin/CMakeLists.txt b/bin/CMakeLists.txt index 08b2c02b7..656c09f4f 100644 --- a/bin/CMakeLists.txt +++ b/bin/CMakeLists.txt @@ -132,6 +132,12 @@ IF(MSVC) COMMAND ${CMAKE_COMMAND} -E copy \"${VCPKG_INSTALLED_DIR_X64_WINDOWS}/bin/getopt.dll\" \"$\" COMMAND_EXPAND_LISTS ) + IF(EXISTS ${ZLIB_DLL}) + ADD_CUSTOM_COMMAND(TARGET ${bin_target} POST_BUILD + COMMAND ${CMAKE_COMMAND} -E copy \"${ZLIB_DLL}\" \"$\" + COMMAND_EXPAND_LISTS + ) + ENDIF() IF(EXISTS ${BORINGSSL_DLL_crypto}) ADD_CUSTOM_COMMAND(TARGET ${bin_target} POST_BUILD COMMAND ${CMAKE_COMMAND} -E copy \"${BORINGSSL_DLL_crypto}\" \"$\" diff --git a/tests/CMakeLists.txt b/tests/CMakeLists.txt index 4758b06d1..9e58435ad 100644 --- a/tests/CMakeLists.txt +++ b/tests/CMakeLists.txt @@ -120,6 +120,12 @@ FOREACH(TEST_NAME ${TESTS}) COMMAND_EXPAND_LISTS ) ENDIF() + IF(EXISTS ${ZLIB_DLL}) + ADD_CUSTOM_COMMAND(TARGET test_${TEST_NAME} POST_BUILD + COMMAND ${CMAKE_COMMAND} -E copy \"${ZLIB_DLL}\" \"$\" + COMMAND_EXPAND_LISTS + ) + ENDIF() ENDIF() ADD_TEST(${TEST_NAME} test_${TEST_NAME}) From ac510b11862e2672ad1b6372877404492df534c8 Mon Sep 17 00:00:00 2001 From: Tyler Young Date: Tue, 11 Jan 2022 10:24:50 -0500 Subject: [PATCH 17/30] fix broken appveyor vcpkg update --- appveyor-update-vcpkg.cmd | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/appveyor-update-vcpkg.cmd b/appveyor-update-vcpkg.cmd index 33b79a9ca..c26899c1c 100644 --- a/appveyor-update-vcpkg.cmd +++ b/appveyor-update-vcpkg.cmd @@ -18,6 +18,6 @@ if errorlevel 1 ( git reset -q --hard HEAD -git clean -fdx -e installed -e packages +git clean -fdx -e installed -e packages -e vcpkg.exe popd From a51bdd6c5ec12099604bff144e04e86bb04f4dff Mon Sep 17 00:00:00 2001 From: Tyler Young Date: Tue, 11 Jan 2022 10:37:48 -0500 Subject: [PATCH 18/30] for windows run perf test even if tests fail but preserve exit code of test remove diag code from linux and mac appveyor configs add 5 minute timeout for tests --- appveyor-linux.yml | 2 -- appveyor-macos.yml | 2 -- appveyor-windows-shared.cmd | 4 ++-- appveyor-windows-test.cmd | 8 ++++---- appveyor-windows.cmd | 4 ++-- appveyor-windows.yml | 4 ++-- bin/CMakeLists.txt | 12 ++++++------ tests/CMakeLists.txt | 1 + 8 files changed, 17 insertions(+), 20 deletions(-) diff --git a/appveyor-linux.yml b/appveyor-linux.yml index 3687a1c68..983e345e2 100644 --- a/appveyor-linux.yml +++ b/appveyor-linux.yml @@ -87,8 +87,6 @@ test_script: make -j2 perf_server perf_client - find . -name perf_server -o -name perf_client - ./bin/perf_server -L notice -s ::1:8443 -c localhost,tests/localhost.pem,tests/localhost.key & PERF_SERVER_PID=$! diff --git a/appveyor-macos.yml b/appveyor-macos.yml index 658d58826..cd8145b14 100644 --- a/appveyor-macos.yml +++ b/appveyor-macos.yml @@ -69,8 +69,6 @@ test_script: make -j2 perf_server perf_client - find . -name perf_server -o -name perf_client - ./bin/perf_server -L notice -s ::1:8443 -c localhost,tests/localhost.pem,tests/localhost.key & PERF_SERVER_PID=$! diff --git a/appveyor-windows-shared.cmd b/appveyor-windows-shared.cmd index f4eb668a1..4a0ba430f 100644 --- a/appveyor-windows-shared.cmd +++ b/appveyor-windows-shared.cmd @@ -18,7 +18,7 @@ if exist ".\boringssl\include\openssl\ssl.h" ( cd boringssl git checkout %BORINGSSL_TARGET% rd /s /q .git - cmake -DCMAKE_GENERATOR_PLATFORM=x64 --config Debug -DBUILD_SHARED_LIBS=ON -DOPENSSL_NO_ASM=1 . + cmake -DCMAKE_BUILD_TYPE=Debug -DCMAKE_GENERATOR_PLATFORM=x64 -DBUILD_SHARED_LIBS=ON -DOPENSSL_NO_ASM=1 . msbuild /m crypto\crypto.vcxproj /v:m if errorlevel 1 exit !errorlevel! msbuild /m ssl\ssl.vcxproj /v:m @@ -37,7 +37,7 @@ git submodule update --checkout --force --recursive if %retry_submodule_update% gtr 10 exit !errorlevel! if errorlevel 1 goto :retry_submodule_update -cmake -DCMAKE_GENERATOR_PLATFORM=x64 -DLSQUIC_SHARED_LIB=ON -DBUILD_SHARED_LIBS=ON -DVCPKG_TARGET_TRIPLET=x64-windows -DCMAKE_BUILD_TYPE=Debug -DCMAKE_TOOLCHAIN_FILE=c:/tools/vcpkg/scripts/buildsystems/vcpkg.cmake -DBORINGSSL_DIR=%cd%\boringssl -DCMAKE_WINDOWS_EXPORT_ALL_SYMBOLS=ON . +cmake -DCMAKE_BUILD_TYPE=Debug -DCMAKE_GENERATOR_PLATFORM=x64 -DLSQUIC_SHARED_LIB=ON -DBUILD_SHARED_LIBS=ON -DVCPKG_TARGET_TRIPLET=x64-windows -DCMAKE_TOOLCHAIN_FILE=c:/tools/vcpkg/scripts/buildsystems/vcpkg.cmake -DBORINGSSL_DIR=%cd%\boringssl -DCMAKE_WINDOWS_EXPORT_ALL_SYMBOLS=ON . msbuild /m src\liblsquic\lsquic.vcxproj /v:n if errorlevel 1 exit !errorlevel! diff --git a/appveyor-windows-test.cmd b/appveyor-windows-test.cmd index 4870fd76c..8fc3e9b18 100644 --- a/appveyor-windows-test.cmd +++ b/appveyor-windows-test.cmd @@ -5,12 +5,10 @@ set testserror=%errorlevel% "C:\msys64\usr\bin\ldd.exe" "tests\Debug\test_cubic.exe" -if %testserror% neq 0 exit %testserror% - msbuild /m bin\perf_server.vcxproj /v:n -if errorlevel 1 exit !errorlevel! +if errorlevel 1 goto :after_perf_test msbuild /m bin\perf_client.vcxproj /v:n -if errorlevel 1 exit !errorlevel! +if errorlevel 1 goto :after_perf_test start "" /B bin\Debug\perf_server -L notice -s ::1:8443 -c localhost,tests/localhost.pem,tests/localhost.key @@ -18,3 +16,5 @@ bin\Debug\perf_client -L info -s ::1:8443 -p 104857600:104857600 tskill perf_server +:after_perf_test +if %testserror% neq 0 exit %testserror% \ No newline at end of file diff --git a/appveyor-windows.cmd b/appveyor-windows.cmd index 1722daa69..35abecc15 100644 --- a/appveyor-windows.cmd +++ b/appveyor-windows.cmd @@ -18,7 +18,7 @@ if exist ".\boringssl\include\openssl\ssl.h" ( cd boringssl git checkout %BORINGSSL_TARGET% rd /s /q .git - cmake -DCMAKE_GENERATOR_PLATFORM=x64 --config Debug -DBUILD_SHARED_LIBS=OFF -DOPENSSL_NO_ASM=1 . + cmake -DCMAKE_BUILD_TYPE=Debug -DCMAKE_GENERATOR_PLATFORM=x64 -DBUILD_SHARED_LIBS=OFF -DOPENSSL_NO_ASM=1 . msbuild /m crypto\crypto.vcxproj /v:m if errorlevel 1 exit !errorlevel! msbuild /m ssl\ssl.vcxproj /v:m @@ -37,7 +37,7 @@ git submodule update --checkout --force --recursive if %retry_submodule_update% gtr 10 exit !errorlevel! if errorlevel 1 goto :retry_submodule_update -cmake -DCMAKE_GENERATOR_PLATFORM=x64 -DBUILD_SHARED_LIBS=OFF -DVCPKG_TARGET_TRIPLET=x64-windows-static -DCMAKE_BUILD_TYPE=Debug -DCMAKE_TOOLCHAIN_FILE=c:/tools/vcpkg/scripts/buildsystems/vcpkg.cmake -DBORINGSSL_DIR=%cd%\boringssl . +cmake -DCMAKE_BUILD_TYPE=Debug -DCMAKE_GENERATOR_PLATFORM=x64 -DBUILD_SHARED_LIBS=OFF -DVCPKG_TARGET_TRIPLET=x64-windows-static -DCMAKE_TOOLCHAIN_FILE=c:/tools/vcpkg/scripts/buildsystems/vcpkg.cmake -DBORINGSSL_DIR=%cd%\boringssl . msbuild /m src\liblsquic\lsquic.vcxproj /v:n if errorlevel 1 exit !errorlevel! diff --git a/appveyor-windows.yml b/appveyor-windows.yml index f2d1e0682..4f86ec8de 100644 --- a/appveyor-windows.yml +++ b/appveyor-windows.yml @@ -30,9 +30,9 @@ install: vcpkg integrate install - rd /s /q c:\tools\vcpkg\buildtrees + if exist c:\tools\vcpkg\buildtrees rd /s /q c:\tools\vcpkg\buildtrees - rd /s /q c:\tools\vcpkg\downloads + if exist c:\tools\vcpkg\downloads rd /s /q c:\tools\vcpkg\downloads build_script: diff --git a/bin/CMakeLists.txt b/bin/CMakeLists.txt index 656c09f4f..44a0cacad 100644 --- a/bin/CMakeLists.txt +++ b/bin/CMakeLists.txt @@ -132,12 +132,6 @@ IF(MSVC) COMMAND ${CMAKE_COMMAND} -E copy \"${VCPKG_INSTALLED_DIR_X64_WINDOWS}/bin/getopt.dll\" \"$\" COMMAND_EXPAND_LISTS ) - IF(EXISTS ${ZLIB_DLL}) - ADD_CUSTOM_COMMAND(TARGET ${bin_target} POST_BUILD - COMMAND ${CMAKE_COMMAND} -E copy \"${ZLIB_DLL}\" \"$\" - COMMAND_EXPAND_LISTS - ) - ENDIF() IF(EXISTS ${BORINGSSL_DLL_crypto}) ADD_CUSTOM_COMMAND(TARGET ${bin_target} POST_BUILD COMMAND ${CMAKE_COMMAND} -E copy \"${BORINGSSL_DLL_crypto}\" \"$\" @@ -156,6 +150,12 @@ IF(MSVC) COMMAND_EXPAND_LISTS ) ENDIF() + IF(EXISTS ${ZLIB_DLL}) + ADD_CUSTOM_COMMAND(TARGET ${bin_target} POST_BUILD + COMMAND ${CMAKE_COMMAND} -E copy \"${ZLIB_DLL}\" \"$\" + COMMAND_EXPAND_LISTS + ) + ENDIF() ENDFOREACH() ENDIF() diff --git a/tests/CMakeLists.txt b/tests/CMakeLists.txt index 9e58435ad..2cfc9d886 100644 --- a/tests/CMakeLists.txt +++ b/tests/CMakeLists.txt @@ -129,6 +129,7 @@ FOREACH(TEST_NAME ${TESTS}) ENDIF() ADD_TEST(${TEST_NAME} test_${TEST_NAME}) + SET_TESTS_PROPERTIES(${TEST_NAME} PROPERTIES TIMEOUT 300) ADD_DEPENDENCIES(build-tests test_${TEST_NAME}) ENDFOREACH() From daff4cd27a9fa1e7cb5605f95e9ed8a5c9bf6638 Mon Sep 17 00:00:00 2001 From: Tyler Young Date: Tue, 11 Jan 2022 12:10:12 -0500 Subject: [PATCH 19/30] add working test kill timeout of 10 minutes --- appveyor-windows-test.cmd | 2 ++ 1 file changed, 2 insertions(+) diff --git a/appveyor-windows-test.cmd b/appveyor-windows-test.cmd index 8fc3e9b18..4e4fc49c0 100644 --- a/appveyor-windows-test.cmd +++ b/appveyor-windows-test.cmd @@ -1,5 +1,7 @@ for /f "usebackq delims=#" %%a in (`"%programfiles(x86)%\Microsoft Visual Studio\Installer\vswhere" -latest -property installationPath`) do call "%%~a\VC\Auxiliary\Build\vcvars64.bat" +start "" /b cmd /c "(timeout /t 600 /nobreak && taskkill /t /f /fi "imagename eq test_*")>nul" + msbuild /m RUN_TESTS.vcxproj /v:n set testserror=%errorlevel% From f89b338ef011e4ee119644b0806e1a1fd46d6924 Mon Sep 17 00:00:00 2001 From: Tyler Young Date: Tue, 11 Jan 2022 12:47:49 -0500 Subject: [PATCH 20/30] make killing tests loop for all subsequent tests after timeout reached --- appveyor-windows-kill-tests.cmd | 4 ++++ appveyor-windows-test.cmd | 12 ++++++++++-- 2 files changed, 14 insertions(+), 2 deletions(-) create mode 100644 appveyor-windows-kill-tests.cmd diff --git a/appveyor-windows-kill-tests.cmd b/appveyor-windows-kill-tests.cmd new file mode 100644 index 000000000..d12fb5e5c --- /dev/null +++ b/appveyor-windows-kill-tests.cmd @@ -0,0 +1,4 @@ +:loop +if not exist killing-tests.tmp goto :eof +taskkill /t /f /fi "imagename eq test_*" +goto :loop \ No newline at end of file diff --git a/appveyor-windows-test.cmd b/appveyor-windows-test.cmd index 4e4fc49c0..4f426d7f3 100644 --- a/appveyor-windows-test.cmd +++ b/appveyor-windows-test.cmd @@ -1,10 +1,18 @@ for /f "usebackq delims=#" %%a in (`"%programfiles(x86)%\Microsoft Visual Studio\Installer\vswhere" -latest -property installationPath`) do call "%%~a\VC\Auxiliary\Build\vcvars64.bat" -start "" /b cmd /c "(timeout /t 600 /nobreak && taskkill /t /f /fi "imagename eq test_*")>nul" +echo 1>killing-tests.tmp + +:: cmake test timeout doesn't seem to work right on windows? +:: force loop kill all the tests after 10 minutes (600 seconds) +start "" /b cmd /c "(timeout /t 600 /nobreak && call appveyor-windows-kill-tests.cmd)>nul" msbuild /m RUN_TESTS.vcxproj /v:n + +del /q killing-tests.tmp + set testserror=%errorlevel% + "C:\msys64\usr\bin\ldd.exe" "tests\Debug\test_cubic.exe" msbuild /m bin\perf_server.vcxproj /v:n @@ -19,4 +27,4 @@ bin\Debug\perf_client -L info -s ::1:8443 -p 104857600:104857600 tskill perf_server :after_perf_test -if %testserror% neq 0 exit %testserror% \ No newline at end of file +if %testserror% neq 0 exit %testserror% From 693fb3c4bc7bf054e82ec72c655b4a3d7435ad72 Mon Sep 17 00:00:00 2001 From: Tyler Young Date: Tue, 11 Jan 2022 12:52:02 -0500 Subject: [PATCH 21/30] caching of boringssl build artifacts --- appveyor-linux.yml | 16 ++++++---------- appveyor-macos.yml | 16 ++++++---------- 2 files changed, 12 insertions(+), 20 deletions(-) diff --git a/appveyor-linux.yml b/appveyor-linux.yml index 983e345e2..f97485d45 100644 --- a/appveyor-linux.yml +++ b/appveyor-linux.yml @@ -5,7 +5,7 @@ image: cache: - $HOME/.apt -- boringssl -> boringssl-target.txt # we define the commit in here +- boringssl -> appveyor-linux.yml,boringssl-target.txt # we define the commit in here environment: APPVEYOR_SAVE_CACHE_ON_ERROR: true @@ -39,23 +39,19 @@ install: git clone https://boringssl.googlesource.com/boringssl - fi - - cd boringssl - - if [[ -d .git ]] ; then + cd boringssl git reset --hard $(<../boringssl-target.txt) rm -rf .git - fi + cmake . - cmake . + make -j2 crypto ssl decrepit - make -j2 crypto ssl decrepit + cd .. - cd .. + fi git submodule init diff --git a/appveyor-macos.yml b/appveyor-macos.yml index cd8145b14..2edeea61c 100644 --- a/appveyor-macos.yml +++ b/appveyor-macos.yml @@ -4,7 +4,7 @@ image: - MacOS cache: -- boringssl -> boringssl-target.txt # we define the commit in here +- boringssl -> appveyor-macos.yml,boringssl-target.txt # we define the commit in here environment: APPVEYOR_SAVE_CACHE_ON_ERROR: true @@ -25,23 +25,19 @@ install: git clone https://boringssl.googlesource.com/boringssl - fi - - cd boringssl - - if [[ -d .git ]] ; then + cd boringssl git reset --hard $(<../boringssl-target.txt) rm -rf .git - fi + cmake . - cmake . + make -j2 crypto ssl decrepit - make -j2 crypto ssl decrepit + cd .. - cd .. + fi git submodule init From 4cd6f76743930c2ff9e335629f9009678c8fbeb3 Mon Sep 17 00:00:00 2001 From: Tyler Young Date: Tue, 11 Jan 2022 12:59:03 -0500 Subject: [PATCH 22/30] add a little breather in the test kill loop --- appveyor-windows-kill-tests.cmd | 1 + 1 file changed, 1 insertion(+) diff --git a/appveyor-windows-kill-tests.cmd b/appveyor-windows-kill-tests.cmd index d12fb5e5c..5d7dd34c6 100644 --- a/appveyor-windows-kill-tests.cmd +++ b/appveyor-windows-kill-tests.cmd @@ -1,4 +1,5 @@ :loop if not exist killing-tests.tmp goto :eof taskkill /t /f /fi "imagename eq test_*" +timeout /t 5 /nobreak goto :loop \ No newline at end of file From 17fed89368ba0c4f336b643828f380e6d8db2cdf Mon Sep 17 00:00:00 2001 From: Tyler Young Date: Tue, 11 Jan 2022 13:19:40 -0500 Subject: [PATCH 23/30] make test killer not hang ci for remaining duration if tests succeed --- appveyor-windows-kill-tests.cmd | 13 ++++++++++++- appveyor-windows-test.cmd | 2 +- 2 files changed, 13 insertions(+), 2 deletions(-) diff --git a/appveyor-windows-kill-tests.cmd b/appveyor-windows-kill-tests.cmd index 5d7dd34c6..aaf9ec0c4 100644 --- a/appveyor-windows-kill-tests.cmd +++ b/appveyor-windows-kill-tests.cmd @@ -1,5 +1,16 @@ +@echo off && setlocal +set timeout=0 +set /a timeout+=%~1 +set elapsed=0 + +:wait +if not exist killing-tests.tmp goto :eof +timeout /t 1 /nobreak >nul +set /a elapsed+=1 +if %elapsed% lss %timeout% goto :wait + :loop if not exist killing-tests.tmp goto :eof taskkill /t /f /fi "imagename eq test_*" -timeout /t 5 /nobreak +timeout /t 5 /nobreak >nul goto :loop \ No newline at end of file diff --git a/appveyor-windows-test.cmd b/appveyor-windows-test.cmd index 4f426d7f3..ae2d2d6c2 100644 --- a/appveyor-windows-test.cmd +++ b/appveyor-windows-test.cmd @@ -4,7 +4,7 @@ echo 1>killing-tests.tmp :: cmake test timeout doesn't seem to work right on windows? :: force loop kill all the tests after 10 minutes (600 seconds) -start "" /b cmd /c "(timeout /t 600 /nobreak && call appveyor-windows-kill-tests.cmd)>nul" +start "" /b cmd /c "call appveyor-windows-kill-tests.cmd 600>nul" msbuild /m RUN_TESTS.vcxproj /v:n From eeebfb91546328ef96c7a37bd1c08cb17769de2d Mon Sep 17 00:00:00 2001 From: Tyler Young Date: Tue, 11 Jan 2022 13:48:54 -0500 Subject: [PATCH 24/30] why doesn't appveyor cache work correctly for linux and mac? --- appveyor-linux.yml | 12 ++++++++---- appveyor-macos.yml | 12 ++++++++---- 2 files changed, 16 insertions(+), 8 deletions(-) diff --git a/appveyor-linux.yml b/appveyor-linux.yml index f97485d45..afd41fbd8 100644 --- a/appveyor-linux.yml +++ b/appveyor-linux.yml @@ -45,14 +45,18 @@ install: rm -rf .git - cmake . - - make -j2 crypto ssl decrepit - cd .. fi + cd boringssl + + cmake . + + make -j2 crypto ssl decrepit + + cd .. + git submodule init n=0 diff --git a/appveyor-macos.yml b/appveyor-macos.yml index 2edeea61c..5c27e4431 100644 --- a/appveyor-macos.yml +++ b/appveyor-macos.yml @@ -31,14 +31,18 @@ install: rm -rf .git - cmake . - - make -j2 crypto ssl decrepit - cd .. fi + cd boringssl + + cmake . + + make -j2 crypto ssl decrepit + + cd .. + git submodule init n=0 From ead80f9f0d34a4409c3dc4945dfe5437c68c6b07 Mon Sep 17 00:00:00 2001 From: Tyler Young Date: Wed, 12 Jan 2022 08:33:34 -0500 Subject: [PATCH 25/30] reduce verbosity of windows builds and tests --- appveyor-windows-shared.cmd | 4 ++-- appveyor-windows-test.cmd | 11 ++++++----- appveyor-windows.cmd | 4 ++-- 3 files changed, 10 insertions(+), 9 deletions(-) diff --git a/appveyor-windows-shared.cmd b/appveyor-windows-shared.cmd index 4a0ba430f..4d9e3dcc1 100644 --- a/appveyor-windows-shared.cmd +++ b/appveyor-windows-shared.cmd @@ -39,8 +39,8 @@ if errorlevel 1 goto :retry_submodule_update cmake -DCMAKE_BUILD_TYPE=Debug -DCMAKE_GENERATOR_PLATFORM=x64 -DLSQUIC_SHARED_LIB=ON -DBUILD_SHARED_LIBS=ON -DVCPKG_TARGET_TRIPLET=x64-windows -DCMAKE_TOOLCHAIN_FILE=c:/tools/vcpkg/scripts/buildsystems/vcpkg.cmake -DBORINGSSL_DIR=%cd%\boringssl -DCMAKE_WINDOWS_EXPORT_ALL_SYMBOLS=ON . -msbuild /m src\liblsquic\lsquic.vcxproj /v:n +msbuild /m src\liblsquic\lsquic.vcxproj /v:q if errorlevel 1 exit !errorlevel! -msbuild /m tests\build-tests.vcxproj /v:n +msbuild /m tests\build-tests.vcxproj /v:q if errorlevel 1 exit !errorlevel! diff --git a/appveyor-windows-test.cmd b/appveyor-windows-test.cmd index ae2d2d6c2..ae206b799 100644 --- a/appveyor-windows-test.cmd +++ b/appveyor-windows-test.cmd @@ -6,21 +6,22 @@ echo 1>killing-tests.tmp :: force loop kill all the tests after 10 minutes (600 seconds) start "" /b cmd /c "call appveyor-windows-kill-tests.cmd 600>nul" -msbuild /m RUN_TESTS.vcxproj /v:n +msbuild /m RUN_TESTS.vcxproj /v:q del /q killing-tests.tmp set testserror=%errorlevel% - "C:\msys64\usr\bin\ldd.exe" "tests\Debug\test_cubic.exe" -msbuild /m bin\perf_server.vcxproj /v:n +set errorlevel=0 + +msbuild /m bin\perf_server.vcxproj /v:q if errorlevel 1 goto :after_perf_test -msbuild /m bin\perf_client.vcxproj /v:n +msbuild /m bin\perf_client.vcxproj /v:q if errorlevel 1 goto :after_perf_test -start "" /B bin\Debug\perf_server -L notice -s ::1:8443 -c localhost,tests/localhost.pem,tests/localhost.key +start "" /b cmd /c "bin\Debug\perf_server -L notice -s ::1:8443 -c localhost,tests/localhost.pem,tests/localhost.key" bin\Debug\perf_client -L info -s ::1:8443 -p 104857600:104857600 diff --git a/appveyor-windows.cmd b/appveyor-windows.cmd index 35abecc15..eee66bbec 100644 --- a/appveyor-windows.cmd +++ b/appveyor-windows.cmd @@ -39,7 +39,7 @@ if errorlevel 1 goto :retry_submodule_update cmake -DCMAKE_BUILD_TYPE=Debug -DCMAKE_GENERATOR_PLATFORM=x64 -DBUILD_SHARED_LIBS=OFF -DVCPKG_TARGET_TRIPLET=x64-windows-static -DCMAKE_TOOLCHAIN_FILE=c:/tools/vcpkg/scripts/buildsystems/vcpkg.cmake -DBORINGSSL_DIR=%cd%\boringssl . -msbuild /m src\liblsquic\lsquic.vcxproj /v:n +msbuild /m src\liblsquic\lsquic.vcxproj /v:q if errorlevel 1 exit !errorlevel! -msbuild /m tests\build-tests.vcxproj /v:n +msbuild /m tests\build-tests.vcxproj /v:q if errorlevel 1 exit !errorlevel! From c52d36014bcd4ccdab8c1f85480ce969d8e31fcc Mon Sep 17 00:00:00 2001 From: Tyler Young Date: Wed, 12 Jan 2022 08:46:59 -0500 Subject: [PATCH 26/30] ci no-change test run for caching From 43895534d46b9be1438d895892881c43060548bf Mon Sep 17 00:00:00 2001 From: Tyler Young Date: Wed, 12 Jan 2022 08:49:41 -0500 Subject: [PATCH 27/30] disable cache on error --- appveyor-linux.yml | 3 --- appveyor-macos.yml | 3 --- appveyor-windows-shared.yml | 1 - appveyor-windows.yml | 1 - 4 files changed, 8 deletions(-) diff --git a/appveyor-linux.yml b/appveyor-linux.yml index afd41fbd8..8d05a546a 100644 --- a/appveyor-linux.yml +++ b/appveyor-linux.yml @@ -7,9 +7,6 @@ cache: - $HOME/.apt - boringssl -> appveyor-linux.yml,boringssl-target.txt # we define the commit in here -environment: - APPVEYOR_SAVE_CACHE_ON_ERROR: true - build: off init: diff --git a/appveyor-macos.yml b/appveyor-macos.yml index 5c27e4431..9f983bf9e 100644 --- a/appveyor-macos.yml +++ b/appveyor-macos.yml @@ -6,9 +6,6 @@ image: cache: - boringssl -> appveyor-macos.yml,boringssl-target.txt # we define the commit in here -environment: - APPVEYOR_SAVE_CACHE_ON_ERROR: true - build: off init: diff --git a/appveyor-windows-shared.yml b/appveyor-windows-shared.yml index 72cf8702a..8d9d8b56f 100644 --- a/appveyor-windows-shared.yml +++ b/appveyor-windows-shared.yml @@ -7,7 +7,6 @@ cache: - boringssl -> appveyor-windows-shared.cmd,boringssl-target.txt # we define the commit in here environment: - APPVEYOR_SAVE_CACHE_ON_ERROR: true VCPKG_DISABLE_METRICS: 1 init: diff --git a/appveyor-windows.yml b/appveyor-windows.yml index 4f86ec8de..f1ca04109 100644 --- a/appveyor-windows.yml +++ b/appveyor-windows.yml @@ -7,7 +7,6 @@ cache: - boringssl -> appveyor-windows.cmd,boringssl-target.txt # we define the commit in here environment: - APPVEYOR_SAVE_CACHE_ON_ERROR: true VCPKG_DISABLE_METRICS: 1 init: From 7f5af95002f76098d3fe8e17221b99e4bdee711a Mon Sep 17 00:00:00 2001 From: Tyler Young Date: Wed, 12 Jan 2022 09:55:00 -0500 Subject: [PATCH 28/30] remove some cache reqs increase verbosity from quiet to minimal fix dir removal failures on windows-shared comment ldd usage fix text errorlevel result being lost --- appveyor-linux.yml | 2 +- appveyor-macos.yml | 2 +- appveyor-windows-shared.cmd | 5 +++-- appveyor-windows-shared.yml | 8 ++++---- appveyor-windows-test.cmd | 15 +++++++-------- appveyor-windows.cmd | 5 +++-- appveyor-windows.yml | 4 ++-- 7 files changed, 21 insertions(+), 20 deletions(-) diff --git a/appveyor-linux.yml b/appveyor-linux.yml index 8d05a546a..50c52b4e0 100644 --- a/appveyor-linux.yml +++ b/appveyor-linux.yml @@ -5,7 +5,7 @@ image: cache: - $HOME/.apt -- boringssl -> appveyor-linux.yml,boringssl-target.txt # we define the commit in here +- boringssl -> boringssl-target.txt # we define the commit in here build: off diff --git a/appveyor-macos.yml b/appveyor-macos.yml index 9f983bf9e..89aec3b0b 100644 --- a/appveyor-macos.yml +++ b/appveyor-macos.yml @@ -4,7 +4,7 @@ image: - MacOS cache: -- boringssl -> appveyor-macos.yml,boringssl-target.txt # we define the commit in here +- boringssl -> boringssl-target.txt # we define the commit in here build: off diff --git a/appveyor-windows-shared.cmd b/appveyor-windows-shared.cmd index 4d9e3dcc1..6418e4866 100644 --- a/appveyor-windows-shared.cmd +++ b/appveyor-windows-shared.cmd @@ -39,8 +39,9 @@ if errorlevel 1 goto :retry_submodule_update cmake -DCMAKE_BUILD_TYPE=Debug -DCMAKE_GENERATOR_PLATFORM=x64 -DLSQUIC_SHARED_LIB=ON -DBUILD_SHARED_LIBS=ON -DVCPKG_TARGET_TRIPLET=x64-windows -DCMAKE_TOOLCHAIN_FILE=c:/tools/vcpkg/scripts/buildsystems/vcpkg.cmake -DBORINGSSL_DIR=%cd%\boringssl -DCMAKE_WINDOWS_EXPORT_ALL_SYMBOLS=ON . -msbuild /m src\liblsquic\lsquic.vcxproj /v:q +msbuild /m src\liblsquic\lsquic.vcxproj /v:m if errorlevel 1 exit !errorlevel! -msbuild /m tests\build-tests.vcxproj /v:q + +msbuild /m tests\build-tests.vcxproj /v:m if errorlevel 1 exit !errorlevel! diff --git a/appveyor-windows-shared.yml b/appveyor-windows-shared.yml index 8d9d8b56f..1581e5022 100644 --- a/appveyor-windows-shared.yml +++ b/appveyor-windows-shared.yml @@ -3,8 +3,8 @@ version: 1.{branch}.{build} image: Visual Studio 2022 cache: -- c:\tools\vcpkg -> appveyor-windows-shared.yml,appveyor-update-vcpkg.cmd,c:\tools\vcpkg\.git\refs\heads\master -- boringssl -> appveyor-windows-shared.cmd,boringssl-target.txt # we define the commit in here +- c:\tools\vcpkg -> c:\tools\vcpkg\.git\refs\heads\master +- boringssl -> boringssl-target.txt # we define the commit in here environment: VCPKG_DISABLE_METRICS: 1 @@ -29,9 +29,9 @@ install: vcpkg integrate install - rd /s /q c:\tools\vcpkg\buildtrees + if exist c:\tools\vcpkg\buildtrees rd /s /q c:\tools\vcpkg\buildtrees - rd /s /q c:\tools\vcpkg\downloads + if exist c:\tools\vcpkg\downloads rd /s /q c:\tools\vcpkg\downloads build_script: diff --git a/appveyor-windows-test.cmd b/appveyor-windows-test.cmd index ae206b799..3664eaf47 100644 --- a/appveyor-windows-test.cmd +++ b/appveyor-windows-test.cmd @@ -6,19 +6,18 @@ echo 1>killing-tests.tmp :: force loop kill all the tests after 10 minutes (600 seconds) start "" /b cmd /c "call appveyor-windows-kill-tests.cmd 600>nul" -msbuild /m RUN_TESTS.vcxproj /v:q - -del /q killing-tests.tmp +msbuild /m RUN_TESTS.vcxproj /v:m set testserror=%errorlevel% - -"C:\msys64\usr\bin\ldd.exe" "tests\Debug\test_cubic.exe" - set errorlevel=0 -msbuild /m bin\perf_server.vcxproj /v:q +del /q killing-tests.tmp + +:: use ldd for diagnosing missing/incorrect shared (dll/so/dylib) libs +:: "C:\msys64\usr\bin\ldd.exe" "tests\Debug\test_cubic.exe" +msbuild /m bin\perf_server.vcxproj /v:m if errorlevel 1 goto :after_perf_test -msbuild /m bin\perf_client.vcxproj /v:q +msbuild /m bin\perf_client.vcxproj /v:m if errorlevel 1 goto :after_perf_test start "" /b cmd /c "bin\Debug\perf_server -L notice -s ::1:8443 -c localhost,tests/localhost.pem,tests/localhost.key" diff --git a/appveyor-windows.cmd b/appveyor-windows.cmd index eee66bbec..0f0630ff8 100644 --- a/appveyor-windows.cmd +++ b/appveyor-windows.cmd @@ -39,7 +39,8 @@ if errorlevel 1 goto :retry_submodule_update cmake -DCMAKE_BUILD_TYPE=Debug -DCMAKE_GENERATOR_PLATFORM=x64 -DBUILD_SHARED_LIBS=OFF -DVCPKG_TARGET_TRIPLET=x64-windows-static -DCMAKE_TOOLCHAIN_FILE=c:/tools/vcpkg/scripts/buildsystems/vcpkg.cmake -DBORINGSSL_DIR=%cd%\boringssl . -msbuild /m src\liblsquic\lsquic.vcxproj /v:q +msbuild /m src\liblsquic\lsquic.vcxproj /v:m if errorlevel 1 exit !errorlevel! -msbuild /m tests\build-tests.vcxproj /v:q + +msbuild /m tests\build-tests.vcxproj /v:m if errorlevel 1 exit !errorlevel! diff --git a/appveyor-windows.yml b/appveyor-windows.yml index f1ca04109..6302d784c 100644 --- a/appveyor-windows.yml +++ b/appveyor-windows.yml @@ -3,8 +3,8 @@ version: 1.{branch}.{build} image: Visual Studio 2022 cache: -- c:\tools\vcpkg -> appveyor-windows.yml,appveyor-update-vcpkg.cmd,c:\tools\vcpkg\.git\refs\heads\master -- boringssl -> appveyor-windows.cmd,boringssl-target.txt # we define the commit in here +- c:\tools\vcpkg -> c:\tools\vcpkg\.git\refs\heads\master +- boringssl -> boringssl-target.txt # we define the commit in here environment: VCPKG_DISABLE_METRICS: 1 From c2f4dd69635f8d5073833af3b0e935aa86ca6506 Mon Sep 17 00:00:00 2001 From: Tyler Young Date: Wed, 12 Jan 2022 10:33:49 -0500 Subject: [PATCH 29/30] try to run perf test anyway --- appveyor-windows-test.cmd | 2 -- 1 file changed, 2 deletions(-) diff --git a/appveyor-windows-test.cmd b/appveyor-windows-test.cmd index 3664eaf47..7a2e32770 100644 --- a/appveyor-windows-test.cmd +++ b/appveyor-windows-test.cmd @@ -16,9 +16,7 @@ del /q killing-tests.tmp :: use ldd for diagnosing missing/incorrect shared (dll/so/dylib) libs :: "C:\msys64\usr\bin\ldd.exe" "tests\Debug\test_cubic.exe" msbuild /m bin\perf_server.vcxproj /v:m -if errorlevel 1 goto :after_perf_test msbuild /m bin\perf_client.vcxproj /v:m -if errorlevel 1 goto :after_perf_test start "" /b cmd /c "bin\Debug\perf_server -L notice -s ::1:8443 -c localhost,tests/localhost.pem,tests/localhost.key" From 9069f160550c52e3757ba353c4976050358ad161 Mon Sep 17 00:00:00 2001 From: Tyler Young Date: Wed, 12 Jan 2022 12:14:38 -0500 Subject: [PATCH 30/30] print start and end of perf test on windows --- appveyor-windows-test.cmd | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/appveyor-windows-test.cmd b/appveyor-windows-test.cmd index 7a2e32770..adc2d8694 100644 --- a/appveyor-windows-test.cmd +++ b/appveyor-windows-test.cmd @@ -18,10 +18,14 @@ del /q killing-tests.tmp msbuild /m bin\perf_server.vcxproj /v:m msbuild /m bin\perf_client.vcxproj /v:m +echo Starting perf_server start "" /b cmd /c "bin\Debug\perf_server -L notice -s ::1:8443 -c localhost,tests/localhost.pem,tests/localhost.key" +echo Starting perf_client bin\Debug\perf_client -L info -s ::1:8443 -p 104857600:104857600 +echo perf_client exited with code %errorlevel% +echo Perf run complete tskill perf_server :after_perf_test