2
0

.travis.yml 16 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482
  1. language: c
  2. sudo: required
  3. cache:
  4. directories:
  5. - $HOME/libpsl-0.20.1
  6. - $HOME/mbedtls-mbedtls-2.8.0
  7. - $HOME/libidn2-2.0.4
  8. - $HOME/wolfssl-3.14.0-stable
  9. - $HOME/mesalink-0.7.1
  10. - $HOME/nghttp2-1.34.0
  11. env:
  12. global:
  13. - LD_LIBRARY_PATH=/usr/local/lib
  14. addons:
  15. apt:
  16. config:
  17. retries: true
  18. sources:
  19. - ubuntu-toolchain-r-test
  20. - llvm-toolchain-trusty-7
  21. packages:
  22. - cmake
  23. - gcc-8
  24. - lcov
  25. - clang-7
  26. - valgrind
  27. - libev-dev
  28. - libc-ares-dev
  29. - g++-8
  30. - libstdc++-8-dev
  31. - stunnel4
  32. - libidn2-0-dev
  33. - libssh2-1-dev
  34. - libssh-dev
  35. - krb5-user
  36. - autopoint # for libpsl that needs autoreconf that uses gettext that needs it
  37. - libunistring-dev # for libidn2 needed by libpsl
  38. - libnss3-dev
  39. - gnutls-bin
  40. - libgnutls28-dev
  41. - clang-tidy-7
  42. matrix:
  43. include:
  44. - os: linux
  45. compiler: gcc
  46. dist: trusty
  47. env:
  48. - T=normal C="--with-gssapi --with-libssh2" CHECKSRC=1
  49. - OVERRIDE_CC="CC=gcc-8" OVERRIDE_CXX="CXX=g++-8"
  50. - os: linux
  51. compiler: gcc
  52. dist: trusty
  53. env:
  54. - T=normal C=--with-libssh
  55. - OVERRIDE_CC="CC=gcc-8" OVERRIDE_CXX="CXX=g++-8"
  56. - os: linux
  57. compiler: gcc
  58. dist: trusty
  59. env:
  60. - T=normal C="--disable-http --disable-smtp --disable-imap"
  61. - OVERRIDE_CC="CC=gcc-8" OVERRIDE_CXX="CXX=g++-8"
  62. - os: linux
  63. compiler: gcc
  64. dist: trusty
  65. env:
  66. - T=normal C="--enable-ares"
  67. - OVERRIDE_CC="CC=gcc-8" OVERRIDE_CXX="CXX=g++-8"
  68. - os: linux
  69. compiler: gcc
  70. dist: trusty
  71. env:
  72. - T=normal C="--disable-verbose" CPPFLAGS="-Wno-variadic-macros" NOTESTS=1
  73. - OVERRIDE_CC="CC=gcc-8" OVERRIDE_CXX="CXX=g++-8"
  74. - os: linux
  75. compiler: gcc
  76. dist: trusty
  77. env:
  78. - T=normal BROTLI=yes
  79. - OVERRIDE_CC="CC=gcc-8" OVERRIDE_CXX="CXX=g++-8"
  80. - os: linux
  81. compiler: gcc
  82. dist: trusty
  83. env:
  84. - T=novalgrind BORINGSSL=yes C="--with-ssl=$HOME/boringssl" LD_LIBRARY_PATH=/home/travis/boringssl/lib:/usr/local/lib
  85. - OVERRIDE_CC="CC=gcc-8" OVERRIDE_CXX="CXX=g++-8"
  86. - os: linux
  87. compiler: gcc
  88. dist: trusty
  89. env:
  90. - T=debug-wolfssl C="--with-wolfssl --without-ssl"
  91. - OVERRIDE_CC="CC=gcc-8" OVERRIDE_CXX="CXX=g++-8"
  92. - os: linux
  93. compiler: gcc
  94. dist: trusty
  95. env:
  96. - T=debug-mesalink C="--with-mesalink --without-ssl"
  97. - OVERRIDE_CC="CC=gcc-8" OVERRIDE_CXX="CXX=g++-8"
  98. - os: linux
  99. compiler: clang
  100. dist: trusty
  101. env:
  102. - T=debug
  103. - OVERRIDE_CC="CC=clang-7" OVERRIDE_CXX="CXX=clang++-7"
  104. - os: linux
  105. compiler: clang
  106. dist: trusty
  107. env:
  108. - T=debug C="--enable-alt-svc"
  109. - OVERRIDE_CC="CC=clang-7" OVERRIDE_CXX="CXX=clang++-7"
  110. - os: linux
  111. compiler: clang
  112. dist: trusty
  113. env:
  114. - T=debug C="--with-mbedtls --without-ssl"
  115. - OVERRIDE_CC="CC=clang-7" OVERRIDE_CXX="CXX=clang++-7"
  116. - os: linux
  117. compiler: clang
  118. dist: trusty
  119. env:
  120. - T=debug C="--with-gnutls --without-ssl"
  121. - OVERRIDE_CC="CC=clang-7" OVERRIDE_CXX="CXX=clang++-7"
  122. - os: linux
  123. compiler: clang
  124. dist: trusty
  125. env:
  126. - T=debug C="--disable-threaded-resolver"
  127. - OVERRIDE_CC="CC=clang-7" OVERRIDE_CXX="CXX=clang++-7"
  128. - os: linux
  129. compiler: clang
  130. dist: trusty
  131. env:
  132. - T=debug C="--with-nss --without-ssl" NOTESTS=1 CPPFLAGS="-isystem /usr/include/nss"
  133. - OVERRIDE_CC="CC=clang-7" OVERRIDE_CXX="CXX=clang++-7"
  134. - os: linux
  135. compiler: gcc
  136. dist: trusty
  137. env:
  138. - T=iconv
  139. - OVERRIDE_CC="CC=gcc-8" OVERRIDE_CXX="CXX=g++-8"
  140. - os: osx
  141. compiler: gcc
  142. env: T=debug C=--with-libssh2
  143. - os: osx
  144. compiler: gcc
  145. env: T=debug C=--enable-ares
  146. - os: osx
  147. compiler: gcc
  148. env: T=debug C="--with-ssl=/usr/local/opt/openssl --with-libmetalink"
  149. - os: osx
  150. compiler: gcc
  151. env: T=debug C="--with-ssl=/usr/local/opt/libressl --with-libmetalink"
  152. - os: osx
  153. compiler: clang
  154. osx_image: xcode10
  155. env: T=debug C="--without-ssl --with-darwinssl --with-libmetalink"
  156. - os: osx
  157. compiler: clang
  158. env: T=normal
  159. - os: osx
  160. compiler: clang
  161. env: T=cmake
  162. - os: linux
  163. compiler: gcc
  164. dist: trusty
  165. env:
  166. - T=cmake
  167. - OVERRIDE_CC="CC=gcc-8" OVERRIDE_CXX="CXX=g++-8"
  168. - os: linux
  169. compiler: clang
  170. dist: trusty
  171. env:
  172. - T=cmake
  173. - OVERRIDE_CC="CC=clang-7" OVERRIDE_CXX="CXX=clang++-7"
  174. - os: linux
  175. compiler: gcc
  176. dist: trusty
  177. env:
  178. - T=coverage
  179. - OVERRIDE_CC="CC=gcc-8" OVERRIDE_CXX="CXX=g++-8"
  180. - os: linux
  181. compiler: gcc
  182. dist: trusty
  183. env:
  184. - T=distcheck
  185. - OVERRIDE_CC="CC=gcc-8" OVERRIDE_CXX="CXX=g++-8"
  186. - os: linux
  187. compiler: clang
  188. dist: trusty
  189. env:
  190. - T=fuzzer
  191. - OVERRIDE_CC="CC=clang-7" OVERRIDE_CXX="CXX=clang++-7"
  192. - os: linux
  193. compiler: clang
  194. dist: trusty
  195. env:
  196. - T=tidy
  197. - OVERRIDE_CC="CC=clang-7" OVERRIDE_CXX="CXX=clang++-7"
  198. - os: linux
  199. compiler: clang
  200. dist: trusty
  201. env:
  202. - T=scan-build
  203. - OVERRIDE_CC="CC=clang-7" OVERRIDE_CXX="CXX=clang++-7"
  204. - os: linux
  205. compiler: clang
  206. dist: trusty
  207. env:
  208. - T=debug CFLAGS="-fsanitize=address,undefined,signed-integer-overflow -fno-sanitize-recover=undefined,integer -Wformat -Werror=format-security -Werror=array-bounds -g" LDFLAGS="-fsanitize=address,undefined -fno-sanitize-recover=undefined,integer" LIBS="-ldl -lubsan"
  209. - OVERRIDE_CC="CC=clang-7" OVERRIDE_CXX="CXX=clang++-7"
  210. before_install:
  211. - eval "${OVERRIDE_CC}"
  212. - eval "${OVERRIDE_CXX}"
  213. install:
  214. - if [ "$T" = "coverage" ]; then pip2 install --user cpp-coveralls; fi
  215. - if [ "$TRAVIS_OS_NAME" == "osx" ]; then brew update > /dev/null; fi
  216. - if [ "$TRAVIS_OS_NAME" == "osx" ]; then brew reinstall libtool > /dev/null; fi
  217. - if [ "$TRAVIS_OS_NAME" == "osx" ]; then brew install rtmpdump libssh2 c-ares libmetalink libressl nghttp2 libmetalink; fi
  218. before_script:
  219. - ./buildconf
  220. - |
  221. # No brotli package available for Trusty. Download & compile from source.
  222. # Cannot be done in the install script because cmake is needed.
  223. if [ "$TRAVIS_OS_NAME" = linux -a "$BROTLI" ]; then
  224. curl -L https://github.com/google/brotli/archive/v1.0.1.tar.gz |
  225. tar xzf - &&
  226. (
  227. cd brotli-1.0.1 &&
  228. cmake . -DCMAKE_INSTALL_PREFIX=/usr \
  229. -DCMAKE_INSTALL_LIBDIR=/usr/lib &&
  230. make &&
  231. sudo make install
  232. )
  233. fi
  234. - |
  235. if [ "$TRAVIS_OS_NAME" = linux -a "$BORINGSSL" ]; then
  236. (cd $HOME &&
  237. git clone --depth=1 https://boringssl.googlesource.com/boringssl &&
  238. cd boringssl &&
  239. mkdir build &&
  240. cd build &&
  241. CXX="g++" CC="gcc" cmake -DCMAKE_BUILD_TYPE=release -DBUILD_SHARED_LIBS=1 .. &&
  242. make &&
  243. cd .. &&
  244. mkdir lib &&
  245. cd lib &&
  246. ln -s ../build/crypto/libcrypto.so . &&
  247. ln -s ../build/ssl/libssl.so . &&
  248. echo "BoringSSL lib dir: "`pwd` &&
  249. export LIBS=-lpthread )
  250. fi
  251. - |
  252. if [ $TRAVIS_OS_NAME = linux ]; then
  253. if [ ! -e $HOME/libidn2-2.0.4/Makefile ]; then
  254. (cd $HOME && \
  255. curl -LO https://ftp.gnu.org/gnu/libidn/libidn2-2.0.4.tar.gz && \
  256. tar -xzf libidn2-2.0.4.tar.gz && \
  257. cd libidn2-2.0.4 && \
  258. ./configure && \
  259. make)
  260. fi
  261. fi
  262. - |
  263. if [ $TRAVIS_OS_NAME = linux ]; then
  264. if [ ! -e $HOME/libpsl-0.20.1/Makefile ]; then
  265. (cd $HOME && \
  266. curl -LO https://github.com/rockdaboot/libpsl/releases/download/libpsl-0.20.1/libpsl-0.20.1.tar.gz && \
  267. tar -xzf libpsl-0.20.1.tar.gz && \
  268. cd libpsl-0.20.1 && \
  269. autoreconf -i && \
  270. ./configure && \
  271. make)
  272. fi
  273. fi
  274. - |
  275. if [ $TRAVIS_OS_NAME = linux ]; then
  276. if [ ! -e $HOME/mbedtls-mbedtls-2.8.0/library/libmbedtls.a ]; then
  277. (cd $HOME && \
  278. curl -LO https://github.com/ARMmbed/mbedtls/archive/mbedtls-2.8.0.tar.gz && \
  279. tar -xzf mbedtls-2.8.0.tar.gz && \
  280. cd mbedtls-mbedtls-2.8.0 && \
  281. cmake . -DCMAKE_INSTALL_PREFIX=/usr/local -DCMAKE_C_FLAGS=-fPIC && \
  282. make)
  283. fi
  284. fi
  285. - |
  286. if [ $TRAVIS_OS_NAME = linux ]; then
  287. if [ ! -e $HOME/wolfssl-3.14.0-stable/Makefile ]; then
  288. (cd $HOME && \
  289. curl -LO https://github.com/wolfSSL/wolfssl/archive/v3.14.0-stable.tar.gz && \
  290. tar -xzf v3.14.0-stable.tar.gz && \
  291. cd wolfssl-3.14.0-stable && \
  292. ./autogen.sh && \
  293. ./configure --enable-tls13 --enable-all && \
  294. touch wolfssl/wolfcrypt/fips.h && \
  295. make)
  296. fi
  297. fi
  298. - |
  299. if [ $TRAVIS_OS_NAME = linux ]; then
  300. if [ ! -e $HOME/mesalink-0.7.1/Makefile ]; then
  301. (cd $HOME && \
  302. curl https://sh.rustup.rs -sSf | sh -s -- -y && \
  303. source $HOME/.cargo/env && \
  304. curl -LO https://github.com/mesalock-linux/mesalink/archive/v0.7.1.tar.gz && \
  305. tar -xzf v0.7.1.tar.gz && \
  306. cd mesalink-0.7.1 && \
  307. ./autogen.sh && \
  308. ./configure --enable-tls13 && \
  309. make)
  310. fi
  311. fi
  312. - |
  313. if [ $TRAVIS_OS_NAME = linux ]; then
  314. if [ ! -e $HOME/nghttp2-1.34.0/Makefile ]; then
  315. (cd $HOME && \
  316. curl -L https://github.com/nghttp2/nghttp2/releases/download/v1.34.0/nghttp2-1.34.0.tar.gz |
  317. tar xzf - && \
  318. cd nghttp2-1.34.0 && \
  319. CXX="g++-8" CC="gcc-8" CFLAGS="" LDFLAGS="" LIBS="" ./configure --disable-threads --enable-app && \
  320. make)
  321. fi
  322. fi
  323. - |
  324. if [ $TRAVIS_OS_NAME = linux ]; then
  325. (cd $HOME/libidn2-2.0.4 && sudo make install)
  326. (cd $HOME/libpsl-0.20.1 && sudo make install)
  327. (cd $HOME/mbedtls-mbedtls-2.8.0 && sudo make install)
  328. (cd $HOME/wolfssl-3.14.0-stable && sudo make install)
  329. (cd $HOME/mesalink-0.7.1 && sudo make install)
  330. (cd $HOME/nghttp2-1.34.0 && sudo make install)
  331. fi
  332. script:
  333. - |
  334. set -eo pipefail
  335. if [ "$T" = "coverage" ]; then
  336. ./configure --enable-debug --disable-shared --enable-code-coverage
  337. make
  338. make TFLAGS=-n test-nonflaky
  339. make "TFLAGS=-n -e" test-nonflaky
  340. tests="1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 200 201 202 300 301 302 500 501 502 503 504 506 507 508 509 510 511 512 513 514 515 516 517 518 519 600 601 700 701 702 800 801 802 803 900 901 902 903 1000 1001 1002 1004 1100 1101 1200 1201 1302 1303 1304 1305 1306 1308 1400 1401 1402 1404 1450 1451 1452 1502 1507 1508 1600 1602 1603 1605 1650 1651 1652 1653 1654 2001 2100 3000"
  341. make "TFLAGS=-n -t $tests" test-nonflaky
  342. coveralls --gcov /usr/bin/gcov-8 --gcov-options '\-lp' -i src -e lib -e tests -e docs -b $PWD/src
  343. coveralls --gcov /usr/bin/gcov-8 --gcov-options '\-lp' -e src -i lib -e tests -e docs -b $PWD/lib
  344. fi
  345. - |
  346. set -eo pipefail
  347. if [ "$T" = "debug" ]; then
  348. ./configure --enable-debug --enable-werror $C
  349. make && make examples
  350. if [ -z $NOTESTS ]; then
  351. make TFLAGS=-n test-nonflaky
  352. fi
  353. fi
  354. - |
  355. set -eo pipefail
  356. if [ "$T" = "debug-wolfssl" ]; then
  357. ./configure --enable-debug --enable-werror $C
  358. make
  359. make "TFLAGS=-n !311 !313" test-nonflaky
  360. fi
  361. - |
  362. set -eo pipefail
  363. if [ "$T" = "debug-mesalink" ]; then
  364. ./configure --enable-debug --enable-werror $C
  365. make
  366. make "TFLAGS=-n !313" test-nonflaky
  367. fi
  368. - |
  369. set -eo pipefail
  370. if [ "$T" = "novalgrind" ]; then
  371. ./configure $C
  372. make && make examples
  373. make TFLAGS=-n test-nonflaky
  374. fi
  375. - |
  376. set -eo pipefail
  377. if [ "$T" = "normal" ]; then
  378. if [ $TRAVIS_OS_NAME = linux ]; then
  379. # Remove system curl to make sure we don't rely on it.
  380. # Only done on Linux since we're not permitted to on mac.
  381. sudo rm -f /usr/bin/curl
  382. fi
  383. ./configure --enable-warnings --enable-werror $C
  384. make && make examples
  385. if [ -z $NOTESTS ]; then
  386. make test-nonflaky
  387. fi
  388. if [ -n $CHECKSRC ]; then
  389. make checksrc
  390. fi
  391. fi
  392. - |
  393. set -eo pipefail
  394. if [ "$T" = "tidy" ]; then
  395. ./configure --enable-warnings --enable-werror $C
  396. make && make tidy
  397. fi
  398. - |
  399. set -eo pipefail
  400. if [ "$T" = "iconv" ]; then
  401. source .travis-iconv-env.sh
  402. ./configure --enable-debug --enable-werror $C
  403. make && make examples
  404. make test-nonflaky
  405. fi
  406. - |
  407. set -eo pipefail
  408. if [ "$T" = "cmake" ]; then
  409. if [ $TRAVIS_OS_NAME = linux ]; then
  410. cmake -H. -Bbuild -DCURL_WERROR=ON && cmake --build build
  411. else
  412. cmake -H. -Bbuild -DOPENSSL_ROOT_DIR=/usr/local/opt/openssl -DCURL_DISABLE_LDAP=ON -DCURL_DISABLE_LDAPS=ON && cmake --build build
  413. fi
  414. fi
  415. - |
  416. set -eo pipefail
  417. if [ "$T" = "distcheck" ]; then
  418. # find BOM markers and exit if we do
  419. ! git grep `printf '\xef\xbb\xbf'`
  420. ./configure
  421. make
  422. ./maketgz 99.98.97
  423. # verify in-tree build - and install it
  424. (tar xf curl-99.98.97.tar.gz && \
  425. cd curl-99.98.97 && \
  426. ./configure --prefix=$HOME/temp && \
  427. make && \
  428. make TFLAGS=1 test && \
  429. make install)
  430. # basic check of the installed files
  431. bash scripts/installcheck.sh $HOME/temp
  432. rm -rf curl-99.98.97
  433. # verify out-of-tree build
  434. (tar xf curl-99.98.97.tar.gz && \
  435. touch curl-99.98.97/docs/{cmdline-opts,libcurl}/Makefile.inc && \
  436. mkdir build && \
  437. cd build && \
  438. ../curl-99.98.97/configure && \
  439. make && \
  440. make TFLAGS='-p 1 1139' test)
  441. # verify cmake build
  442. rm -rf curl-99.98.97
  443. (tar xf curl-99.98.97.tar.gz && \
  444. cd curl-99.98.97 && \
  445. mkdir build && \
  446. cd build && \
  447. cmake .. && \
  448. make)
  449. fi
  450. - |
  451. set -eo pipefail
  452. if [ "$T" = "fuzzer" ]; then
  453. # Download the fuzzer to a temporary folder
  454. ./tests/fuzz/download_fuzzer.sh /tmp/curl_fuzzer
  455. export CURLSRC=$PWD
  456. # Run the mainline fuzzer test
  457. pushd /tmp/curl_fuzzer
  458. ./mainline.sh ${CURLSRC}
  459. popd
  460. fi
  461. - |
  462. if [ "$T" = "scan-build" ]; then
  463. scan-build ./configure --enable-debug --enable-werror $C
  464. scan-build --status-bugs make && scan-build --status-bugs make examples
  465. fi
  466. # whitelist branches to avoid testing feature branches twice (as branch and as pull request)
  467. branches:
  468. only:
  469. - master
  470. notifications:
  471. email: false