From e842a938573a6561fa14e983b70918c013877a6f Mon Sep 17 00:00:00 2001 From: Ralf Jung Date: Fri, 11 Oct 2019 10:11:01 +0200 Subject: [PATCH 1/4] bump rustc and adjust for rustc-dev component (also sync AppVeyor with Travis: use stable cargo) --- .appveyor.yml | 2 +- .travis.yml | 2 +- rust-version | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/.appveyor.yml b/.appveyor.yml index c3d575403c..411b71cfca 100644 --- a/.appveyor.yml +++ b/.appveyor.yml @@ -28,7 +28,7 @@ install: - rustup update # Install "master" toolchain - cargo install rustup-toolchain-install-master & exit 0 - - rustup-toolchain-install-master -f -n master %RUSTC_HASH% -c cargo -c rust-src + - rustup-toolchain-install-master -f -n master %RUSTC_HASH% -c rust-src -c rustc-dev - rustup default master - rustc --version - cargo --version diff --git a/.travis.yml b/.travis.yml index 446fab7941..1b06f2e2db 100644 --- a/.travis.yml +++ b/.travis.yml @@ -38,7 +38,7 @@ before_script: - rustup update # Install "master" toolchain - cargo install rustup-toolchain-install-master || echo "rustup-toolchain-install-master already installed" -- travis_retry rustup-toolchain-install-master -f -n master $RUSTC_HASH -c rust-src +- travis_retry rustup-toolchain-install-master -f -n master $RUSTC_HASH -c rust-src -c rustc-dev - rustup default master - rustc --version - cargo --version diff --git a/rust-version b/rust-version index db6f5ebe88..43ebb88d16 100644 --- a/rust-version +++ b/rust-version @@ -1 +1 @@ -2748a9fd93dd1a00a4521f4f16de5befbf77f6cd +000d90b11f7be70ffb7812680f7abc6deb52ec88 From c96efcdbd54fa162e377b0c5a7360accb5cbbda4 Mon Sep 17 00:00:00 2001 From: Ralf Jung Date: Fri, 11 Oct 2019 10:13:26 +0200 Subject: [PATCH 2/4] adjust README for rustc-dev --- CONTRIBUTING.md | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 83e2338552..d643687393 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -31,8 +31,10 @@ Miri heavily relies on internal rustc interfaces to execute MIR. Still, some things (like adding support for a new intrinsic or a shim for an external function being called) can be done by working just on the Miri side. -To prepare, make sure you are using a nightly Rust compiler. Then you should be -able to just `cargo build` Miri. +To prepare, make sure you are using a nightly Rust compiler. You also need to +have the `rust-src` and `rustc-dev` components installed, which you can add via +`rustup component add rust-src rustc-dev`. Then you should be able to just +`cargo build` Miri. In case this fails, your nightly might be incompatible with Miri master. The `rust-version` file contains the commit hash of rustc that Miri is currently @@ -41,7 +43,7 @@ to wait for the next nightly to get released. You can also use [`rustup-toolchain-install-master`](https://github.com/kennytm/rustup-toolchain-install-master) to install that exact version of rustc as a toolchain: ``` -rustup-toolchain-install-master $(cat rust-version) -c rust-src +rustup-toolchain-install-master $(cat rust-version) -c rust-src -c rustc-dev ``` Another common problem is outdated dependencies: Miri does not come with a From 7cfe2e8fd4a4afd55dd7412d8769ed28eb8fd481 Mon Sep 17 00:00:00 2001 From: Ralf Jung Date: Sat, 12 Oct 2019 17:11:29 +0200 Subject: [PATCH 3/4] temporarily ignore cached rustup-toolchain-install-master --- .appveyor.yml | 2 +- .travis.yml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.appveyor.yml b/.appveyor.yml index 411b71cfca..1e1cb52584 100644 --- a/.appveyor.yml +++ b/.appveyor.yml @@ -27,7 +27,7 @@ install: - rustup uninstall beta - rustup update # Install "master" toolchain - - cargo install rustup-toolchain-install-master & exit 0 + - cargo install rustup-toolchain-install-master -f - rustup-toolchain-install-master -f -n master %RUSTC_HASH% -c rust-src -c rustc-dev - rustup default master - rustc --version diff --git a/.travis.yml b/.travis.yml index 1b06f2e2db..c2fe32423c 100644 --- a/.travis.yml +++ b/.travis.yml @@ -37,7 +37,7 @@ before_script: - rustup uninstall beta - rustup update # Install "master" toolchain -- cargo install rustup-toolchain-install-master || echo "rustup-toolchain-install-master already installed" +- cargo install rustup-toolchain-install-master -f - travis_retry rustup-toolchain-install-master -f -n master $RUSTC_HASH -c rust-src -c rustc-dev - rustup default master - rustc --version From 8e83c0148e4a5dd0628d934372cc151ef477b0ae Mon Sep 17 00:00:00 2001 From: Ralf Jung Date: Sat, 12 Oct 2019 17:46:31 +0200 Subject: [PATCH 4/4] better debugging of cmd failures --- src/bin/cargo-miri.rs | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/bin/cargo-miri.rs b/src/bin/cargo-miri.rs index 43e8761d48..ebff26f647 100644 --- a/src/bin/cargo-miri.rs +++ b/src/bin/cargo-miri.rs @@ -137,7 +137,11 @@ fn test_sysroot_consistency() { let stdout = String::from_utf8(out.stdout).expect("stdout is not valid UTF-8"); let stderr = String::from_utf8(out.stderr).expect("stderr is not valid UTF-8"); let stdout = stdout.trim(); - assert!(out.status.success(), "Bad status code when getting sysroot info.\nstdout:\n{}\nstderr:\n{}", stdout, stderr); + assert!( + out.status.success(), + "Bad status code when getting sysroot info via {:?}.\nstdout:\n{}\nstderr:\n{}", + cmd, stdout, stderr, + ); PathBuf::from(stdout).canonicalize() .unwrap_or_else(|_| panic!("Failed to canonicalize sysroot: {}", stdout)) }