1
Fork 0

Update docs to match

Co-authored-by: Ralf Jung <post@ralfj.de>
This commit is contained in:
Ben Kimock 2023-03-13 17:49:20 -04:00
parent ca9d50982d
commit 3ff7d3da54
2 changed files with 7 additions and 10 deletions

View file

@ -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

View file

@ -6,8 +6,8 @@ USAGE=$(cat <<"EOF"
./miri install <flags>:
Installs the miri driver and cargo-miri. <flags> 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 <flags>:
Just build miri. <flags> 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" "$@"
;;