Print stacktrace when crypto_pk_get_digest() fails in router_build_fresh_descriptor()
[tor.git] / .travis.yml
blobcb00b0393cb8c73bbc2dc746cf8c22368e2ad3c1
1 language: c
3 ## Comment out the compiler list for now to allow an explicit build
4 ## matrix.
5 # compiler:
6 #   - gcc
7 #   - clang
9 notifications:
10   irc:
11     channels:
12       - "irc.oftc.net#tor-ci"
13     template:
14       - "%{repository} %{branch} %{commit} - %{author}: %{commit_subject}"
15       - "Build #%{build_number} %{result}. Details: %{build_url}"
16     on_success: change
17     on_failure: change
18   email:
19     on_success: never
20     on_failure: change
22 os:
23   - linux
24   ## Uncomment the following line to also run the entire build matrix on OSX.
25   ## This will make your CI builds take roughly ten times longer to finish.
26   # - osx
28 ## Use the Ubuntu Trusty images.
29 dist: trusty
31 ## We don't need sudo. (The "apt:" stanza after this allows us to not need sudo;
32 ## otherwise, we would need it for getting dependencies.)
34 ## We override this in the explicit build matrix to work around a
35 ## Travis CI environment regression
36 ## https://github.com/travis-ci/travis-ci/issues/9033
37 sudo: false
39 ## (Linux only) Download our dependencies
40 addons:
41   apt:
42     packages:
43       ## Required dependencies
44       - libevent-dev
45       - zlib1g-dev
46       ## Optional dependencies
47       - libcap-dev
48       - liblzma-dev
49       - libscrypt-dev
50       - libseccomp-dev
51       ## zstd doesn't exist in Ubuntu Trusty
52       #- libzstd
54 ## The build matrix in the following two stanzas expands into four builds (per OS):
56 ##  * with GCC, with Rust
57 ##  * with GCC, without Rust
58 ##  * with Clang, with Rust
59 ##  * with Clang, without Rust
60 env:
61   global:
62     ## The Travis CI environment allows us two cores, so let's use both.
63     - MAKEFLAGS="-j 2"
64     - HARDENING_OPTIONS="--enable-fragile-hardening"
65   matrix:
66     ## Leave at least one entry here or Travis seems to generate a
67     ## matrix entry with empty matrix environment variables.  Leaving
68     ## more than one entry causes unwanted matrix entries with
69     ## unspecified compilers.
70     - RUST_OPTIONS="--enable-rust --enable-cargo-online-mode"
71     # - RUST_OPTIONS="--enable-rust" TOR_RUST_DEPENDENCIES=true
72     # - RUST_OPTIONS=""
74 matrix:
75   ## Uncomment to allow the build to report success (with non-required
76   ## sub-builds continuing to run) if all required sub-builds have
77   ## succeeded.  This is somewhat buggy currently: it can cause
78   ## duplicate notifications and prematurely report success if a
79   ## single sub-build has succeeded.  See
80   ## https://github.com/travis-ci/travis-ci/issues/1696
81   # fast_finish: true
83   ## Uncomment the appropriate lines below to allow the build to
84   ## report success even if some less-critical sub-builds fail and it
85   ## seems likely to take a while for someone to fix it.  Currently
86   ## Travis CI doesn't distinguish "all builds succeeded" from "some
87   ## non-required sub-builds failed" except on the individual build's
88   ## page, which makes it somewhat annoying to detect from the
89   ## branches and build history pages.  See
90   ## https://github.com/travis-ci/travis-ci/issues/8716
91   allow_failures:
92     - env: RUST_OPTIONS="--enable-rust" TOR_RUST_DEPENDENCIES=true
93     - env: RUST_OPTIONS="--enable-rust --enable-cargo-online-mode"
94     - env: DISTCHECK="yes" RUST_OPTIONS="--enable-rust --enable-cargo-online-mode"
95     # - compiler: clang
97   ## Create explicit matrix entries to work around a Travis CI
98   ## environment issue.  Missing keys inherit from the first list
99   ## entry under that key outside the "include" clause.
100   include:
101     - compiler: gcc
102     - compiler: gcc
103       env: RUST_OPTIONS="--enable-rust" TOR_RUST_DEPENDENCIES=true
104     - compiler: gcc
105       env: RUST_OPTIONS=""
106     - compiler: gcc
107       env: COVERAGE_OPTIONS="--enable-coverage"
108     - compiler: gcc
109       env: DISTCHECK="yes" RUST_OPTIONS=""
110     - compiler: gcc
111       env: DISTCHECK="yes" RUST_OPTIONS="--enable-rust --enable-cargo-online-mode"
112     - compiler: gcc
113       env: MODULES_OPTIONS="--disable-module-dirauth"
114     - compiler: gcc
115       env: HARDENING_OPTIONS="" RUST_OPTIONS="--enable-rust" TOR_RUST_DEPENDENCIES=true
116     - compiler: gcc
117       env: DISTCHECK="yes" HARDENING_OPTIONS="" RUST_OPTIONS="--enable-rust --enable-cargo-online-mode"
118     ## The "sudo: required" forces non-containerized builds, working
119     ## around a Travis CI environment issue: clang LeakAnalyzer fails
120     ## because it requires ptrace and the containerized environment no
121     ## longer allows ptrace.
122     - compiler: clang
123       sudo: required
124     - compiler: clang
125       sudo: required
126       env: RUST_OPTIONS="--enable-rust" TOR_RUST_DEPENDENCIES=true
127     - compiler: clang
128       sudo: required
129       env: RUST_OPTIONS=""
130     - compiler: clang
131       sudo: required
132       env: MODULES_OPTIONS="--disable-module-dirauth"
134 before_install:
135   ## If we're on OSX, homebrew usually needs to updated first
136   - if [[ "$TRAVIS_OS_NAME" == "osx" ]]; then brew update ; fi
137   ## Download rustup
138   - if [[ "$RUST_OPTIONS" != "" ]]; then curl -Ssf -o rustup.sh https://sh.rustup.rs; fi
139   - if [[ "$COVERAGE_OPTIONS" != "" ]]; then pip install --user cpp-coveralls; fi
141 install:
142   ## If we're on OSX use brew to install required dependencies (for Linux, see the "apt:" section above)
143   - if [[ "$TRAVIS_OS_NAME" == "osx" ]]; then { brew outdated openssl    || brew upgrade openssl;    }; fi
144   - if [[ "$TRAVIS_OS_NAME" == "osx" ]]; then { brew outdated libevent   || brew upgrade libevent;   }; fi
145   - if [[ "$TRAVIS_OS_NAME" == "osx" ]]; then { brew outdated pkg-config || brew upgrade pkg-config; }; fi
146   ## If we're on OSX also install the optional dependencies
147   - if [[ "$TRAVIS_OS_NAME" == "osx" ]]; then { brew outdated xz         || brew upgrade xz;         }; fi
148   - if [[ "$TRAVIS_OS_NAME" == "osx" ]]; then { brew outdated libscrypt  || brew upgrade libscrypt;  }; fi
149   - if [[ "$TRAVIS_OS_NAME" == "osx" ]]; then { brew outdated zstd       || brew upgrade zstd;       }; fi
150   ## Install the stable channels of rustc and cargo and setup our toolchain environment
151   - if [[ "$RUST_OPTIONS" != "" ]]; then sh rustup.sh -y --default-toolchain stable; fi
152   - if [[ "$RUST_OPTIONS" != "" ]]; then source $HOME/.cargo/env; fi
153   ## Get some info about rustc and cargo
154   - if [[ "$RUST_OPTIONS" != "" ]]; then which rustc; fi
155   - if [[ "$RUST_OPTIONS" != "" ]]; then which cargo; fi
156   - if [[ "$RUST_OPTIONS" != "" ]]; then rustc --version; fi
157   - if [[ "$RUST_OPTIONS" != "" ]]; then cargo --version; fi
158   ## If we're testing rust builds in offline-mode, then set up our vendored dependencies
159   - if [[ "$TOR_RUST_DEPENDENCIES" == "true" ]]; then export TOR_RUST_DEPENDENCIES=$PWD/src/ext/rust/crates; fi
161 script:
162   - ./autogen.sh
163   - ./configure $RUST_OPTIONS $COVERAGE_OPTIONS $MODULES_OPTIONS --disable-asciidoc --enable-fatal-warnings --disable-silent-rules $HARDENING_OPTIONS
164   ## We run `make check` because that's what https://jenkins.torproject.org does.
165   - if [[ "$DISTCHECK" == "" ]]; then make check; fi
166   - if [[ "$DISTCHECK" != "" ]]; then make distcheck DISTCHECK_CONFIGURE_FLAGS="$RUST_OPTIONS $COVERAGE_OPTIONS --disable-asciidoc --enable-fatal-warnings --disable-silent-rules $HARDENING_OPTIONS"; fi
168 after_failure:
169   ## `make check` will leave a log file with more details of test failures.
170   - if [[ "$DISTCHECK" == "" ]]; then cat test-suite.log; fi
171   ## `make distcheck` puts it somewhere different.
172   - if [[ "$DISTCHECK" != "" ]]; then make show-distdir-testlog; fi
174 after_success:
175   ## If this build was one that produced coverage, upload it.
176   - if [[ "$COVERAGE_OPTIONS" != "" ]]; then coveralls -b . --exclude src/test --exclude src/trunnel --gcov-options '\-p'; fi