Skip to content

miri subtree update #144536

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 36 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
36 commits
Select commit Hold shift + click to select a range
8acdee7
don't halt execution when we write to a read-only file
RalfJung Jul 19, 2025
d3fc02c
non-deterministically truncate reads/writes
RalfJung Jul 19, 2025
72ba7c5
Preparing for merge from rustc
Jul 21, 2025
a9d9759
Merge from rustc
Jul 21, 2025
8efbbe3
Merge pull request #4486 from rust-lang/rustup-2025-07-21
RalfJung Jul 21, 2025
03fe2a0
Merge pull request #4481 from RalfJung/read-write-truncate
oli-obk Jul 21, 2025
b7e07b9
Preparing for merge from rustc
Jul 22, 2025
d90efb2
Merge from rustc
Jul 22, 2025
0ab940d
Merge pull request #4487 from rust-lang/rustup-2025-07-22
oli-obk Jul 22, 2025
4362734
CI: add windows-arm runner
RalfJung Jul 19, 2025
d2fe496
Init josh-sync config file
Kobzol Jul 23, 2025
9aa0547
Remove Josh code from `miri-script`
Kobzol Jul 23, 2025
b65877a
Merge pull request #4479 from RalfJung/ci-win-arm
RalfJung Jul 23, 2025
6686228
Update `CONTRIBUTING.md`
Kobzol Jul 23, 2025
25b7007
Update CI workflow
Kobzol Jul 23, 2025
f0725a4
Remove Zulip API keys and use `set -x`
Kobzol Jul 23, 2025
ac74e1c
Merge pull request #4490 from Kobzol/use-josh-sync
RalfJung Jul 23, 2025
e8d0417
make the missing-MIR message more clear
RalfJung Jul 24, 2025
4686d3b
Merge pull request #4491 from RalfJung/missing-mir
RalfJung Jul 24, 2025
54482ad
Prepare for merging from rust-lang/rust
Jul 25, 2025
c893206
Merge ref 'b56aaec52bc0' from rust-lang/rust
Jul 25, 2025
672cfc8
fmt
Jul 25, 2025
dc8fc56
Fix cronjob Zulip message
Kobzol Jul 25, 2025
f249d89
Merge pull request #4493 from Kobzol/ci-fail-message
RalfJung Jul 25, 2025
7a91045
Use i64 for tracing chrome "id"
Stypox Jul 22, 2025
1b7282f
Fix missing $ in enter_trace_span!
Stypox Jul 22, 2025
0cb9420
Fix double "fatal error: " in message
Stypox Jul 22, 2025
1a1f484
fix target json
RalfJung Jul 25, 2025
83ded8f
Merge pull request #4492 from rust-lang/rustup-2025-07-25
RalfJung Jul 25, 2025
7b670f4
Merge pull request #4489 from Stypox/misc-tracing-fixes
RalfJung Jul 25, 2025
386b185
CI: run apt update before installing anything
RalfJung Jul 26, 2025
94ce66d
Merge pull request #4494 from RalfJung/ci
RalfJung Jul 26, 2025
ddaff80
call_function helper: dont ICE on return type mismatches
RalfJung Jul 27, 2025
812d9ad
Merge pull request #4496 from RalfJung/ctor-ret-type
RalfJung Jul 27, 2025
20714f7
introduce a macro for shim signature checking
RalfJung Jul 27, 2025
4103c54
Merge pull request #4497 from RalfJung/check-shim
RalfJung Jul 27, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
51 changes: 38 additions & 13 deletions src/tools/miri/.github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -45,11 +45,17 @@ jobs:
os: macos-latest
- host_target: i686-pc-windows-msvc
os: windows-latest
- host_target: aarch64-pc-windows-msvc
os: windows-11-arm
runs-on: ${{ matrix.os }}
env:
HOST_TARGET: ${{ matrix.host_target }}
steps:
- uses: actions/checkout@v4
- name: apt update
if: ${{ startsWith(matrix.os, 'ubuntu') }}
# The runners seem to have outdated apt repos sometimes
run: sudo apt update
- name: install qemu
if: ${{ matrix.qemu }}
run: sudo apt install qemu-user qemu-user-binfmt
Expand All @@ -63,6 +69,12 @@ jobs:
sudo apt update
# Install needed packages
sudo apt install $(echo "libatomic1: zlib1g-dev:" | sed 's/:/:${{ matrix.multiarch }}/g')
- name: Install rustup on Windows ARM
if: ${{ matrix.os == 'windows-11-arm' }}
run: |
curl -LOs https://static.rust-lang.org/rustup/dist/aarch64-pc-windows-msvc/rustup-init.exe
./rustup-init.exe -y --no-modify-path
echo "$USERPROFILE/.cargo/bin" >> "$GITHUB_PATH"
- uses: ./.github/workflows/setup
with:
toolchain_flags: "--host ${{ matrix.host_target }}"
Expand Down Expand Up @@ -147,35 +159,48 @@ jobs:
- uses: actions/checkout@v4
with:
fetch-depth: 256 # get a bit more of the history
- name: install josh-proxy
run: cargo +stable install josh-proxy --git https://github.com/josh-project/josh --tag r24.10.04
- name: install josh-sync
run: cargo +stable install --locked --git https://github.com/rust-lang/josh-sync
- name: setup bot git name and email
run: |
git config --global user.name 'The Miri Cronjob Bot'
git config --global user.email '[email protected]'
- name: Install nightly toolchain
run: rustup toolchain install nightly --profile minimal
- name: get changes from rustc
run: ./miri rustc-pull
- name: Install rustup-toolchain-install-master
run: cargo install -f rustup-toolchain-install-master
- name: format changes (if any)
- name: Push changes to a branch and create PR
run: |
# Make it easier to see what happens.
set -x
# Temporarily disable early exit to examine the status code of rustc-josh-sync
set +e
rustc-josh-sync pull
exitcode=$?
set -e

# If there were no changes to pull, rustc-josh-sync returns status code 2.
# In that case, skip the rest of the job.
if [ $exitcode -eq 2 ]; then
echo "Nothing changed in rustc, skipping PR"
exit 0
elif [ $exitcode -ne 0 ]; then
# If return code was not 0 or 2, rustc-josh-sync actually failed
echo "error: rustc-josh-sync failed"
exit ${exitcode}
fi

# Format changes
./miri toolchain
./miri fmt --check || (./miri fmt && git commit -am "fmt")
- name: Push changes to a branch and create PR
run: |
# `git diff --exit-code` "succeeds" if the diff is empty.
if git diff --exit-code HEAD^; then echo "Nothing changed in rustc, skipping PR"; exit 0; fi
# The diff is non-empty, create a PR.

# Create a PR
BRANCH="rustup-$(date -u +%Y-%m-%d)"
git switch -c $BRANCH
git push -u origin $BRANCH
gh pr create -B master --title 'Automatic Rustup' --body 'Please close and re-open this PR to trigger CI, then enable auto-merge.'
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
ZULIP_BOT_EMAIL: ${{ secrets.ZULIP_BOT_EMAIL }}
ZULIP_API_TOKEN: ${{ secrets.ZULIP_API_TOKEN }}

cron-fail-notify:
name: cronjob failure notification
Expand All @@ -198,7 +223,7 @@ jobs:
It would appear that the [Miri cron job build]('"https://github.com/$GITHUB_REPOSITORY/actions/runs/$GITHUB_RUN_ID"') failed.

This likely means that rustc changed the miri directory and
we now need to do a [`./miri rustc-pull`](https://github.com/rust-lang/miri/blob/master/CONTRIBUTING.md#importing-changes-from-the-rustc-repo).
we now need to do a [`rustc-josh-sync pull`](https://github.com/rust-lang/miri/blob/master/CONTRIBUTING.md#importing-changes-from-the-rustc-repo).

Would you mind investigating this issue?

Expand Down
14 changes: 8 additions & 6 deletions src/tools/miri/CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -297,25 +297,27 @@ You can also directly run Miri on a Rust source file:

## Advanced topic: Syncing with the rustc repo

We use the [`josh` proxy](https://github.com/josh-project/josh) to transmit changes between the
We use the [`josh-sync`](https://github.com/rust-lang/josh-sync) tool to transmit changes between the
rustc and Miri repositories. You can install it as follows:

```sh
cargo +stable install josh-proxy --git https://github.com/josh-project/josh --tag r24.10.04
cargo install --locked --git https://github.com/rust-lang/josh-sync
```

Josh will automatically be started and stopped by `./miri`.
The commands below will automatically install and manage the [Josh](https://github.com/josh-project/josh) proxy that performs the actual work.

### Importing changes from the rustc repo

*Note: this usually happens automatically, so these steps rarely have to be done by hand.*

We assume we start on an up-to-date master branch in the Miri repo.

1) First, create a branch for the pull, e.g. `git checkout -b rustup`
2) Then run the following:
```sh
# Fetch and merge rustc side of the history. Takes ca 5 min the first time.
# This will also update the `rustc-version` file.
./miri rustc-pull
rustc-josh-sync pull
# Update local toolchain and apply formatting.
./miri toolchain && ./miri fmt
git commit -am "rustup"
Expand All @@ -328,12 +330,12 @@ needed.

### Exporting changes to the rustc repo

We will use the josh proxy to push to your fork of rustc. Run the following in the Miri repo,
We will use the `josh-sync` tool to push to your fork of rustc. Run the following in the Miri repo,
assuming we are on an up-to-date master branch:

```sh
# Push the Miri changes to your rustc fork (substitute your github handle for YOUR_NAME).
./miri rustc-push YOUR_NAME miri
rustc-josh-sync push miri YOUR_NAME
```

This will create a new branch called `miri` in your fork, and the output should include a link that
Expand Down
8 changes: 4 additions & 4 deletions src/tools/miri/cargo-miri/src/phases.rs
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
//! Implements the various phases of `cargo miri run/test`.

use std::env;
use std::fs::{self, File};
use std::fs::File;
use std::io::BufReader;
use std::path::{Path, PathBuf};
use std::path::{self, Path, PathBuf};
use std::process::Command;

use rustc_version::VersionMeta;
Expand Down Expand Up @@ -222,12 +222,12 @@ pub fn phase_cargo_miri(mut args: impl Iterator<Item = String>) {
// that to be the Miri driver, but acting as rustc, in host mode.
//
// In `main`, we need the value of `RUSTC` to distinguish RUSTC_WRAPPER invocations from rustdoc
// or TARGET_RUNNER invocations, so we canonicalize it here to make it exceedingly unlikely that
// or TARGET_RUNNER invocations, so we make it absolute to make it exceedingly unlikely that
// there would be a collision with other invocations of cargo-miri (as rustdoc or as runner). We
// explicitly do this even if RUSTC_STAGE is set, since for these builds we do *not* want the
// bootstrap `rustc` thing in our way! Instead, we have MIRI_HOST_SYSROOT to use for host
// builds.
cmd.env("RUSTC", fs::canonicalize(find_miri()).unwrap());
cmd.env("RUSTC", path::absolute(find_miri()).unwrap());
// In case we get invoked as RUSTC without the wrapper, let's be a host rustc. This makes no
// sense for cross-interpretation situations, but without the wrapper, this will use the host
// sysroot, so asking it to behave like a target build makes even less sense.
Expand Down
12 changes: 8 additions & 4 deletions src/tools/miri/ci/ci.sh
Original file line number Diff line number Diff line change
Expand Up @@ -142,7 +142,6 @@ case $HOST_TARGET in
# Host
GC_STRESS=1 MIR_OPT=1 MANY_SEEDS=64 TEST_BENCH=1 CARGO_MIRI_ENV=1 run_tests
# Extra tier 1
MANY_SEEDS=64 TEST_TARGET=i686-unknown-linux-gnu run_tests
MANY_SEEDS=64 TEST_TARGET=x86_64-apple-darwin run_tests
MANY_SEEDS=64 TEST_TARGET=x86_64-pc-windows-gnu run_tests
;;
Expand All @@ -161,8 +160,6 @@ case $HOST_TARGET in
aarch64-unknown-linux-gnu)
# Host
GC_STRESS=1 MIR_OPT=1 MANY_SEEDS=64 TEST_BENCH=1 CARGO_MIRI_ENV=1 run_tests
# Extra tier 1 candidate
MANY_SEEDS=64 TEST_TARGET=aarch64-pc-windows-msvc run_tests
# Extra tier 2
MANY_SEEDS=16 TEST_TARGET=arm-unknown-linux-gnueabi run_tests # 32bit ARM
MANY_SEEDS=16 TEST_TARGET=aarch64-pc-windows-gnullvm run_tests # gnullvm ABI
Expand All @@ -189,13 +186,20 @@ case $HOST_TARGET in
;;
i686-pc-windows-msvc)
# Host
# Without GC_STRESS as this is the slowest runner.
# Without GC_STRESS as this is a very slow runner.
MIR_OPT=1 MANY_SEEDS=64 TEST_BENCH=1 run_tests
# Extra tier 1
# We really want to ensure a Linux target works on a Windows host,
# and a 64bit target works on a 32bit host.
TEST_TARGET=x86_64-unknown-linux-gnu run_tests
;;
aarch64-pc-windows-msvc)
# Host
# Without GC_STRESS as this is a very slow runner.
MIR_OPT=1 MANY_SEEDS=64 TEST_BENCH=1 CARGO_MIRI_ENV=1 run_tests
# Extra tier 1
MANY_SEEDS=64 TEST_TARGET=i686-unknown-linux-gnu run_tests
;;
*)
echo "FATAL: unknown host target: $HOST_TARGET"
exit 1
Expand Down
2 changes: 2 additions & 0 deletions src/tools/miri/josh-sync.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
repo = "miri"
filter = ":rev(75dd959a3a40eb5b4574f8d2e23aa6efbeb33573:prefix=src/tools/miri):/src/tools/miri"
90 changes: 2 additions & 88 deletions src/tools/miri/miri-script/Cargo.lock
Original file line number Diff line number Diff line change
Expand Up @@ -116,27 +116,6 @@ version = "1.0.4"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "b05b61dc5112cbb17e4b6cd61790d9845d13888356391624cbe7e41efeac1e75"

[[package]]
name = "directories"
version = "6.0.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "16f5094c54661b38d03bd7e50df373292118db60b585c08a411c6d840017fe7d"
dependencies = [
"dirs-sys",
]

[[package]]
name = "dirs-sys"
version = "0.5.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "e01a3366d27ee9890022452ee61b2b63a67e6f13f58900b651ff5665f0bb1fab"
dependencies = [
"libc",
"option-ext",
"redox_users",
"windows-sys 0.60.2",
]

[[package]]
name = "dunce"
version = "1.0.5"
Expand Down Expand Up @@ -165,17 +144,6 @@ version = "2.3.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "37909eebbb50d72f9059c3b6d82c0463f2ff062c9e95845c43a6c9c0355411be"

[[package]]
name = "getrandom"
version = "0.2.16"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "335ff9f135e4384c8150d6f27c6daed433577f86b4750418338c01a1a2528592"
dependencies = [
"cfg-if",
"libc",
"wasi 0.11.1+wasi-snapshot-preview1",
]

[[package]]
name = "getrandom"
version = "0.3.3"
Expand All @@ -185,7 +153,7 @@ dependencies = [
"cfg-if",
"libc",
"r-efi",
"wasi 0.14.2+wasi-0.2.4",
"wasi",
]

[[package]]
Expand Down Expand Up @@ -221,16 +189,6 @@ version = "0.2.174"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "1171693293099992e19cddea4e8b849964e9846f4acee11b3948bcc337be8776"

[[package]]
name = "libredox"
version = "0.1.4"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "1580801010e535496706ba011c15f8532df6b42297d2e471fec38ceadd8c0638"
dependencies = [
"bitflags",
"libc",
]

[[package]]
name = "linux-raw-sys"
version = "0.9.4"
Expand All @@ -249,7 +207,6 @@ version = "0.1.0"
dependencies = [
"anyhow",
"clap",
"directories",
"dunce",
"itertools",
"path_macro",
Expand All @@ -275,12 +232,6 @@ version = "1.70.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "a4895175b425cb1f87721b59f0f286c2092bd4af812243672510e1ac53e2e0ad"

[[package]]
name = "option-ext"
version = "0.2.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "04744f49eae99ab78e0d5c0b603ab218f515ea8cfe5a456d7629ad883a3b6e7d"

[[package]]
name = "path_macro"
version = "1.0.0"
Expand Down Expand Up @@ -311,17 +262,6 @@ version = "5.3.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "69cdb34c158ceb288df11e18b4bd39de994f6657d83847bdffdbd7f346754b0f"

[[package]]
name = "redox_users"
version = "0.5.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "dd6f9d3d47bdd2ad6945c5015a226ec6155d0bcdfd8f7cd29f86b71f8de99d2b"
dependencies = [
"getrandom 0.2.16",
"libredox",
"thiserror",
]

[[package]]
name = "rustc_version"
version = "0.4.1"
Expand Down Expand Up @@ -427,32 +367,12 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "e8a64e3985349f2441a1a9ef0b853f869006c3855f2cda6862a94d26ebb9d6a1"
dependencies = [
"fastrand",
"getrandom 0.3.3",
"getrandom",
"once_cell",
"rustix",
"windows-sys 0.59.0",
]

[[package]]
name = "thiserror"
version = "2.0.12"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "567b8a2dae586314f7be2a752ec7474332959c6460e02bde30d702a66d488708"
dependencies = [
"thiserror-impl",
]

[[package]]
name = "thiserror-impl"
version = "2.0.12"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "7f7cf42b4507d8ea322120659672cf1b9dbb93f8f2d4ecfd6e51350ff5b17a1d"
dependencies = [
"proc-macro2",
"quote",
"syn",
]

[[package]]
name = "unicode-ident"
version = "1.0.18"
Expand All @@ -475,12 +395,6 @@ dependencies = [
"winapi-util",
]

[[package]]
name = "wasi"
version = "0.11.1+wasi-snapshot-preview1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "ccf3ec651a847eb01de73ccad15eb7d99f80485de043efb2f370cd654f4ea44b"

[[package]]
name = "wasi"
version = "0.14.2+wasi-0.2.4"
Expand Down
1 change: 0 additions & 1 deletion src/tools/miri/miri-script/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,6 @@ anyhow = "1.0"
xshell = "0.2.6"
rustc_version = "0.4"
dunce = "1.0.4"
directories = "6"
serde = "1"
serde_json = "1"
serde_derive = "1"
Expand Down
Loading
Loading