From 3ff7d3da54a45e8709fa056d07cb538e1297731a Mon Sep 17 00:00:00 2001 From: Ben Kimock Date: Mon, 13 Mar 2023 17:49:20 -0400 Subject: [PATCH] Update docs to match Co-authored-by: Ralf Jung --- src/tools/miri/CONTRIBUTING.md | 11 ++++------- src/tools/miri/miri | 6 +++--- 2 files changed, 7 insertions(+), 10 deletions(-) diff --git a/src/tools/miri/CONTRIBUTING.md b/src/tools/miri/CONTRIBUTING.md index 476075e9c914..bcdb623b090e 100644 --- a/src/tools/miri/CONTRIBUTING.md +++ b/src/tools/miri/CONTRIBUTING.md @@ -129,18 +129,15 @@ development version of Miri using ./miri install ``` -and then you can use it as if it was installed by `rustup`. Make sure you use -the same toolchain when calling `cargo miri` that you used when installing Miri! -Usually this means you have to write `cargo +miri miri ...` to select the `miri` -toolchain that was installed by `./miri toolchain`. +and then you can use it as if it was installed by `rustup` as a component of the +`miri` toolchain. Note that the `miri` and `cargo-miri` executables are placed +in the `miri` toolchain's sysroot to prevent conflicts with other toolchains. +The Miri binaries in the `cargo` bin directory (usually `~/.cargo/bin`) are managed by rustup. There's a test for the cargo wrapper in the `test-cargo-miri` directory; run `./run-test.py` in there to execute it. Like `./miri test`, this respects the `MIRI_TEST_TARGET` environment variable to execute the test for another target. -Note that installing Miri like this will "take away" Miri management from `rustup`. -If you want to later go back to a rustup-installed Miri, run `rustup update`. - ### Using a modified standard library Miri re-builds the standard library into a custom sysroot, so it is fairly easy diff --git a/src/tools/miri/miri b/src/tools/miri/miri index 998e0d295243..1073ff499ba0 100755 --- a/src/tools/miri/miri +++ b/src/tools/miri/miri @@ -6,8 +6,8 @@ USAGE=$(cat <<"EOF" ./miri install : Installs the miri driver and cargo-miri. are passed to `cargo install`. Sets up the rpath such that the installed binary should work in any -working directory. However, the rustup toolchain when invoking `cargo miri` -needs to be the same one used for `./miri install`. +working directory. Note that the binaries are placed in the `miri` toolchain +sysroot, to prevent conflicts with other toolchains. ./miri build : Just build miri. are passed to `cargo build`. @@ -281,7 +281,7 @@ find_sysroot() { case "$COMMAND" in install) # "--locked" to respect the Cargo.lock file if it exists. - # Install binaries to the miri toolchain's sysroot so they do not interact with other toolchains + # Install binaries to the miri toolchain's sysroot so they do not interact with other toolchains. $CARGO install $CARGO_EXTRA_FLAGS --path "$MIRIDIR" --force --locked --root "$SYSROOT" "$@" $CARGO install $CARGO_EXTRA_FLAGS --path "$MIRIDIR"/cargo-miri --force --locked --root "$SYSROOT" "$@" ;;