Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Rustup for rustc-dev #984

Closed
wants to merge 4 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions .appveyor.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,8 @@ install:
- rustup uninstall beta
- 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
- 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
- cargo --version
Expand Down
4 changes: 2 additions & 2 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -37,8 +37,8 @@ before_script:
- rustup uninstall beta
- 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
- 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
- cargo --version
Expand Down
8 changes: 5 additions & 3 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
Expand Down
2 changes: 1 addition & 1 deletion rust-version
Original file line number Diff line number Diff line change
@@ -1 +1 @@
2748a9fd93dd1a00a4521f4f16de5befbf77f6cd
000d90b11f7be70ffb7812680f7abc6deb52ec88
6 changes: 5 additions & 1 deletion src/bin/cargo-miri.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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))
}
Expand Down