]> git.lizzy.rs Git - rust.git/commitdiff
fix CI
authorRalf Jung <post@ralfj.de>
Mon, 10 Dec 2018 09:19:44 +0000 (10:19 +0100)
committerRalf Jung <post@ralfj.de>
Mon, 10 Dec 2018 11:21:39 +0000 (12:21 +0100)
.travis.yml
appveyor.yml
src/bin/cargo-miri.rs
src/fn_call.rs

index ac3f16ce13530b48ac870147ee0b34585a15c505..1d49394e29b8ee4d188c5687bc446b4e4d7cf814 100644 (file)
@@ -9,13 +9,16 @@ cache:
 os:
 - linux
 - osx
+dist: xenial
 
 before_script:
+# install extra stuff for cross-compilation
+- if [[ "$TRAVIS_OS_NAME" == linux ]]; then sudo apt update && sudo apt install gcc-multilib; fi
 # macOS weirdness (https://github.com/travis-ci/travis-ci/issues/6307, https://github.com/travis-ci/travis-ci/issues/10165)
 - if [[ "$TRAVIS_OS_NAME" == osx ]]; then rvm get stable; fi
 # Compute the rust version we use. We do not use "language: rust" to have more control here.
 - |
-  if [ "$TRAVIS_EVENT_TYPE" = cron ]; then
+  if [[ "$TRAVIS_EVENT_TYPE" == cron ]]; then
     RUST_TOOLCHAIN=nightly
   else
     RUST_TOOLCHAIN=$(cat rust-version)
@@ -24,7 +27,7 @@ before_script:
   if [ "$TRAVIS_OS_NAME" == osx ]; then
     export MIRI_SYSROOT_BASE=~/Library/Caches/miri.miri.miri/
   else
-    export MIRI_SYSROOT_BASE=~/.cache/miri/HOST
+    export MIRI_SYSROOT_BASE=~/.cache/miri/
   fi
 # install Rust
 - curl https://build.travis-ci.org/files/rustup-init.sh -sSf | sh -s -- -y --default-toolchain "$RUST_TOOLCHAIN"
@@ -38,10 +41,13 @@ script:
   cargo build --release --all-features --all-targets &&
   cargo install --all-features --force --path .
 - |
-  # Get ourselves a MIR-full libstd
+  # Get ourselves a MIR-full libstd for the host and a foreign architecture
   cargo miri setup &&
-  cargo miri setup --target i686-unknown-linux-gnu &&
-  cargo miri setup --target i686-apple-darwin
+  if [[ "$TRAVIS_OS_NAME" == osx ]]; then
+    cargo miri setup --target i686-apple-darwin
+  else
+    cargo miri setup --target i686-unknown-linux-gnu
+  fi
 - |
   # Test miri with full MIR, on the host and other architectures
   MIRI_SYSROOT=$MIRI_SYSROOT_BASE/HOST cargo test --release --all-features &&
index 1f38b848c00594b6488245d07b882e0ae6bb66e8..4f4aebd8079150921c2c58a68ee6d4372c3ae89b 100644 (file)
@@ -27,13 +27,12 @@ build: false
 test_script:
     - set RUSTFLAGS=-g
     - set RUST_BACKTRACE=1
-    # Test plain miri
+    # Build miri
     - cargo build --release --all-features --all-targets
-    - cargo test --release --all-features
     # Get ourselves a MIR-full libstd, and use it henceforth
     - cargo run --release --all-features --bin cargo-miri -- miri setup
     - set MIRI_SYSROOT=%USERPROFILE%\AppData\Local\miri\miri\cache\HOST
-    # Test miri with full MIR
+    # Test miri
     - cargo test --release --all-features
 
 notifications:
index 8a1a9d0554abef50eece643a6858ff6c1e9f6ee5..7e1785fd3b9380a19ebd844aa6b92cc9295084ab 100644 (file)
@@ -342,11 +342,11 @@ fn main() {
                 .collect()
         };
         args.splice(0..0, miri::miri_default_args().iter().map(ToString::to_string));
+        args.extend_from_slice(&["--cfg".to_owned(), r#"feature="cargo-miri""#.to_owned()]);
 
         // this check ensures that dependencies are built but not interpreted and the final crate is
         // interpreted but not built
         let miri_enabled = std::env::args().any(|s| s == "--emit=dep-info,metadata");
-
         let mut command = if miri_enabled {
             let mut path = std::env::current_exe().expect("current executable path invalid");
             path.set_file_name("miri");
@@ -354,10 +354,9 @@ fn main() {
         } else {
             Command::new("rustc")
         };
+        command.args(&args);
 
-        args.extend_from_slice(&["--cfg".to_owned(), r#"feature="cargo-miri""#.to_owned()]);
-
-        match command.args(&args).status() {
+        match command.status() {
             Ok(exit) => {
                 if !exit.success() {
                     std::process::exit(exit.code().unwrap_or(42));
@@ -388,7 +387,7 @@ fn process<I>(old_args: I) -> Result<(), i32>
     args.push(r#"feature="cargo-miri""#.to_owned());
 
     let path = std::env::current_exe().expect("current executable path invalid");
-    let exit_status = std::process::Command::new("cargo")
+    let exit_status = Command::new("cargo")
         .args(&args)
         .env("RUSTC", path)
         .spawn()
index e9d3255a5b32590519470be37804ad373e240654..701dc8ca92ca26a7e3b75a3785326dd90f56b815 100644 (file)
@@ -113,6 +113,8 @@ fn emulate_foreign_item(
             Some(name) => name.as_str(),
             None => self.tcx.item_name(def_id).as_str(),
         };
+        // Strip linker suffixes (seen on 32bit macOS)
+        let link_name = link_name.trim_end_matches("$UNIX2003");
 
         let tcx = &{self.tcx.tcx};