Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[WIP] Improve windows CI build, CI for windows shared #353

Open
wants to merge 31 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
31 commits
Select commit Hold shift + click to select a range
1b08c63
be more specific w/ build targets in appveyor-linux.yml
TYoungSL Dec 15, 2021
6a23070
extract mac from linux appveyor build
TYoungSL Dec 16, 2021
698dfe1
separate windows static and shared builds
TYoungSL Dec 16, 2021
7bfa8ed
improve vcpkg integration
TYoungSL Dec 17, 2021
4f6af09
improve vcpkg integration
TYoungSL Jan 10, 2022
59d31d0
update vcpkg
TYoungSL Jan 10, 2022
fdb4f23
exclude installed and packages directory from git clean on vcpkg update
TYoungSL Jan 10, 2022
3ce6696
handle static PCRE2 linkage with defining PCRE2_STATIC for bin targets
TYoungSL Jan 10, 2022
c67a3d5
print windows system application event log after running tests even (…
TYoungSL Jan 10, 2022
5b19e20
fix pcre2 posix linkage
TYoungSL Jan 10, 2022
406153c
fix vcpkg update and clean up
TYoungSL Jan 10, 2022
54d0f72
quiet down vcpkg git operations
TYoungSL Jan 10, 2022
0fc1c8c
reduce msbuild verbosity
TYoungSL Jan 10, 2022
fa97db2
try using ldd to figure out which incorrect is being used
TYoungSL Jan 11, 2022
d8142b2
try building w/ the vs 2022 image
TYoungSL Jan 11, 2022
2ce036c
fix mising zlib1.dll
TYoungSL Jan 11, 2022
ac510b1
fix broken appveyor vcpkg update
TYoungSL Jan 11, 2022
a51bdd6
for windows run perf test even if tests fail but preserve exit code o…
TYoungSL Jan 11, 2022
daff4cd
add working test kill timeout of 10 minutes
TYoungSL Jan 11, 2022
f89b338
make killing tests loop for all subsequent tests after timeout reached
TYoungSL Jan 11, 2022
693fb3c
caching of boringssl build artifacts
TYoungSL Jan 11, 2022
4cd6f76
add a little breather in the test kill loop
TYoungSL Jan 11, 2022
17fed89
make test killer not hang ci for remaining duration if tests succeed
TYoungSL Jan 11, 2022
eeebfb9
why doesn't appveyor cache work correctly for linux and mac?
TYoungSL Jan 11, 2022
ead80f9
reduce verbosity of windows builds and tests
TYoungSL Jan 12, 2022
c52d360
ci no-change test run for caching
TYoungSL Jan 12, 2022
4389553
disable cache on error
TYoungSL Jan 12, 2022
7f5af95
remove some cache reqs
TYoungSL Jan 12, 2022
58729bf
Merge remote-tracking branch 'remotes/origin/master' into feature/app…
TYoungSL Jan 12, 2022
c2f4dd6
try to run perf test anyway
TYoungSL Jan 12, 2022
9069f16
print start and end of perf test on windows
TYoungSL Jan 12, 2022
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
/bin/test_config.h
/src/liblsquic/lsquic_versions_to_string.c
/build
130 changes: 94 additions & 36 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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()

Expand Down Expand Up @@ -221,19 +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)
FIND_PATH(GETOPT_INCLUDE_DIR NAMES getopt.h)
IF (GETOPT_INCLUDE_DIR)
INCLUDE_DIRECTORIES(${GETOPT_INCLUDE_DIR})
ELSE()
MESSAGE(FATAL_ERROR "getopt.h was not found")
ENDIF()
FIND_LIBRARY(GETOPT_LIB getopt)
IF(GETOPT_LIB)
MESSAGE(STATUS "Found getopt: ${GETOPT_LIB}")
ELSE()
MESSAGE(STATUS "getopt not found")
ENDIF()
IF (MSVC)

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
Expand All @@ -246,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)
Expand Down
71 changes: 58 additions & 13 deletions appveyor-linux.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,47 +2,92 @@ version: 2.{branch}.{build}

image:
- Ubuntu2004
- MacOS

cache:
- $HOME/.apt
- boringssl -> boringssl-target.txt # we define the commit in here

build: off

init:

cache:
# - boringssl -> appveyor-linux.yml # we define the commit in here

install:

- sh: >-

if [[ -e boringssl/CMakeLists.txt ]] ; then
if compgen -G "~/.apt/libevent-dev*.deb" ; then

sudo apt install -y ~/.apt/libevent-dev*.deb

else

sudo apt update -qq

echo cached
sudo apt -y --no-install-recommends install libevent-dev

fi


if [[ -f ./boringssl/include/openssl/ssl.h ]] ; then

echo boringssl cached

else

git clone https://boringssl.googlesource.com/boringssl

cd boringssl

git checkout cf8d3ad3cea51cf7184307d54f465da62b7d8408

cmake .
git reset --hard $(<../boringssl-target.txt)

make -j4
rm -rf .git

cd ..

fi

cd boringssl

cmake .

make -j2 crypto ssl decrepit

cd ..

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

mkdir -p $HOME/.apt

sudo mv -v /var/cache/apt/archives/libevent-dev*.deb $HOME/.apt/

cmake -DBORINGSSL_DIR=$PWD/boringssl .

make
make -j2 lsquic build-tests

test_script:

- sh: make test
- sh: >-

make help

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
75 changes: 75 additions & 0 deletions appveyor-macos.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,75 @@
version: 2.{branch}.{build}

image:
- MacOS

cache:
- boringssl -> boringssl-target.txt # we define the commit in here

build: off

init:

install:

- sh: >-

if [[ -f ./boringssl/include/openssl/ssl.h ]] ; then

echo boringssl cached

else

git clone https://boringssl.googlesource.com/boringssl

cd boringssl

git reset --hard $(<../boringssl-target.txt)

rm -rf .git

cd ..

fi

cd boringssl

cmake .

make -j2 crypto ssl decrepit

cd ..

git submodule init

n=0

until git submodule update --checkout --force --recursive ; do

[ "$n" -ge 10 ] && exit 1

n=$((n+1))

done

cmake -DBORINGSSL_DIR=$PWD/boringssl .

make -j2 lsquic build-tests

test_script:

- sh: >-

make help

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
23 changes: 23 additions & 0 deletions appveyor-update-vcpkg.cmd
Original file line number Diff line number Diff line change
@@ -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 -q

bootstrap-vcpkg.bat

)

git reset -q --hard HEAD

git clean -fdx -e installed -e packages -e vcpkg.exe

popd
16 changes: 16 additions & 0 deletions appveyor-windows-kill-tests.cmd
Original file line number Diff line number Diff line change
@@ -0,0 +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 >nul
goto :loop
Loading