@@ -2,66 +2,71 @@ language: cpp
22os :
33 - linux
44 - osx
5- - windows
65compiler :
76 - gcc
87 - clang
98env :
109 - DEBUG="debug" COVERAGE="coverage"
1110 - DEBUG="nodebug" COVERAGE="nocoverage"
1211 - LINKING="static"
12+ before_cache :
13+ - |-
14+ case $TRAVIS_OS_NAME in
15+ windows)
16+ # https://unix.stackexchange.com/a/137322/107554
17+ $msys2 pacman --sync --clean --noconfirm
18+ ;;
19+ esac
20+ cache :
21+ directories :
22+ - $HOME/AppData/Local/Temp/chocolatey
23+ - /C/tools/msys64
1324before_install :
14- - ps -ef
15- - if [ "$TRAVIS_OS_NAME" = "windows" ]; then ps -Wla | sort ; fi
1625 - eval "${MATRIX_EVAL}"
1726 - if [ "$TRAVIS_OS_NAME" != "windows" ]; then export LDFLAGS="$LDFLAGS -L/usr/local/lib -L/usr/lib"; fi
1827 - if [ "$TRAVIS_OS_NAME" != "windows" ]; then export PATH=$PATH:/usr/local/lib; fi
1928 - if [ "$TRAVIS_OS_NAME" != "windows" ]; then export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/usr/local/lib; fi
2029 - if [ "$TRAVIS_OS_NAME" != "windows" ]; then export DYLD_LIBRARY_PATH=$DYLD_LIBRARY_PATH:/usr/local/lib; fi
30+ - if [ "$TRAVIS_OS_NAME" != "windows" ]; then export buildshell=''; fi
2131 - if [ "$TRAVIS_OS_NAME" = "linux" ]; then sudo apt-get install info install-info; fi
2232 - if [ "$TRAVIS_OS_NAME" = "linux" ]; then sudo pip install codecov; fi
2333 - if [ "$TRAVIS_OS_NAME" = "linux" ]; then sudo pip install gcovr; fi
2434 - if [ "$TRAVIS_OS_NAME" = "linux" ]; then sudo apt-get install cppcheck; fi
2535 - if [ "$TRAVIS_OS_NAME" = "osx" ]; then export CFLAGS='-mtune=generic'; fi
26- - if [ "$TRAVIS_OS_NAME" = "windows" ]; then choco install -r --no-progress -y msys2 make; fi
27- - if [ " $TRAVIS_OS_NAME" = "windows" ]; then PATH=$PATH:/c/tools/msys64/usr/bin/ ; fi
28- - if [ "$TRAVIS_OS_NAME" = " windows" ]; then powershell -executionpolicy bypass "pacman -Syu --noconfirm autoconf libtool automake make autoconf-archive pkg-config mingw-w64-x86_64-libsystre" ; fi
29- - if [ "$TRAVIS_OS_NAME" = "windows" ]; then
30- ln -s /c/tools/msys64/usr/share/autoconf* /usr/share/ ;
31- ln -s /c/tools/msys64/usr/share/automake* /usr/share/ ;
32- ln -s /c/tools/msys64/usr/share/aclocal* /usr/share/ ;
33- ln -s /c/tools/msys64/usr/share/libtool* /usr/share/ ;
34- ln -s /c/ tools/ msys64/usr/share/pkgconfig /usr/share/ ;
35- ln -s /c/tools/msys64/usr/bin/autom4te /usr/bin/ ;
36- ln -s /c/tools/msys64/usr/bin/autoconf /usr/bin/ ;
37- ln -s /c/tools/msys64/usr/bin/autoheader /usr/bin/ ;
38- ln -s /c/tools/msys64/usr/bin/m4 /usr/bin/ ;
39-
40- PATH=$PATH:/c/tools/msys64/usr/bin/ ;
41- export SHELL=/usr/bin/sh.exe ;
42- fi
36+ - |-
37+ case $TRAVIS_OS_NAME in
38+ windows)
39+ [[ ! -f C:/tools/msys64/msys2_shell.cmd ]] && rm -rf C:/tools/msys64
40+ choco uninstall -y mingw
41+ choco upgrade --no-progress -y msys2
42+ export msys2='cmd //C RefreshEnv.cmd '
43+ export msys2+='& set MSYS=winsymlinks:nativestrict '
44+ export msys2+='& C:\\ tools\\ msys64\\msys2_shell.cmd -defterm -no-start'
45+ export buildshell="$msys2 -mingw64 -full-path -here -c "\"\$@"\" --"
46+ export msys2+=" -msys2 -c "\"\$@"\" --"
47+ $msys2 pacman --sync --noconfirm --disable-download-timeout --needed mingw-w64-x86_64-toolchain
48+ $msys2 pacman -Syu --noconfirm --disable-download-timeout autoconf libtool automake make autoconf-archive pkg-config mingw-w64-x86_64-libsystre mingw-w64-x86_64-doxygen mingw-w64-x86_64-gnutls mingw-w64-x86_64-graphviz mingw-w64-x86_64-curl
49+ export PATH=/C/tools/msys64/mingw64/bin:$PATH
50+ export MAKE=mingw32-make # so that Autotools can find it
51+ ; ;
52+ esac
4353 - curl https://s3.amazonaws.com/libhttpserver/libmicrohttpd_releases/libmicrohttpd-0.9.59.tar.gz -o libmicrohttpd-0.9.59.tar.gz
4454 - tar -xzf libmicrohttpd-0.9.59.tar.gz
4555 - cd libmicrohttpd-0.9.59
4656 - if [[ "$ARM_ARCH_DIR" != "" ]]; then
4757 ./configure --build `./config.guess` --host $ARM_ARCH_DIR --disable-examples;
48- elif [[ "$TRAVIS_OS_NAME" = "windows" ]]; then
49- ./configure --prefix=/usr --build=x86_64-w64-mingw32 --host=x86_64-w64-mingw32 --disable-examples --disable-https --enable-shared --enable-static ;
5058 else
51- ./configure --disable-examples;
59+ if [ "$TRAVIS_OS_NAME" != "windows" ]; then $buildshell ./configure --disable-examples; else $buildshell ./configure --disable-examples --enable-poll=no; fi ;
5260 fi
53- - if [ "$TRAVIS_OS_NAME" = "windows" ]; then find . -name Makefile -type f -exec sed -i "s/\${SHELL}/\/usr\/bin\/sh.exe/" "{}" + ; fi
54- - if [ "$TRAVIS_OS_NAME" = "windows" ]; then find . -name Makefile -type f -exec sed -i "s/\$(SHELL)/\/usr\/bin\/sh.exe/" "{}" + ; fi
55- - make
56- - if [ "$TRAVIS_OS_NAME" = "windows" ]; then make install; else sudo make install; fi
61+ - $buildshell make
62+ - if [ "$TRAVIS_OS_NAME" != "windows" ]; then sudo make install; else $buildshell make install; fi
5763 - cd ..
5864 - if [ "$BUILD_TYPE" = "asan" ]; then export CFLAGS='-fsanitize=address'; export CXXLAGS='-fsanitize=address'; export LDFLAGS='-fsanitize=address'; fi
5965 - if [ "$BUILD_TYPE" = "msan" ]; then export CFLAGS='-fsanitize=memory'; export CXXLAGS='-fsanitize=memory'; export LDFLAGS='-fsanitize=memory'; fi
6066 - if [ "$BUILD_TYPE" = "lsan" ]; then export CFLAGS='-fsanitize=leak'; export CXXLAGS='-fsanitize=leak'; export LDFLAGS='-fsanitize=leak'; fi
6167 - if [ "$BUILD_TYPE" = "tsan" ]; then export CFLAGS='-fsanitize=thread'; export CXXLAGS='-fsanitize=thread'; export LDFLAGS='-fsanitize=thread'; fi
6268 - if [ "$BUILD_TYPE" = "ubsan" ]; then export export CFLAGS='-fsanitize=undefined'; export CXXLAGS='-fsanitize=undefined'; export LDFLAGS='-fsanitize=undefined'; fi
6369install :
64- - ps -ef
6570 - if [[ "$CROSS_COMPILE" == 1 ]] ; then
6671 if [[ "$ARM_ARCH_DIR" == "aarch64-linux-gnu" ]] ; then
6772 mkdir $HOME/linker_bin ;
@@ -71,35 +76,29 @@ install:
7176 ls -al $HOME/linker_bin/ld ;
7277 fi
7378 fi
74- - ./bootstrap
79+ - $buildshell ./bootstrap
7580 - mkdir build
7681 - cd build
77- - if [ "$TRAVIS_OS_NAME" = "windows" ]; then
78- ../configure --build=x86_64-w64-mingw32 --host=x86_64-w64-mingw32 --disable-fastopen --disable-examples CPPFLAGS='-I/c/tools/msys64/mingw64/include/ -I/usr/include/' LDFLAGS='-L/c/tools/msys64/mingw64/lib -L/usr/lib/' ;
79- cd .. ;
80- find . -name Makefile -type f -exec sed -i "s/\$(SHELL)/\/usr\/bin\/sh.exe/" "{}" + ;
81- cd build ;
82- elif [ "$LINKING" = "static" ]; then
83- ../configure --enable-static --disable-fastopen;
82+ - if [ "$TRAVIS_OS_NAME" = "windows" ]; then export MANIFEST_TOOL='no'; fi
83+ - if [ "$LINKING" = "static" ]; then
84+ $buildshell ../configure --enable-static --disable-fastopen;
8485 elif [ "$DEBUG" = "debug" ] && [ "$COVERAGE" = "coverage" ]; then
85- ../configure --enable-debug --enable-coverage --disable-shared --disable-fastopen;
86+ $buildshell ../configure --enable-debug --enable-coverage --disable-shared --disable-fastopen;
8687 elif [ "$DEBUG" = "debug" ]; then
87- ../configure --enable-debug --disable-shared --disable-fastopen;
88+ $buildshell ../configure --enable-debug --disable-shared --disable-fastopen;
8889 elif [ "$CROSS_COMPILE" = "1" ] && [ "$ARM_ARCH_DIR" = "aarch64-linux-gnu" ]; then
89- ../configure --disable-fastopen --build `../config.guess` --host aarch64-linux-gnu CC="gcc -B$HOME/linker_bin" CXX="g++ -B$HOME/linker_bin";
90+ $buildshell ../configure --disable-fastopen --build `../config.guess` --host aarch64-linux-gnu CC="gcc -B$HOME/linker_bin" CXX="g++ -B$HOME/linker_bin";
9091 elif [ "$CROSS_COMPILE" = "1" ] && [ "$ARM_ARCH_DIR" = "arm-linux-gnueabi" ]; then
91- ../configure --disable-fastopen --build `../config.guess` --host arm-linux-gnueabi;
92+ $buildshell ../configure --disable-fastopen --build `../config.guess` --host arm-linux-gnueabi;
9293 elif [ "$VALGRIND" = "valgrind" ]; then
93- ../configure --enable-debug --disable-fastopen --disable-valgrind-helgrind --disable-valgrind-drd --disable-valgrind-sgcheck;
94+ $buildshell ../configure --enable-debug --disable-fastopen --disable-valgrind-helgrind --disable-valgrind-drd --disable-valgrind-sgcheck;
9495 else
95- ../configure --disable-fastopen;
96+ $buildshell ../configure --disable-fastopen;
9697 fi
9798 - if [ "$CROSS_COMPILE" = "1" ] && [ "$ARM_ARCH_DIR" = "aarch64-linux-gnu" ]; then sed -i 's+/usr/bin/ld+$HOME/linker_bin/ld+g' libtool; fi
9899 - if [ "$CROSS_COMPILE" = "1" ] && [ "$ARM_ARCH_DIR" = "aarch64-linux-gnu" ]; then sed -i 's+/usr/bin/ld+$HOME/linker_bin/ld+g' Makefile; fi
99- - make
100- - if [ "$TRAVIS_OS_NAME" != "windows" ]; then make check TESTS= ; fi
100+ - $buildshell make
101101script :
102- - ps -ef
103102 - if [[ "$CROSS_COMPILE" == 1 ]]; then
104103 cd test ;
105104 if [[ "$ARM_ARCH_DIR" == "aarch64-linux-gnu" ]]; then
@@ -120,8 +119,8 @@ script:
120119 qemu-arm -L /usr/arm-linux-gnueabi/ ./.libs/threaded ;
121120 fi
122121 fi
123- - if [ "$TRAVIS_OS_NAME" != "windows" ]; then make check ; fi
124- - if [ "$TRAVIS_OS_NAME" != "windows" ]; then cat test/test-suite.log; fi
122+ - $buildshell make check
123+ - $buildshell cat test/test-suite.log
125124 - if [ "$VALGRIND" = "valgrind" ]; then make check-valgrind; fi;
126125 - if [ "$VALGRIND" = "valgrind" ]; then cat test/test-suite-memcheck.log; fi;
127126 - if [ "$TRAVIS_OS_NAME" = "linux" ]; then cd ../src/; cppcheck --error-exitcode=1 .; cd ../build; fi
@@ -144,19 +143,13 @@ script:
144143 sleep 5 && ab -n 10000000 -c 100 localhost:8080/plaintext
145144 fi
146145after_script :
147- - ps -ef
148- - if [ "$TRAVIS_OS_NAME" = "windows" ]; then ps -Wla | sort ; fi
149- - if [ "$TRAVIS_OS_NAME" = "windows" ]; then gpgconf --kill gpg-agent ; fi
150146 - if [ "$TRAVIS_OS_NAME" = "windows" ]; then taskkill //F //PID $(ps -Wla | tr -s ' ' | grep gpg | cut -f2 -d' ') ; fi
151- - if [ "$TRAVIS_OS_NAME" = "windows" ]; then ps -Wla | sort ; fi
152- - echo $$
153147after_success :
154148 - if [ "$DEBUG" = "debug" ] && [ "$COVERAGE" = "coverage" ] && [ "$TRAVIS_OS_NAME" = "linux" ]; then bash <(curl -s https://codecov.io/bash); fi
155149matrix :
156150 exclude :
157151 - compiler : clang
158152 env : DEBUG="debug" COVERAGE="coverage"
159- - os : windows
160153 include :
161154 - os : windows
162155 env : DEBUG="nodebug" COVERAGE="nocoverage" YARN_GPG=no
0 commit comments