.travis.yml 19 KB

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