man: ClientOnionAuthDir can't be reloaded with Sandbox 1
[tor.git] / .travis.yml
blobb5713d69331c74eb881097e82c66e75750409d82
1 language: c
3 cache:
4   ccache: true
5   ## cargo: true
6   directories:
7     - $HOME/.cargo
8     ## where we point CARGO_TARGET_DIR in all our cargo invocations
9     - $TRAVIS_BUILD_DIR/src/rust/target
11 compiler:
12   - gcc
13   - clang
15 os:
16   - linux
17   - osx
19 ## The build matrix in the following stanza expands into builds for each
20 ## OS and compiler.
21 env:
22   global:
23     ## The Travis CI environment allows us two cores, so let's use both.
24     - MAKEFLAGS="-j 2"
25     ## We turn on hardening by default
26     ## Also known as --enable-fragile-hardening in 0.3.0.3-alpha and later
27     - HARDENING_OPTIONS="--enable-expensive-hardening"
28     ## We turn off asciidoc by default, because it's slow
29     - ASCIIDOC_OPTIONS="--disable-asciidoc"
30   matrix:
31     ## We want to use each build option at least once
32     ##
33     ## We don't list default variable values, because we set the defaults
34     ## in global (or the default is unset)
35     -
36     ## TOR_RUST_DEPENDENCIES is spelt RUST_DEPENDENCIES in 0.3.2
37     - RUST_OPTIONS="--enable-rust" TOR_RUST_DEPENDENCIES=true
39 matrix:
40   ## include creates builds with gcc, linux, sudo: false
41   include:
42     ## We include a single coverage build with the best options for coverage
43     - env: COVERAGE_OPTIONS="--enable-coverage" HARDENING_OPTIONS=""
44     ## We only want to check these build option combinations once
45     ## (they shouldn't vary by compiler or OS)
46     ## We run rust and coverage with hardening off, which seems like enough
47     # - env: HARDENING_OPTIONS=""
48     ## We check asciidoc with distcheck, to make sure we remove doc products
49     - env: DISTCHECK="yes" ASCIIDOC_OPTIONS=""
50     # We clone our stem repo and run `make test-stem`
51     - env: TEST_STEM="yes"
52     ## Check rust online with distcheck, to make sure we remove rust products
53     - env: DISTCHECK="yes" RUST_OPTIONS="--enable-rust --enable-cargo-online-mode"
54     ## Check disable module dirauth with and without rust
55     - env: MODULES_OPTIONS="--disable-module-dirauth" RUST_OPTIONS="--enable-rust" TOR_RUST_DEPENDENCIES=true
56     - env: MODULES_OPTIONS="--disable-module-dirauth"
57     ## Check NSS
58     - env: NSS_OPTIONS="--enable-nss"
60   ## Uncomment to allow the build to report success (with non-required
61   ## sub-builds continuing to run) if all required sub-builds have
62   ## succeeded.  This is somewhat buggy currently: it can cause
63   ## duplicate notifications and prematurely report success if a
64   ## single sub-build has succeeded.  See
65   ## https://github.com/travis-ci/travis-ci/issues/1696
66   # fast_finish: true
68   ## Careful! We use global envs, which makes it hard to exclude or
69   ## allow failures by env:
70   ## https://docs.travis-ci.com/user/customizing-the-build#matching-jobs-with-allow_failures
71   exclude:
72     ## Clang doesn't work in containerized builds, see below.
73     - compiler: clang
74       sudo: false
75     ## Non-containerized gcc are slow and redundant.
76     - compiler: gcc
77       sudo: required
78     ## gcc on OSX is less useful, because the default compiler is clang.
79     - compiler: gcc
80       os: osx
81     ## gcc on Linux with no env is redundant, because all the custom builds use
82     ## gcc on Linux
83     - compiler: gcc
84       os: linux
85       env:
86     ## offline rust builds for gcc on Linux are redundant, because we do an
87     ## online rust build for gcc on Linux
88     - compiler: gcc
89       os: linux
90       ## TOR_RUST_DEPENDENCIES is spelt RUST_DEPENDENCIES in 0.3.2
91       env: RUST_OPTIONS="--enable-rust" TOR_RUST_DEPENDENCIES=true HARDENING_OPTIONS=""
93 ## We don't need sudo. (The "apt:" stanza after this allows us to not need
94 ## sudo; otherwise, we would need it for getting dependencies.)
96 ## But we use "sudo: required" to force non-containerized builds, working
97 ## around a Travis CI environment issue: clang LeakAnalyzer fails
98 ## because it requires ptrace and the containerized environment no
99 ## longer allows ptrace.
100 ## https://github.com/travis-ci/travis-ci/issues/9033
102 ## In the matrix above, we exclude redundant combinations.
103 sudo:
104   - false
105   - required
107 ## (Linux only) Use the latest Linux image (Ubuntu Trusty)
108 dist: trusty
110 ## Download our dependencies
111 addons:
112   ## (Linux only)
113   apt:
114     packages:
115       ## Required dependencies
116       - libevent-dev
117       ## Ubuntu comes with OpenSSL by default
118       #- libssl-dev
119       - zlib1g-dev
120       ## Optional dependencies
121       - libcap-dev
122       - liblzma-dev
123       - libnss3-dev
124       - libscrypt-dev
125       - libseccomp-dev
126       ## zstd doesn't exist in Ubuntu Trusty
127       #- libzstd
128       ## Conditional build dependencies
129       ## Always installed, so we don't need sudo
130       - asciidoc
131       - docbook-xsl
132       - docbook-xml
133       - xmlto
134   ## (OSX only)
135   homebrew:
136     packages:
137       ## Required dependencies
138       - libevent
139       ## The OSX version of OpenSSL is way too old
140       - openssl
141       ## OSX comes with zlib by default
142       ## to use a newer zlib, pass the keg path to configure (like OpenSSL)
143       #- zlib
144       ## Optional dependencies
145       - libscrypt
146       - xz
147       - zstd
148       ## Required build dependencies
149       ## Tor needs pkg-config to find some dependencies at build time
150       - pkg-config
151       ## Optional build dependencies
152       - ccache
153       ## Conditional build dependencies
154       ## Always installed, because manual brew installs are hard to get right
155       - asciidoc
156       - xmlto
158 ## (OSX only) Use the default OSX image
159 ## See https://docs.travis-ci.com/user/reference/osx#os-x-version
160 ## Default is Xcode 9.4 on macOS 10.13 as of August 2018
161 #osx_image: xcode9.4
163 before_install:
164   ## Create empty rust directories for non-Rust builds, so caching succeeds
165   - if [[ "$RUST_OPTIONS" == "" ]]; then mkdir -p $HOME/.cargo $TRAVIS_BUILD_DIR/src/rust/target; fi
167 install:
168   ## If we're on OSX, configure ccache (ccache is automatically installed and configured on Linux)
169   - if [[ "$TRAVIS_OS_NAME" == "osx" ]]; then export PATH="/usr/local/opt/ccache/libexec:$PATH"; fi
170   ## If we're on OSX, OpenSSL is keg-only, so tor 0.2.9 and later need to be configured --with-openssl-dir= to build
171   - if [[ "$TRAVIS_OS_NAME" == "osx" ]]; then OPENSSL_OPTIONS=--with-openssl-dir=`brew --prefix openssl`; fi
172   ## Install conditional features
173   ## Install coveralls
174   - if [[ "$COVERAGE_OPTIONS" != "" ]]; then pip install --user cpp-coveralls; fi
175   ## If we're on OSX, and using asciidoc, configure asciidoc
176   - if [[ "$ASCIIDOC_OPTIONS" == "" ]] && [[ "$TRAVIS_OS_NAME" == "osx" ]]; then export XML_CATALOG_FILES="/usr/local/etc/xml/catalog"; fi
177   ## If we're using Rust, download rustup
178   - if [[ "$RUST_OPTIONS" != "" ]]; then curl -Ssf -o rustup.sh https://sh.rustup.rs; fi
179   ## Install the nightly channels of rustc and cargo and setup our toolchain environment
180   - if [[ "$RUST_OPTIONS" != "" ]]; then sh rustup.sh -y --default-toolchain nightly; fi
181   - if [[ "$RUST_OPTIONS" != "" ]]; then source $HOME/.cargo/env; fi
182   ## If we're testing rust builds in offline-mode, then set up our vendored dependencies
183   - if [[ "$TOR_RUST_DEPENDENCIES" == "true" ]]; then export TOR_RUST_DEPENDENCIES=$PWD/src/ext/rust/crates; fi
184   - if [[ "$TEST_STEM" != "" ]]; then git clone --depth 1 https://github.com/torproject/stem.git ; export STEM_SOURCE_DIR=`pwd`/stem; fi
185   ##
186   ## Finally, list installed package versions
187   - if [[ "$TRAVIS_OS_NAME" == "linux" ]]; then dpkg-query --show; fi
188   - if [[ "$TRAVIS_OS_NAME" == "osx" ]]; then brew list --versions; fi
189   ## Get some info about rustup, rustc and cargo
190   - if [[ "$RUST_OPTIONS" != "" ]]; then which rustup; fi
191   - if [[ "$RUST_OPTIONS" != "" ]]; then which rustc; fi
192   - if [[ "$RUST_OPTIONS" != "" ]]; then which cargo; fi
193   - if [[ "$RUST_OPTIONS" != "" ]]; then rustup --version; fi
194   - if [[ "$RUST_OPTIONS" != "" ]]; then rustc --version; fi
195   - if [[ "$RUST_OPTIONS" != "" ]]; then cargo --version; fi
196   - if [[ "$TEST_STEM" != "" ]]; then pushd stem; python -c "from stem import stem; print(stem.__version__);"; git log -1; popd; fi
198 script:
199   - ./autogen.sh
200   - CONFIGURE_FLAGS="$ASCIIDOC_OPTIONS $COVERAGE_OPTIONS $HARDENING_OPTIONS $MODULES_OPTIONS $NSS_OPTIONS $OPENSSL_OPTIONS $RUST_OPTIONS --enable-fatal-warnings --disable-silent-rules"
201   - echo "Configure flags are $CONFIGURE_FLAGS"
202   - ./configure $CONFIGURE_FLAGS
203   ## We run `make check` because that's what https://jenkins.torproject.org does.
204   - if [[ "$DISTCHECK" == "" && "$TEST_STEM" == "" ]]; then make check; fi
205   - if [[ "$TEST_STEM" != "" ]]; then make src/app/tor test-stem; fi
206   - if [[ "$DISTCHECK" != "" && "$TEST_STEM" == "" ]]; then make distcheck DISTCHECK_CONFIGURE_FLAGS="$CONFIGURE_FLAGS"; fi
208 after_failure:
209   ## configure will leave a log file with more details of config failures.
210   ## But the log is too long for travis' rendered view, so tail it.
211   - tail -1000 config.log || echo "tail failed"
212   ## `make check` will leave a log file with more details of test failures.
213   - if [[ "$DISTCHECK" == "" ]]; then cat test-suite.log || echo "cat failed"; fi
214   ## `make distcheck` puts it somewhere different.
215   - if [[ "$DISTCHECK" != "" ]]; then make show-distdir-testlog || echo "make failed"; fi
216   - if [[ "$DISTCHECK" != "" ]]; then make show-distdir-core || echo "make failed"; fi
218 after_success:
219   ## If this build was one that produced coverage, upload it.
220   - if [[ "$COVERAGE_OPTIONS" != "" ]]; then coveralls -b . --exclude src/test --exclude src/trunnel --gcov-options '\-p'; fi
222 notifications:
223   irc:
224     channels:
225       - "irc.oftc.net#tor-ci"
226     template:
227       - "%{repository} %{branch} %{commit} - %{author}: %{commit_subject}"
228       - "Build #%{build_number} %{result}. Details: %{build_url}"
229     on_success: change
230     on_failure: change
231   email:
232     on_success: never
233     on_failure: change