3 # Cache the global cargo directory, but NOT the local `target` directory which
4 # we cannot reuse anyway when the nightly changes (and it grows quite large
15 # install extra stuff for cross-compilation
16 - if [[ "$TRAVIS_OS_NAME" == linux ]]; then sudo apt update && sudo apt install gcc-multilib; fi
17 # macOS weirdness (https://github.com/travis-ci/travis-ci/issues/6307, https://github.com/travis-ci/travis-ci/issues/10165)
18 - if [[ "$TRAVIS_OS_NAME" == osx ]]; then rvm get stable; fi
19 # Compute the rust version we use. We do not use "language: rust" to have more control here.
21 if [[ "$TRAVIS_EVENT_TYPE" == cron ]]; then
22 RUST_TOOLCHAIN=nightly
24 RUST_TOOLCHAIN=$(cat rust-version)
27 if [ "$TRAVIS_OS_NAME" == osx ]; then
28 export MIRI_SYSROOT_BASE=~/Library/Caches/miri.miri.miri/
30 export MIRI_SYSROOT_BASE=~/.cache/miri/
33 if [[ "$TRAVIS_OS_NAME" == osx ]]; then
34 FOREIGN_TARGET=i686-apple-darwin
36 FOREIGN_TARGET=i686-unknown-linux-gnu
39 - curl https://build.travis-ci.org/files/rustup-init.sh -sSf | sh -s -- -y --default-toolchain "$RUST_TOOLCHAIN"
40 - export PATH=$HOME/.cargo/bin:$PATH
46 # Build and install miri
47 cargo build --release --all-features --all-targets &&
48 cargo install --all-features --force --path .
50 # Get ourselves a MIR-full libstd for the host and a foreign architecture
52 cargo miri setup --target "$FOREIGN_TARGET"
54 # Test miri with full MIR, on the host and other architectures
55 MIRI_SYSROOT=$MIRI_SYSROOT_BASE/HOST cargo test --release --all-features &&
56 MIRI_SYSROOT=$MIRI_SYSROOT_BASE MIRI_TARGET=$FOREIGN_TARGET cargo test --release --all-features
58 # Test cargo integration
59 (cd test-cargo-miri && MIRI_SYSROOT=$MIRI_SYSROOT_BASE/HOST ./run-test.py)
69 - RUST_TEST_NOCAPTURE=1