Skip to content

Commit 74e9ed9

Browse files
committed
move travis commands to script file, maybe that fixes the macOS weirdness
1 parent e6147ae commit 74e9ed9

File tree

2 files changed

+28
-31
lines changed

2 files changed

+28
-31
lines changed

.travis.yml

Lines changed: 2 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -12,51 +12,22 @@ os:
1212
dist: xenial
1313

1414
before_script:
15-
# install extra stuff for cross-compilation
15+
# Linux: install extra stuff for cross-compilation
1616
- 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
1917
# Compute the rust version we use. We do not use "language: rust" to have more control here.
2018
- |
2119
if [[ "$TRAVIS_EVENT_TYPE" == cron ]]; then
2220
RUST_TOOLCHAIN=nightly
2321
else
2422
RUST_TOOLCHAIN=$(cat rust-version)
2523
fi
26-
- |
27-
if [ "$TRAVIS_OS_NAME" == osx ]; then
28-
export MIRI_SYSROOT_BASE=~/Library/Caches/miri.miri.miri/
29-
else
30-
export MIRI_SYSROOT_BASE=~/.cache/miri/
31-
fi
32-
- |
33-
if [[ "$TRAVIS_OS_NAME" == osx ]]; then
34-
FOREIGN_TARGET=i686-apple-darwin
35-
else
36-
FOREIGN_TARGET=i686-unknown-linux-gnu
37-
fi
3824
# install Rust
3925
- curl https://build.travis-ci.org/files/rustup-init.sh -sSf | sh -s -- -y --default-toolchain "$RUST_TOOLCHAIN"
4026
- export PATH=$HOME/.cargo/bin:$PATH
4127
- rustc --version
4228

4329
script:
44-
- set -e
45-
- |
46-
# Build and install miri
47-
cargo build --release --all-features --all-targets &&
48-
cargo install --all-features --force --path .
49-
- |
50-
# Get ourselves a MIR-full libstd for the host and a foreign architecture
51-
cargo miri setup &&
52-
cargo miri setup --target "$FOREIGN_TARGET"
53-
- |
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
57-
- |
58-
# Test cargo integration
59-
(cd test-cargo-miri && MIRI_SYSROOT=$MIRI_SYSROOT_BASE/HOST ./run-test.py)
30+
- ./travis.sh
6031

6132
notifications:
6233
email:

travis.sh

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
#!/bin/bash
2+
set -e
3+
4+
# Determine configuration
5+
if [ "$TRAVIS_OS_NAME" == osx ]; then
6+
export MIRI_SYSROOT_BASE=~/Library/Caches/miri.miri.miri/
7+
FOREIGN_TARGET=i686-apple-darwin
8+
else
9+
export MIRI_SYSROOT_BASE=~/.cache/miri/
10+
FOREIGN_TARGET=i686-unknown-linux-gnu
11+
fi
12+
13+
# Build and install miri
14+
cargo build --release --all-features --all-targets &&
15+
cargo install --all-features --force --path .
16+
17+
# Get ourselves a MIR-full libstd for the host and a foreign architecture
18+
cargo miri setup &&
19+
cargo miri setup --target "$FOREIGN_TARGET"
20+
21+
# Test miri with full MIR, on the host and other architectures
22+
MIRI_SYSROOT=$MIRI_SYSROOT_BASE/HOST cargo test --release --all-features &&
23+
MIRI_SYSROOT=$MIRI_SYSROOT_BASE MIRI_TARGET=$FOREIGN_TARGET cargo test --release --all-features
24+
25+
# Test cargo integration
26+
(cd test-cargo-miri && MIRI_SYSROOT=$MIRI_SYSROOT_BASE/HOST ./run-test.py)

0 commit comments

Comments
 (0)