Skip to content

Commit e1b654f

Browse files
committed
mention cross-running in docs
1 parent d85f09c commit e1b654f

File tree

2 files changed

+11
-4
lines changed

2 files changed

+11
-4
lines changed

CONTRIBUTING.md

+6-4
Original file line numberDiff line numberDiff line change
@@ -52,18 +52,19 @@ all the same flags as `rustc` (though the ones only affecting code generation
5252
and linking obviously will have no effect) [and more][miri-flags].
5353

5454
Running the Miri driver requires some fiddling with environment variables, so
55-
the `miri` script helps you do that. For example, you can run the driver on a
56-
particular file by doing
55+
the `miri` script helps you do that. For example, you can (cross-)run the
56+
driver on a particular file by doing
5757

5858
```sh
5959
./miri run tests/run-pass/format.rs
6060
./miri run tests/run-pass/hello.rs --target i686-unknown-linux-gnu
6161
```
6262

63-
and you can run the test suite using:
63+
and you can (cross-)run the test suite using:
6464

6565
```
6666
./miri test
67+
MIRI_TEST_TARGET=i686-unknown-linux-gnu ./miri test
6768
```
6869

6970
`./miri test FILTER` only runs those tests that contain `FILTER` in their
@@ -104,7 +105,8 @@ and then you can use it as if it was installed by `rustup`. Make sure you use
104105
the same toolchain when calling `cargo miri` that you used when installing Miri!
105106

106107
There's a test for the cargo wrapper in the `test-cargo-miri` directory; run
107-
`./run-test.py` in there to execute it.
108+
`./run-test.py` in there to execute it. Like `./miri test`, this respects the
109+
`MIRI_TEST_TARGET` environment variable to execute the test for another target.
108110

109111
## Building Miri with a locally built rustc
110112

README.md

+5
Original file line numberDiff line numberDiff line change
@@ -76,6 +76,11 @@ Now you can run your project in Miri:
7676
The first time you run Miri, it will perform some extra setup and install some
7777
dependencies. It will ask you for confirmation before installing anything.
7878

79+
Miri supports cross-execution: if you want to run the program as if it was a
80+
Linux program, you can do `cargo miri run --target x86_64-unknown-linux-gnu`.
81+
This is particularly useful if you are using Windows, as the Linux target is
82+
much better supported than Windows targets.
83+
7984
You can pass arguments to Miri after the first `--`, and pass arguments to the
8085
interpreted program or test suite after the second `--`. For example, `cargo
8186
miri run -- -Zmiri-disable-validation` runs the program without validation of

0 commit comments

Comments
 (0)