Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
24 commits
Select commit Hold shift + click to select a range
d17ba8a
[Priroda] Rename `step` to `stepi` for single MIR instruction stepping
moabo3li Jun 8, 2026
bb0a187
[Priroda] Add step command to step through source lines
moabo3li Jun 8, 2026
8a7e1d7
Prepare for merging from rust-lang/rust
Jun 13, 2026
08177ea
Merge ref '4e391cf2425c' from rust-lang/rust
Jun 13, 2026
cf0ea64
fmt
Jun 13, 2026
72ef4e7
Merge pull request #5105 from rust-lang/rustup-2026-06-13
RalfJung Jun 13, 2026
fefab0c
Prepare for merging from rust-lang/rust
Jun 15, 2026
9c92c06
Merge ref '3daae5e42ec9' from rust-lang/rust
Jun 15, 2026
def508c
Merge pull request #5108 from rust-lang/rustup-2026-06-15
oli-obk Jun 15, 2026
f87a1ba
[Priroda] avoid repeated stops when one source line maps to multiple …
moabo3li Jun 10, 2026
d97a49f
[Priroda] Fix clippy warnings
moabo3li Jun 12, 2026
a272040
[Priroda] Add locals command to show variable names in the current frame
moabo3li Jun 17, 2026
d69410b
Merge pull request #5112 from moabo3li/priroda-commands
oli-obk Jun 18, 2026
44bb193
Prepare for merging from rust-lang/rust
RalfJung Jun 18, 2026
2badf36
Merge ref 'c55fad5a9048' from rust-lang/rust
RalfJung Jun 18, 2026
d3cb383
Update ipc-channel to 0.22 to drop bincode dependency
Turbo87 Jun 18, 2026
2f931e2
ipc-channel: Use crate-root `TryRecvError` path
Turbo87 Jun 18, 2026
f4d74a1
Merge pull request #5117 from RalfJung/rustu
RalfJung Jun 18, 2026
54c9c72
Merge pull request #5115 from Turbo87/update-ipc-channel
RalfJung Jun 18, 2026
35b4396
Prepare for merging from rust-lang/rust
Jun 21, 2026
b1867d9
Merge ref '01f54e80e888' from rust-lang/rust
Jun 21, 2026
2339cc4
we can no longer entirely skip proc macro tests
RalfJung Jun 21, 2026
dc80a26
Merge pull request #5121 from rust-lang/rustup-2026-06-21
RalfJung Jun 21, 2026
ad7973f
update lockfile
RalfJung Jun 21, 2026
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
20 changes: 6 additions & 14 deletions Cargo.lock
Original file line number Diff line number Diff line change
Expand Up @@ -300,15 +300,6 @@ dependencies = [
"serde",
]

[[package]]
name = "bincode"
version = "1.3.3"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "b1f45e9417d87227c7a56d22e471c6206462cba514c7590c09aff4cf6d1ddcad"
dependencies = [
"serde",
]

[[package]]
name = "bitflags"
version = "2.10.0"
Expand Down Expand Up @@ -2105,18 +2096,19 @@ dependencies = [

[[package]]
name = "ipc-channel"
version = "0.20.2"
version = "0.22.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "f93600b5616c2d075f8af8dbd23c1d69278c5d24e4913d220cbc60b14c95c180"
checksum = "347ef783e380784658248bdb0b87ca1293e3e3df3fc7dee061e129aa5f013d61"
dependencies = [
"bincode",
"crossbeam-channel",
"fnv",
"libc",
"mio",
"postcard",
"rand 0.9.2",
"serde",
"rustc-hash 2.1.1",
"serde_core",
"tempfile",
"thiserror 2.0.17",
"uuid",
"windows 0.61.3",
]
Expand Down
67 changes: 46 additions & 21 deletions src/tools/miri/Cargo.lock
Original file line number Diff line number Diff line change
Expand Up @@ -80,15 +80,6 @@ dependencies = [
"windows-link 0.2.1",
]

[[package]]
name = "bincode"
version = "1.3.3"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "b1f45e9417d87227c7a56d22e471c6206462cba514c7590c09aff4cf6d1ddcad"
dependencies = [
"serde",
]

[[package]]
name = "bitflags"
version = "2.11.1"
Expand Down Expand Up @@ -262,6 +253,15 @@ dependencies = [
"cc",
]

[[package]]
name = "cobs"
version = "0.3.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "0fa961b519f0b462e3a3b4a34b64d119eeaca1d59af726fe450bbba07a9fc0a1"
dependencies = [
"thiserror 2.0.18",
]

[[package]]
name = "codespan-reporting"
version = "0.13.1"
Expand Down Expand Up @@ -460,6 +460,18 @@ dependencies = [
"syn",
]

[[package]]
name = "embedded-io"
version = "0.4.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "ef1a6892d9eef45c8fa6b9e0086428a2cca8491aca8f787c534a3d6d0bcb3ced"

[[package]]
name = "embedded-io"
version = "0.6.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "edd0f118536f44f5ccd48bcb8b111bdc3de888b58c74639dfb034a357d0f206d"

[[package]]
name = "encode_unicode"
version = "1.0.0"
Expand Down Expand Up @@ -504,12 +516,6 @@ version = "0.1.9"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "5baebc0774151f905a1a2cc41989300b1e6fbb29aff0ceffa1064fdd3088d582"

[[package]]
name = "fnv"
version = "1.0.7"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "3f9eec918d3f24069decb9af1554cad7c880e2da24a9afd88aca000531ab82c1"

[[package]]
name = "foldhash"
version = "0.1.5"
Expand Down Expand Up @@ -805,18 +811,19 @@ dependencies = [

[[package]]
name = "ipc-channel"
version = "0.20.2"
version = "0.22.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "f93600b5616c2d075f8af8dbd23c1d69278c5d24e4913d220cbc60b14c95c180"
checksum = "347ef783e380784658248bdb0b87ca1293e3e3df3fc7dee061e129aa5f013d61"
dependencies = [
"bincode",
"crossbeam-channel",
"fnv",
"libc",
"mio",
"postcard",
"rand 0.9.4",
"serde",
"rustc-hash 2.1.2",
"serde_core",
"tempfile",
"thiserror 2.0.18",
"uuid",
"windows",
]
Expand Down Expand Up @@ -982,7 +989,7 @@ dependencies = [
"memmap2",
"parking_lot",
"perf-event-open-sys",
"rustc-hash",
"rustc-hash 1.1.0",
"smallvec",
]

Expand Down Expand Up @@ -1192,6 +1199,18 @@ version = "1.13.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "c33a9471896f1c69cecef8d20cbe2f7accd12527ce60845ff44c153bb2a21b49"

[[package]]
name = "postcard"
version = "1.1.3"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "6764c3b5dd454e283a30e6dfe78e9b31096d9e32036b5d1eaac7a6119ccb9a24"
dependencies = [
"cobs",
"embedded-io 0.4.0",
"embedded-io 0.6.1",
"serde",
]

[[package]]
name = "potential_utf"
version = "0.1.5"
Expand Down Expand Up @@ -1366,6 +1385,12 @@ version = "1.1.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "08d43f7aa6b08d49f382cde6a7982047c3426db949b1424bc4b7ec9ae12c6ce2"

[[package]]
name = "rustc-hash"
version = "2.1.2"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "94300abf3f1ae2e2b8ffb7b58043de3d399c73fa6f4b73826402a5c457614dbe"

[[package]]
name = "rustc_version"
version = "0.4.1"
Expand Down
2 changes: 1 addition & 1 deletion src/tools/miri/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ serde = { version = "1.0.219", features = ["derive"], optional = true }

[target.'cfg(target_os = "linux")'.dependencies]
nix = { version = "0.30.1", features = ["mman", "ptrace", "signal"], optional = true }
ipc-channel = { version = "0.20.0", optional = true }
ipc-channel = { version = "0.22.0", optional = true }
capstone = { version = "0.14", features = ["arch_x86", "full"], default-features = false, optional = true}

[target.'cfg(all(target_os = "linux", target_pointer_width = "64", target_endian = "little"))'.dependencies]
Expand Down
41 changes: 16 additions & 25 deletions src/tools/miri/cargo-miri/src/phases.rs
Original file line number Diff line number Diff line change
Expand Up @@ -342,7 +342,7 @@ pub fn phase_rustc(args: impl Iterator<Item = String>, phase: RustcPhase) {
.map_or(0, |verbose| verbose.parse().expect("verbosity flag must be an integer"));
let target_crate = is_target_crate();

let store_json = |info: CrateRunInfo| {
let store_json = |info: &CrateRunInfo| {
if get_arg_flag_value("--emit").unwrap_or_default().split(',').any(|e| e == "dep-info") {
// Create a stub .d file to stop Cargo from "rebuilding" the crate:
// https://github.com/rust-lang/miri/issues/1724#issuecomment-787115693
Expand Down Expand Up @@ -383,9 +383,9 @@ pub fn phase_rustc(args: impl Iterator<Item = String>, phase: RustcPhase) {
// like we want them.
// Instead of compiling, we write JSON into the output file with all the relevant command-line flags
// and environment variables; this is used when cargo calls us again in the CARGO_TARGET_RUNNER phase.
let env = CrateRunEnv::collect(args, inside_rustdoc);
let info = CrateRunInfo::collect(args, inside_rustdoc);

store_json(CrateRunInfo::RunWith(env.clone()));
store_json(&info);

// Rustdoc expects us to exit with an error code if the test is marked as `compile_fail`,
// just creating the JSON file is not enough: we need to detect syntax errors,
Expand All @@ -395,7 +395,8 @@ pub fn phase_rustc(args: impl Iterator<Item = String>, phase: RustcPhase) {

// Ensure --emit argument for a check-only build is present.
if let Some(val) =
ArgFlagValueIter::from_str_iter(env.args.iter().map(|s| s as &str), "--emit").next()
ArgFlagValueIter::from_str_iter(info.args.iter().map(|s| s as &str), "--emit")
.next()
{
// For `no_run` tests, rustdoc passes a `--emit` flag; make sure it has the right shape.
assert_eq!(val, "metadata");
Expand All @@ -405,7 +406,7 @@ pub fn phase_rustc(args: impl Iterator<Item = String>, phase: RustcPhase) {
}

// Alter the `-o` parameter so that it does not overwrite the JSON file we stored above.
let mut args = env.args;
let mut args = info.args;
for i in 0..args.len() {
if args[i] == "-o" {
args[i + 1].push_str(".miri");
Expand All @@ -418,23 +419,22 @@ pub fn phase_rustc(args: impl Iterator<Item = String>, phase: RustcPhase) {
if verbose > 0 {
eprintln!(
"[cargo-miri rustc inside rustdoc] captured input:\n{}",
std::str::from_utf8(&env.stdin).unwrap()
std::str::from_utf8(&info.stdin).unwrap()
);
eprintln!("[cargo-miri rustc inside rustdoc] going to run:\n{cmd:?}");
}

exec_with_pipe(cmd, &env.stdin);
exec_with_pipe(cmd, &info.stdin);
}

return;
}

// Unit tests for `proc-macro` crates are always built for the host so they cannot run in Miri.
if runnable_crate && get_arg_flag_values("--extern").any(|krate| krate == "proc_macro") {
// This is a "runnable" `proc-macro` crate (unit tests). We do not support
// interpreting that under Miri now, so we write a JSON file to (display a
// helpful message and) skip it in the runner phase.
store_json(CrateRunInfo::SkipProcMacroTest);
return;
// Ideally we'd entirely skip them... but we have no good way of doing that here.
// So we run the tests natively on the host instead.
eprintln!("warning: unit tests of `proc-macro` crates are executed outside Miri");
}

let mut cmd = miri();
Expand Down Expand Up @@ -537,18 +537,9 @@ pub fn phase_runner(mut binary_args: impl Iterator<Item = String>, phase: Runner
let file = BufReader::new(file);
let binary_args = binary_args.collect::<Vec<_>>();

let info = serde_json::from_reader(file).unwrap_or_else(|_| {
let info: CrateRunInfo = serde_json::from_reader(file).unwrap_or_else(|_| {
show_error!("file {:?} contains outdated or invalid JSON; try `cargo clean`", binary)
});
let info = match info {
CrateRunInfo::RunWith(info) => info,
CrateRunInfo::SkipProcMacroTest => {
eprintln!(
"Running unit tests of `proc-macro` crates is not currently supported by Miri."
);
return;
}
};

let mut cmd = miri();

Expand Down Expand Up @@ -631,10 +622,10 @@ pub fn phase_rustdoc(args: impl Iterator<Item = String>) {
let mut cmd = Command::new(rustdoc);
cmd.args(args);

// Doctests of `proc-macro` crates (and their dependencies) are always built for the host,
// so we are not able to run them in Miri.
// Documentation tests of `proc-macro` crates are always built for the host, so we are not able
// to run them in Miri.
if get_arg_flag_values("--crate-type").any(|crate_type| crate_type == "proc-macro") {
eprintln!("Running doctests of `proc-macro` crates is not currently supported by Miri.");
eprintln!("warning: doc tests of `proc-macro` crates are not supported by Miri");
return;
}

Expand Down
21 changes: 5 additions & 16 deletions src/tools/miri/cargo-miri/src/util.rs
Original file line number Diff line number Diff line change
Expand Up @@ -22,9 +22,9 @@ macro_rules! show_error {
}
pub(crate) use show_error;

/// The information to run a crate with the given environment.
#[derive(Clone, Serialize, Deserialize)]
pub struct CrateRunEnv {
/// The information Miri needs to run a crate. Stored as JSON when the crate is "compiled".
#[derive(Serialize, Deserialize)]
pub struct CrateRunInfo {
/// The command-line arguments.
pub args: Vec<String>,
/// The environment.
Expand All @@ -35,7 +35,7 @@ pub struct CrateRunEnv {
pub stdin: Vec<u8>,
}

impl CrateRunEnv {
impl CrateRunInfo {
/// Gather all the information we need.
pub fn collect(args: impl Iterator<Item = String>, capture_stdin: bool) -> Self {
let args = args.collect();
Expand All @@ -47,20 +47,9 @@ impl CrateRunEnv {
std::io::stdin().lock().read_to_end(&mut stdin).expect("cannot read stdin");
}

CrateRunEnv { args, env, current_dir, stdin }
CrateRunInfo { args, env, current_dir, stdin }
}
}

/// The information Miri needs to run a crate. Stored as JSON when the crate is "compiled".
#[derive(Serialize, Deserialize)]
pub enum CrateRunInfo {
/// Run it with the given environment.
RunWith(CrateRunEnv),
/// Skip it as Miri does not support interpreting such kind of crates.
SkipProcMacroTest,
}

impl CrateRunInfo {
pub fn store(&self, filename: &Path) {
let file = File::create(filename)
.unwrap_or_else(|_| show_error!("cannot create `{}`", filename.display()));
Expand Down
Loading
Loading