Skip to content

Commit 72e74ec

Browse files
committed
WIP: fix CI
1 parent b8e6af4 commit 72e74ec

File tree

4 files changed

+20
-14
lines changed

4 files changed

+20
-14
lines changed

.travis.yml

+11-5
Original file line numberDiff line numberDiff line change
@@ -9,13 +9,16 @@ cache:
99
os:
1010
- linux
1111
- osx
12+
dist: xenial
1213

1314
before_script:
15+
# install extra stuff for cross-compilation
16+
- if [[ "$TRAVIS_OS_NAME" == linux ]]; then sudo apt update && sudo apt install gcc-multilib; fi
1417
# macOS weirdness (https://github.com/travis-ci/travis-ci/issues/6307, https://github.com/travis-ci/travis-ci/issues/10165)
1518
- if [[ "$TRAVIS_OS_NAME" == osx ]]; then rvm get stable; fi
1619
# Compute the rust version we use. We do not use "language: rust" to have more control here.
1720
- |
18-
if [ "$TRAVIS_EVENT_TYPE" = cron ]; then
21+
if [[ "$TRAVIS_EVENT_TYPE" == cron ]]; then
1922
RUST_TOOLCHAIN=nightly
2023
else
2124
RUST_TOOLCHAIN=$(cat rust-version)
@@ -24,7 +27,7 @@ before_script:
2427
if [ "$TRAVIS_OS_NAME" == osx ]; then
2528
export MIRI_SYSROOT_BASE=~/Library/Caches/miri.miri.miri/
2629
else
27-
export MIRI_SYSROOT_BASE=~/.cache/miri/HOST
30+
export MIRI_SYSROOT_BASE=~/.cache/miri/
2831
fi
2932
# install Rust
3033
- curl https://build.travis-ci.org/files/rustup-init.sh -sSf | sh -s -- -y --default-toolchain "$RUST_TOOLCHAIN"
@@ -38,10 +41,13 @@ script:
3841
cargo build --release --all-features --all-targets &&
3942
cargo install --all-features --force --path .
4043
- |
41-
# Get ourselves a MIR-full libstd
44+
# Get ourselves a MIR-full libstd for the host and a foreign architecture
4245
cargo miri setup &&
43-
cargo miri setup --target i686-unknown-linux-gnu &&
44-
cargo miri setup --target i686-apple-darwin
46+
if [[ "$TRAVIS_OS_NAME" == osx ]]; then
47+
cargo miri setup --target i686-apple-darwin
48+
else
49+
cargo miri setup --target i686-unknown-linux-gnu
50+
fi
4551
- |
4652
# Test miri with full MIR, on the host and other architectures
4753
MIRI_SYSROOT=$MIRI_SYSROOT_BASE/HOST cargo test --release --all-features &&

appveyor.yml

+3-4
Original file line numberDiff line numberDiff line change
@@ -25,16 +25,15 @@ install:
2525
build: false
2626

2727
test_script:
28-
- set RUSTFLAGS=-g
2928
- set RUST_BACKTRACE=1
30-
# Test plain miri
29+
# Build miri
3130
- cargo build --release --all-features --all-targets
32-
- cargo test --release --all-features
3331
# Get ourselves a MIR-full libstd, and use it henceforth
3432
- cargo run --release --all-features --bin cargo-miri -- miri setup
3533
- set MIRI_SYSROOT=%USERPROFILE%\AppData\Local\miri\miri\cache\HOST
36-
# Test miri with full MIR
34+
# Test miri
3735
- cargo test --release --all-features
36+
- cargo run --release --all-features --bin cargo-miri -- miri run --manifest-path=test-cargo-miri/Cargo.toml
3837

3938
notifications:
4039
- provider: Email

src/bin/cargo-miri.rs

+4-5
Original file line numberDiff line numberDiff line change
@@ -342,22 +342,21 @@ fn main() {
342342
.collect()
343343
};
344344
args.splice(0..0, miri::miri_default_args().iter().map(ToString::to_string));
345+
args.extend_from_slice(&["--cfg".to_owned(), r#"feature="cargo-miri""#.to_owned()]);
345346

346347
// this check ensures that dependencies are built but not interpreted and the final crate is
347348
// interpreted but not built
348349
let miri_enabled = std::env::args().any(|s| s == "--emit=dep-info,metadata");
349-
350350
let mut command = if miri_enabled {
351351
let mut path = std::env::current_exe().expect("current executable path invalid");
352352
path.set_file_name("miri");
353353
Command::new(path)
354354
} else {
355355
Command::new("rustc")
356356
};
357+
command.args(&args);
357358

358-
args.extend_from_slice(&["--cfg".to_owned(), r#"feature="cargo-miri""#.to_owned()]);
359-
360-
match command.args(&args).status() {
359+
match command.status() {
361360
Ok(exit) => {
362361
if !exit.success() {
363362
std::process::exit(exit.code().unwrap_or(42));
@@ -388,7 +387,7 @@ where
388387
args.push(r#"feature="cargo-miri""#.to_owned());
389388

390389
let path = std::env::current_exe().expect("current executable path invalid");
391-
let exit_status = std::process::Command::new("cargo")
390+
let exit_status = Command::new("cargo")
392391
.args(&args)
393392
.env("RUSTC", path)
394393
.spawn()

src/fn_call.rs

+2
Original file line numberDiff line numberDiff line change
@@ -113,6 +113,8 @@ impl<'a, 'mir, 'tcx: 'mir + 'a> EvalContextExt<'tcx, 'mir> for super::MiriEvalCo
113113
Some(name) => name.as_str(),
114114
None => self.tcx.item_name(def_id).as_str(),
115115
};
116+
// Strip linker suffixes (seen on 32bit macOS)
117+
let link_name = link_name.trim_end_matches("$UNIX2003");
116118

117119
let tcx = &{self.tcx.tcx};
118120

0 commit comments

Comments
 (0)