Skip to content

Commit 2a03db9

Browse files
authored
Merge pull request #673 from RalfJung/travis
use rustup-toolchain-install-master for CI
2 parents 82f9a01 + 159cce1 commit 2a03db9

File tree

4 files changed

+42
-17
lines changed

4 files changed

+42
-17
lines changed

.appveyor.yml

Lines changed: 20 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -3,28 +3,31 @@ environment:
33
PROJECT_NAME: miri
44
matrix:
55
- TARGET: x86_64-pc-windows-msvc
6-
MSYS2_BITS: 64
76
- TARGET: i686-pc-windows-msvc
8-
MSYS2_BITS: 32
97

108
# branches to build
119
branches:
1210
# whitelist
1311
only:
1412
- master
1513

14+
cache:
15+
- '%USERPROFILE%\.cargo'
16+
- '%USERPROFILE%\.rustup'
17+
1618
install:
17-
# Install Rust.
18-
- set PATH=C:\Program Files\Git\mingw64\bin;C:\msys64\mingw%MSYS2_BITS%\bin;%PATH%
19-
- set /p RUST_TOOLCHAIN=<rust-version
19+
# Install Rust
2020
- curl -sSf -o rustup-init.exe https://win.rustup.rs/
21-
- rustup-init.exe -y --default-host %TARGET% --default-toolchain %RUST_TOOLCHAIN%
21+
- rustup-init.exe -y --default-host %TARGET% --default-toolchain stable
2222
- set PATH=%USERPROFILE%\.cargo\bin;%PATH%
23+
# Install "master" toolchain
24+
- cargo install rustup-toolchain-install-master
25+
- set /p RUSTC_HASH=<rust-version
26+
- rustup-toolchain-install-master -f -n master %RUSTC_HASH% -c cargo -c rust-src
27+
- rustup default master
2328
- rustc --version
2429

25-
build: false
26-
27-
test_script:
30+
build_script:
2831
- set RUST_TEST_NOCAPTURE=1
2932
- set RUST_BACKTRACE=1
3033
# Build and install miri
@@ -33,11 +36,18 @@ test_script:
3336
# Get ourselves a MIR-full libstd, and use it henceforth
3437
- cargo miri setup
3538
- set MIRI_SYSROOT=%USERPROFILE%\AppData\Local\miri\miri\cache\HOST
39+
40+
test_script:
3641
# Test miri
3742
- cargo test --release --all-features
3843
# Test cargo integration
3944
- cd test-cargo-miri
40-
- python3 run-test.py
45+
- '"C:\msys64\mingw64\bin\python3.exe" run-test.py'
46+
47+
after_test:
48+
# Don't cache "master" toolchain, it's a waste
49+
- rustup default stable
50+
- rustup toolchain uninstall master
4151

4252
notifications:
4353
- provider: Email

.travis.yml

Lines changed: 15 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,8 @@ cache:
44
# we cannot reuse anyway when the nightly changes (and it grows quite large
55
# over time).
66
directories:
7-
- /home/travis/.cargo
7+
- $HOME/.cargo
8+
- $HOME/.rustup
89

910
os:
1011
- linux
@@ -17,18 +18,27 @@ before_script:
1718
# Compute the rust version we use. We do not use "language: rust" to have more control here.
1819
- |
1920
if [[ "$TRAVIS_EVENT_TYPE" == cron ]]; then
20-
RUST_TOOLCHAIN=nightly
21+
RUSTC_HASH=$(git ls-remote https://github.com/rust-lang/rust.git master | awk '{print $1}')
2122
else
22-
RUST_TOOLCHAIN=$(cat rust-version)
23+
RUSTC_HASH=$(cat rust-version)
2324
fi
24-
# install Rust
25-
- curl https://build.travis-ci.org/files/rustup-init.sh -sSf | sh -s -- -y --default-toolchain "$RUST_TOOLCHAIN"
25+
# Install Rust ("stable" toolchain for better caching, it is just used to build rustup-toolchain-install-master)
26+
- curl https://build.travis-ci.org/files/rustup-init.sh -sSf | sh -s -- -y --default-toolchain stable
2627
- export PATH=$HOME/.cargo/bin:$PATH
28+
# Install "master" toolchain
29+
- cargo install rustup-toolchain-install-master || echo "rustup-toolchain-install-master already installed"
30+
- travis_retry rustup-toolchain-install-master -f -n master $RUSTC_HASH -c cargo -c rust-src
31+
- rustup default master
2732
- rustc --version
2833

2934
script:
3035
- ./travis.sh
3136

37+
before_cache:
38+
# Don't cache "master" toolchain, it's a waste
39+
- rustup default stable
40+
- rustup toolchain uninstall master
41+
3242
notifications:
3343
email:
3444
on_success: never

README.md

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -120,13 +120,18 @@ other projects:
120120

121121
```sh
122122
rustup component remove miri # avoid having Miri installed twice
123-
cargo +nightly install --path "$DIR" --force # or the nightly in `rust-version`
123+
cargo +nightly install --path "$DIR" --force
124124
cargo +nightly miri setup
125125
```
126126

127127
(We are giving `+nightly` explicitly here all the time because it is important
128128
that all of these commands get executed with the same toolchain.)
129129

130+
In case this fails, your nightly might be incompatible with Miri master. The
131+
`rust-version` file contains the commit hash of rustc that Miri is currently
132+
tested against; you can use that to find a nightly that works or you might have
133+
to wait for the next nightly to get released.
134+
130135
If you want to use a different libstd (not the one that comes with the
131136
nightly), you can do that by running
132137

rust-version

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
nightly-2019-04-03
1+
f717b58dd70829f105960a071c7992b440720482

0 commit comments

Comments
 (0)