3 ## Comment out the compiler list for now to allow an explicit build
12 - "irc.oftc.net#tor-ci"
14 - "%{repository} %{branch} %{commit} - %{author}: %{commit_subject}"
15 - "Build #%{build_number} %{result}. Details: %{build_url}"
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.
28 ## Use the Ubuntu Trusty images.
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
39 ## (Linux only) Download our dependencies
43 ## Required dependencies
47 ## Optional dependencies
50 ## zstd doesn't exist in Ubuntu Trusty
53 ## The build matrix in the following two stanzas expands into four builds (per OS):
55 ## * with GCC, with Rust
56 ## * with GCC, without Rust
57 ## * with Clang, with Rust
58 ## * with Clang, without Rust
61 ## The Travis CI environment allows us two cores, so let's use both.
64 ## Leave at least one entry here or Travis seems to generate a
65 ## matrix entry with empty matrix environment variables. Leaving
66 ## more than one entry causes unwanted matrix entries with
67 ## unspecified compilers.
68 - RUST_OPTIONS="--enable-rust --enable-cargo-online-mode"
69 # - RUST_OPTIONS="--enable-rust" TOR_RUST_DEPENDENCIES=true
73 ## Uncomment to allow the build to report success (with non-required
74 ## sub-builds continuing to run) if all required sub-builds have
75 ## succeeded. This is somewhat buggy currently: it can cause
76 ## duplicate notifications and prematurely report success if a
77 ## single sub-build has succeeded. See
78 ## https://github.com/travis-ci/travis-ci/issues/1696
81 ## Uncomment the appropriate lines below to allow the build to
82 ## report success even if some less-critical sub-builds fail and it
83 ## seems likely to take a while for someone to fix it. Currently
84 ## Travis CI doesn't distinguish "all builds succeeded" from "some
85 ## non-required sub-builds failed" except on the individual build's
86 ## page, which makes it somewhat annoying to detect from the
87 ## branches and build history pages. See
88 ## https://github.com/travis-ci/travis-ci/issues/8716
90 - env: RUST_OPTIONS="--enable-rust" TOR_RUST_DEPENDENCIES=true
91 - env: RUST_OPTIONS="--enable-rust --enable-cargo-online-mode"
92 - env: DISTCHECK="yes" RUST_OPTIONS="--enable-rust --enable-cargo-online-mode"
95 ## Create explicit matrix entries to work around a Travis CI
96 ## environment issue. Missing keys inherit from the first list
97 ## entry under that key outside the "include" clause.
101 env: RUST_OPTIONS="--enable-rust" TOR_RUST_DEPENDENCIES=true
105 env: COVERAGE_OPTIONS="--enable-coverage"
107 env: DISTCHECK="yes" RUST_OPTIONS=""
109 env: DISTCHECK="yes" RUST_OPTIONS="--enable-rust --enable-cargo-online-mode"
111 env: MODULES_OPTIONS="--disable-module-dirauth"
112 ## The "sudo: required" forces non-containerized builds, working
113 ## around a Travis CI environment issue: clang LeakAnalyzer fails
114 ## because it requires ptrace and the containerized environment no
115 ## longer allows ptrace.
120 env: RUST_OPTIONS="--enable-rust" TOR_RUST_DEPENDENCIES=true
126 env: MODULES_OPTIONS="--disable-module-dirauth"
129 ## If we're on OSX, homebrew usually needs to updated first
130 - if [[ "$TRAVIS_OS_NAME" == "osx" ]]; then brew update ; fi
132 - if [[ "$RUST_OPTIONS" != "" ]]; then curl -Ssf -o rustup.sh https://sh.rustup.rs; fi
133 - if [[ "$COVERAGE_OPTIONS" != "" ]]; then pip install --user cpp-coveralls; fi
136 ## If we're on OSX use brew to install required dependencies (for Linux, see the "apt:" section above)
137 - if [[ "$TRAVIS_OS_NAME" == "osx" ]]; then { brew outdated openssl || brew upgrade openssl; }; fi
138 - if [[ "$TRAVIS_OS_NAME" == "osx" ]]; then { brew outdated libevent || brew upgrade libevent; }; fi
139 - if [[ "$TRAVIS_OS_NAME" == "osx" ]]; then { brew outdated pkg-config || brew upgrade pkg-config; }; fi
140 ## If we're on OSX also install the optional dependencies
141 - if [[ "$TRAVIS_OS_NAME" == "osx" ]]; then { brew outdated xz || brew upgrade xz; }; fi
142 - if [[ "$TRAVIS_OS_NAME" == "osx" ]]; then { brew outdated libscrypt || brew upgrade libscrypt; }; fi
143 - if [[ "$TRAVIS_OS_NAME" == "osx" ]]; then { brew outdated zstd || brew upgrade zstd; }; fi
144 ## Install the stable channels of rustc and cargo and setup our toolchain environment
145 - if [[ "$RUST_OPTIONS" != "" ]]; then sh rustup.sh -y --default-toolchain stable; fi
146 - if [[ "$RUST_OPTIONS" != "" ]]; then source $HOME/.cargo/env; fi
147 ## Get some info about rustc and cargo
148 - if [[ "$RUST_OPTIONS" != "" ]]; then which rustc; fi
149 - if [[ "$RUST_OPTIONS" != "" ]]; then which cargo; fi
150 - if [[ "$RUST_OPTIONS" != "" ]]; then rustc --version; fi
151 - if [[ "$RUST_OPTIONS" != "" ]]; then cargo --version; fi
152 ## If we're testing rust builds in offline-mode, then set up our vendored dependencies
153 - if [[ "$TOR_RUST_DEPENDENCIES" == "true" ]]; then export TOR_RUST_DEPENDENCIES=$PWD/src/ext/rust/crates; fi
157 - ./configure $RUST_OPTIONS $COVERAGE_OPTIONS $MODULES_OPTIONS --disable-asciidoc --enable-fatal-warnings --disable-silent-rules --enable-fragile-hardening
158 ## We run `make check` because that's what https://jenkins.torproject.org does.
159 - if [[ "$DISTCHECK" == "" ]]; then make check; fi
160 - if [[ "$DISTCHECK" != "" ]]; then make distcheck DISTCHECK_CONFIGURE_FLAGS="$RUST_OPTIONS $COVERAGE_OPTIONS --disable-asciidoc --enable-fatal-warnings --disable-silent-rules --enable-fragile-hardening"; fi
163 ## `make check` will leave a log file with more details of test failures.
164 - if [[ "$DISTCHECK" == "" ]]; then cat test-suite.log; fi
165 ## `make distcheck` puts it somewhere different.
166 - if [[ "$DISTCHECK" != "" ]]; then make show-distdir-testlog; fi
169 ## If this build was one that produced coverage, upload it.
170 - if [[ "$COVERAGE_OPTIONS" != "" ]]; then coveralls -b . --exclude src/test --exclude src/trunnel --gcov-options '\-p'; fi