Skip to content

Commit 8426723

Browse files
committed
Auto merge of #154582 - RalfJung:miri, r=RalfJung
miri subtree update Subtree update of `miri` to rust-lang/miri@7662148. Created using https://github.com/rust-lang/josh-sync. r? @ghost
2 parents 08cd08f + 79d00db commit 8426723

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

46 files changed

+897
-241
lines changed

‎Cargo.lock‎

Lines changed: 41 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -3421,14 +3421,14 @@ dependencies = [
34213421

34223422
[[package]]
34233423
name = "rustc-build-sysroot"
3424-
version = "0.5.11"
3424+
version = "0.5.12"
34253425
source = "registry+https://github.com/rust-lang/crates.io-index"
3426-
checksum = "3b881c015c729b43105bbd3702a9bdecee28fafaa21126d1d62e454ec011a4b7"
3426+
checksum = "eec3905e8201688412f6f4b1f6c86d38b3ee6578f59ba85f41330a3af61e8365"
34273427
dependencies = [
34283428
"anyhow",
34293429
"rustc_version",
34303430
"tempfile",
3431-
"toml 0.8.23",
3431+
"toml 1.1.0+spec-1.1.0",
34323432
"walkdir",
34333433
]
34343434

@@ -5195,9 +5195,9 @@ dependencies = [
51955195

51965196
[[package]]
51975197
name = "serde_spanned"
5198-
version = "1.0.3"
5198+
version = "1.1.0"
51995199
source = "registry+https://github.com/rust-lang/crates.io-index"
5200-
checksum = "e24345aa0fe688594e73770a5f6d1b216508b4f93484c0026d521acd30134392"
5200+
checksum = "876ac351060d4f882bb1032b6369eb0aef79ad9df1ea8bc404874d8cc3d0cd98"
52015201
dependencies = [
52025202
"serde_core",
52035203
]
@@ -5693,7 +5693,6 @@ version = "0.8.23"
56935693
source = "registry+https://github.com/rust-lang/crates.io-index"
56945694
checksum = "dc1beb996b9d83529a9e75c17a1686767d148d70663143c7854d8b4a09ced362"
56955695
dependencies = [
5696-
"indexmap",
56975696
"serde",
56985697
"serde_spanned 0.6.9",
56995698
"toml_datetime 0.6.11",
@@ -5708,13 +5707,28 @@ checksum = "f0dc8b1fb61449e27716ec0e1bdf0f6b8f3e8f6b05391e8497b8b6d7804ea6d8"
57085707
dependencies = [
57095708
"indexmap",
57105709
"serde_core",
5711-
"serde_spanned 1.0.3",
5710+
"serde_spanned 1.1.0",
57125711
"toml_datetime 0.7.3",
57135712
"toml_parser",
57145713
"toml_writer",
57155714
"winnow 0.7.13",
57165715
]
57175716

5717+
[[package]]
5718+
name = "toml"
5719+
version = "1.1.0+spec-1.1.0"
5720+
source = "registry+https://github.com/rust-lang/crates.io-index"
5721+
checksum = "f8195ca05e4eb728f4ba94f3e3291661320af739c4e43779cbdfae82ab239fcc"
5722+
dependencies = [
5723+
"indexmap",
5724+
"serde_core",
5725+
"serde_spanned 1.1.0",
5726+
"toml_datetime 1.1.0+spec-1.1.0",
5727+
"toml_parser",
5728+
"toml_writer",
5729+
"winnow 1.0.0",
5730+
]
5731+
57185732
[[package]]
57195733
name = "toml_datetime"
57205734
version = "0.6.11"
@@ -5733,6 +5747,15 @@ dependencies = [
57335747
"serde_core",
57345748
]
57355749

5750+
[[package]]
5751+
name = "toml_datetime"
5752+
version = "1.1.0+spec-1.1.0"
5753+
source = "registry+https://github.com/rust-lang/crates.io-index"
5754+
checksum = "97251a7c317e03ad83774a8752a7e81fb6067740609f75ea2b585b569a59198f"
5755+
dependencies = [
5756+
"serde_core",
5757+
]
5758+
57365759
[[package]]
57375760
name = "toml_edit"
57385761
version = "0.19.15"
@@ -5762,11 +5785,11 @@ dependencies = [
57625785

57635786
[[package]]
57645787
name = "toml_parser"
5765-
version = "1.0.4"
5788+
version = "1.1.0+spec-1.1.0"
57665789
source = "registry+https://github.com/rust-lang/crates.io-index"
5767-
checksum = "c0cbe268d35bdb4bb5a56a2de88d0ad0eb70af5384a99d648cd4b3d04039800e"
5790+
checksum = "2334f11ee363607eb04df9b8fc8a13ca1715a72ba8662a26ac285c98aabb4011"
57685791
dependencies = [
5769-
"winnow 0.7.13",
5792+
"winnow 1.0.0",
57705793
]
57715794

57725795
[[package]]
@@ -5777,9 +5800,9 @@ checksum = "5d99f8c9a7727884afe522e9bd5edbfc91a3312b36a77b5fb8926e4c31a41801"
57775800

57785801
[[package]]
57795802
name = "toml_writer"
5780-
version = "1.0.4"
5803+
version = "1.1.0+spec-1.1.0"
57815804
source = "registry+https://github.com/rust-lang/crates.io-index"
5782-
checksum = "df8b2b54733674ad286d16267dcfc7a71ed5c776e4ac7aa3c3e2561f7c637bf2"
5805+
checksum = "d282ade6016312faf3e41e57ebbba0c073e4056dab1232ab1cb624199648f8ed"
57835806

57845807
[[package]]
57855808
name = "tracing"
@@ -6765,6 +6788,12 @@ dependencies = [
67656788
"memchr",
67666789
]
67676790

6791+
[[package]]
6792+
name = "winnow"
6793+
version = "1.0.0"
6794+
source = "registry+https://github.com/rust-lang/crates.io-index"
6795+
checksum = "a90e88e4667264a994d34e6d1ab2d26d398dcdca8b7f52bec8668957517fc7d8"
6796+
67686797
[[package]]
67696798
name = "winsplit"
67706799
version = "0.1.0"

‎src/tools/miri/.github/workflows/ci.yml‎

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ jobs:
5858
env:
5959
HOST_TARGET: ${{ matrix.host_target }}
6060
steps:
61-
- uses: actions/checkout@v4
61+
- uses: actions/checkout@v5
6262
- name: install multiarch
6363
if: ${{ matrix.multiarch != '' }}
6464
run: |
@@ -105,7 +105,7 @@ jobs:
105105
name: style checks
106106
runs-on: ubuntu-latest
107107
steps:
108-
- uses: actions/checkout@v4
108+
- uses: actions/checkout@v5
109109
- uses: ./.github/workflows/setup
110110

111111
- name: rustfmt
@@ -121,7 +121,7 @@ jobs:
121121
name: bootstrap build
122122
runs-on: ubuntu-latest
123123
steps:
124-
- uses: actions/checkout@v4
124+
- uses: actions/checkout@v5
125125
# Deliberately skipping `./.github/workflows/setup` as we do our own setup
126126
- name: Add cache for cargo
127127
id: cache
@@ -156,7 +156,7 @@ jobs:
156156
name: coverage report
157157
runs-on: ubuntu-latest
158158
steps:
159-
- uses: actions/checkout@v4
159+
- uses: actions/checkout@v5
160160
- uses: ./.github/workflows/setup
161161
- name: coverage
162162
run: ./miri test --coverage
@@ -191,7 +191,7 @@ jobs:
191191
pull-requests: write
192192
if: ${{ github.event_name == 'schedule' }}
193193
steps:
194-
- uses: actions/checkout@v4
194+
- uses: actions/checkout@v5
195195
with:
196196
fetch-depth: 256 # get a bit more of the history
197197
- name: install josh-sync

‎src/tools/miri/CONTRIBUTING.md‎

Lines changed: 29 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -171,8 +171,8 @@ MIRI_LOG=rustc_mir::interpret=info,miri::stacked_borrows ./miri run tests/pass/v
171171
```
172172

173173
Note that you will only get `info`, `warn` or `error` messages if you use a prebuilt compiler.
174-
In order to get `debug` and `trace` level messages, you need to build miri with a locally built
175-
compiler that has `debug=true` set in `bootstrap.toml`.
174+
In order to get `debug` and `trace` level messages, you need to build miri with a [locally built
175+
compiler](#advanced-topic-building-miri-against-a-locally-compiled-rustc) that has `debug=true` set in `bootstrap.toml`.
176176

177177
#### Debugging error messages
178178

@@ -320,6 +320,33 @@ You can also directly run Miri on a Rust source file:
320320
./x.py run miri --stage 1 --args src/tools/miri/tests/pass/hello.rs
321321
```
322322

323+
## Advanced topic: Building Miri against a locally compiled rustc
324+
325+
Very rarely, it can be necessary to work with an out-of-tree Miri but build it against a rustc that
326+
was locally compiled. (Usually, you should instead work on the Miri that's in the Rust tree, as
327+
described in the previous subsection.)
328+
329+
This requires a fully bootstrapped build:
330+
331+
```sh
332+
# Build rustc, then build rustc with that rustc. This can take a while.
333+
./x build library --stage 3
334+
```
335+
336+
You also need to set up a linked toolchain with rustup:
337+
338+
```sh
339+
rustup toolchain link stage2 build/host/stage2
340+
```
341+
342+
Then in the Miri folder, you can set this as the current toolchain and build against it:
343+
344+
```sh
345+
rustup override set stage2
346+
# Prevent `./miri` from reseting the toolchain.
347+
export MIRI_AUTO_OPS=no
348+
```
349+
323350
## Advanced topic: Syncing with the rustc repo
324351

325352
We use the [`josh-sync`](https://github.com/rust-lang/josh-sync) tool to transmit changes between the

‎src/tools/miri/cargo-miri/Cargo.lock‎

Lines changed: 22 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -230,9 +230,9 @@ dependencies = [
230230

231231
[[package]]
232232
name = "rustc-build-sysroot"
233-
version = "0.5.11"
233+
version = "0.5.12"
234234
source = "registry+https://github.com/rust-lang/crates.io-index"
235-
checksum = "3b881c015c729b43105bbd3702a9bdecee28fafaa21126d1d62e454ec011a4b7"
235+
checksum = "eec3905e8201688412f6f4b1f6c86d38b3ee6578f59ba85f41330a3af61e8365"
236236
dependencies = [
237237
"anyhow",
238238
"rustc_version",
@@ -339,11 +339,11 @@ dependencies = [
339339

340340
[[package]]
341341
name = "serde_spanned"
342-
version = "0.6.9"
342+
version = "1.1.0"
343343
source = "registry+https://github.com/rust-lang/crates.io-index"
344-
checksum = "bf41e0cfaf7226dca15e8197172c295a782857fcb97fad1808a166870dee75a3"
344+
checksum = "876ac351060d4f882bb1032b6369eb0aef79ad9df1ea8bc404874d8cc3d0cd98"
345345
dependencies = [
346-
"serde",
346+
"serde_core",
347347
]
348348

349349
[[package]]
@@ -392,45 +392,42 @@ dependencies = [
392392

393393
[[package]]
394394
name = "toml"
395-
version = "0.8.23"
395+
version = "1.1.0+spec-1.1.0"
396396
source = "registry+https://github.com/rust-lang/crates.io-index"
397-
checksum = "dc1beb996b9d83529a9e75c17a1686767d148d70663143c7854d8b4a09ced362"
397+
checksum = "f8195ca05e4eb728f4ba94f3e3291661320af739c4e43779cbdfae82ab239fcc"
398398
dependencies = [
399399
"indexmap",
400-
"serde",
400+
"serde_core",
401401
"serde_spanned",
402402
"toml_datetime",
403-
"toml_edit",
403+
"toml_parser",
404+
"toml_writer",
405+
"winnow",
404406
]
405407

406408
[[package]]
407409
name = "toml_datetime"
408-
version = "0.6.11"
410+
version = "1.1.0+spec-1.1.0"
409411
source = "registry+https://github.com/rust-lang/crates.io-index"
410-
checksum = "22cddaf88f4fbc13c51aebbf5f8eceb5c7c5a9da2ac40a13519eb5b0a0e8f11c"
412+
checksum = "97251a7c317e03ad83774a8752a7e81fb6067740609f75ea2b585b569a59198f"
411413
dependencies = [
412-
"serde",
414+
"serde_core",
413415
]
414416

415417
[[package]]
416-
name = "toml_edit"
417-
version = "0.22.27"
418+
name = "toml_parser"
419+
version = "1.1.0+spec-1.1.0"
418420
source = "registry+https://github.com/rust-lang/crates.io-index"
419-
checksum = "41fe8c660ae4257887cf66394862d21dbca4a6ddd26f04a3560410406a2f819a"
421+
checksum = "2334f11ee363607eb04df9b8fc8a13ca1715a72ba8662a26ac285c98aabb4011"
420422
dependencies = [
421-
"indexmap",
422-
"serde",
423-
"serde_spanned",
424-
"toml_datetime",
425-
"toml_write",
426423
"winnow",
427424
]
428425

429426
[[package]]
430-
name = "toml_write"
431-
version = "0.1.2"
427+
name = "toml_writer"
428+
version = "1.1.0+spec-1.1.0"
432429
source = "registry+https://github.com/rust-lang/crates.io-index"
433-
checksum = "5d99f8c9a7727884afe522e9bd5edbfc91a3312b36a77b5fb8926e4c31a41801"
430+
checksum = "d282ade6016312faf3e41e57ebbba0c073e4056dab1232ab1cb624199648f8ed"
434431

435432
[[package]]
436433
name = "unicode-ident"
@@ -489,12 +486,9 @@ dependencies = [
489486

490487
[[package]]
491488
name = "winnow"
492-
version = "0.7.13"
489+
version = "1.0.0"
493490
source = "registry+https://github.com/rust-lang/crates.io-index"
494-
checksum = "21a0236b59786fed61e2a80582dd500fe61f18b5dca67a4a067d0bc9039339cf"
495-
dependencies = [
496-
"memchr",
497-
]
491+
checksum = "a90e88e4667264a994d34e6d1ab2d26d398dcdca8b7f52bec8668957517fc7d8"
498492

499493
[[package]]
500494
name = "wit-bindgen"

‎src/tools/miri/cargo-miri/Cargo.toml‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ directories = "6"
1818
rustc_version = "0.4"
1919
serde_json = "1.0.40"
2020
cargo_metadata = "0.23"
21-
rustc-build-sysroot = "0.5.10"
21+
rustc-build-sysroot = "0.5.12"
2222

2323
# Enable some feature flags that dev-dependencies need but dependencies
2424
# do not. This makes `./miri install` after `./miri build` faster.

‎src/tools/miri/ci/ci.sh‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,7 @@ begingroup "Building Miri"
2828
export RUSTFLAGS="-D warnings"
2929
export CARGO_INCREMENTAL=0
3030
export CARGO_EXTRA_FLAGS="--locked"
31+
export CARGO_UNSTABLE_BUILD_DIR_NEW_LAYOUT=true
3132

3233
# Determine configuration for installed build (used by test-cargo-miri and `./miri bench`).
3334
# We use the default set of features for this.

‎src/tools/miri/miri-script/src/commands.rs‎

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,7 @@ impl Command {
8080

8181
// `toolchain` goes first as it could affect the others
8282
if auto_toolchain {
83-
Self::toolchain(vec![])?;
83+
Self::toolchain(None, vec![])?;
8484
}
8585
if auto_fmt {
8686
Self::fmt(vec![])?;
@@ -121,15 +121,18 @@ impl Command {
121121
Command::Clippy { features, flags } => Self::clippy(features, flags),
122122
Command::Bench { target, no_install, save_baseline, load_baseline, benches } =>
123123
Self::bench(target, no_install, save_baseline, load_baseline, benches),
124-
Command::Toolchain { flags } => Self::toolchain(flags),
124+
Command::Toolchain { commit, flags } => Self::toolchain(commit, flags),
125125
Command::Squash => Self::squash(),
126126
}
127127
}
128128

129-
fn toolchain(flags: Vec<String>) -> Result<()> {
129+
fn toolchain(new_commit: Option<String>, flags: Vec<String>) -> Result<()> {
130130
let sh = Shell::new()?;
131131
sh.change_dir(miri_dir()?);
132-
let new_commit = sh.read_file("rust-version")?.trim().to_owned();
132+
let new_commit = match new_commit {
133+
Some(c) => c,
134+
None => sh.read_file("rust-version")?.trim().to_owned(),
135+
};
133136
let current_commit = {
134137
let rustc_info = cmd!(sh, "rustc +miri --version -v").read();
135138
if let Ok(rustc_info) = rustc_info {

‎src/tools/miri/miri-script/src/main.rs‎

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -138,6 +138,9 @@ pub enum Command {
138138
/// The `rust-version` file is used to determine the commit that will be intsalled.
139139
/// `rustup-toolchain-install-master` must be installed for this to work.
140140
Toolchain {
141+
/// Overwrite the commit to install.
142+
#[arg(long)]
143+
commit: Option<String>,
141144
/// Flags that are passed through to `rustup-toolchain-install-master`.
142145
#[arg(trailing_var_arg = true, allow_hyphen_values = true)]
143146
flags: Vec<String>,
@@ -157,8 +160,8 @@ impl Command {
157160
| Self::Build { flags, .. }
158161
| Self::Check { flags, .. }
159162
| Self::Doc { flags, .. }
160-
| Self::Fmt { flags }
161-
| Self::Toolchain { flags }
163+
| Self::Fmt { flags, .. }
164+
| Self::Toolchain { flags, .. }
162165
| Self::Clippy { flags, .. }
163166
| Self::Run { flags, .. }
164167
| Self::Test { flags, .. } => {

‎src/tools/miri/rust-version‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
fd0c901b00ee1e08a250039cdb90258603497e20
1+
116458d0a5ae01cd517cabd2d1aee7f5457018ab

0 commit comments

Comments
 (0)