Skip to content

Commit 38111b3

Browse files
committed
Auto merge of rust-lang#2137 - RalfJung:targets, r=oli-obk
explain which targets we support to what extent This is basically documenting my policy so far: Linux is the target I know best and can spend most time on. Apple is so close to Linux that it can basically ride along without much extra work. I don't have a lot of time to spend on our Windows support. Of course, if people commit to contributing and maintaining support for a target, we can promise more than what is documented here. :) But this is what I am willing to promise. Also reduce the amount of work we do on the Windows test runner, since that one currently takes 10min longer than the other two. r? `@oli-obk`
2 parents b96610b + b4089a7 commit 38111b3

File tree

3 files changed

+26
-3
lines changed

3 files changed

+26
-3
lines changed

.github/workflows/ci.yml

+2-1
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,8 @@ jobs:
5656
~/.cargo/git/db
5757
# contains package information of crates installed via `cargo install`.
5858
~/.cargo/.crates.toml
59-
key: ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.lock') }}
59+
~/.cargo/.crates2.json
60+
key: ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.lock') }}-xargo0.3.25
6061
restore-keys: ${{ runner.os }}-cargo
6162

6263
- name: Install rustup-toolchain-install-master and xargo

README.md

+24-1
Original file line numberDiff line numberDiff line change
@@ -194,6 +194,28 @@ for seed in $({ echo obase=16; seq 255; } | bc); do
194194
done
195195
```
196196

197+
### Supported targets
198+
199+
Miri does not support all targets supported by Rust. The good news, however, is
200+
that no matter your host OS/platform, it is easy to run code for *any* target
201+
using `--target`!
202+
203+
The following targets are tested on CI and thus should always work (to the
204+
degree documented below):
205+
206+
- The best-supported target is `x86_64-unknown-linux-gnu`. Miri releases are
207+
blocked on things working with this target. Most other Linux targets should
208+
also work well; we do run the test suite on `i686-unknown-linux-gnu` as a
209+
32bit target and `mips64-unknown-linux-gnuabi64` as a big-endian target.
210+
- `x86_64-apple-darwin` should work basically as well as Linux. We also test
211+
`aarch64-apple-darwin`. However, we might ship Miri with a nightly even when
212+
some features on these targets regress.
213+
- `x86_64-pc-windows-msvc` works, but supports fewer features than the Linux and
214+
Apple targets. For example, file system access and concurrency are not
215+
supported on Windows. We also test `i686-pc-windows-msvc`, with the same
216+
reduced feature set. We might ship Miri with a nightly even when some features
217+
on these targets regress.
218+
197219
### Common Problems
198220

199221
When using the above instructions, you may encounter a number of confusing compiler
@@ -236,7 +258,8 @@ up the sysroot. If you are using `miri` (the Miri driver) directly, see the
236258
[miri-flags]: #miri--z-flags-and-environment-variables
237259

238260
Miri adds its own set of `-Z` flags, which are usually set via the `MIRIFLAGS`
239-
environment variable:
261+
environment variable. Some of these are **unsound**, which means they can lead
262+
to Miri failing to detect cases of undefined behavior in a program.
240263

241264
* `-Zmiri-check-number-validity` enables checking of integer and float validity
242265
(e.g., they must be initialized and not carry pointer provenance) as part of

ci.sh

-1
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,6 @@ case $HOST_TARGET in
5555
;;
5656
i686-pc-windows-msvc)
5757
MIRI_TEST_TARGET=x86_64-unknown-linux-gnu run_tests
58-
MIRI_TEST_TARGET=x86_64-apple-darwin run_tests
5958
;;
6059
*)
6160
echo "FATAL: unknown OS"

0 commit comments

Comments
 (0)