Can't specify `-Znext-solver=globally` for proc macros under Miri

⚓ Rust    📅 2026-06-05    👤 surdeus    👁️ 4      

surdeus

The proc macro I use indirectly depends on a crate that needs -Znext-solver=globally.

When running tests with MIRIFLAGS="-Znext-solver=globally" cargo miri test --target aarch64-unknown-linux-gnu and having this in the .cargo/config.toml:

[target.'cfg(all())']
rustflags = ["-Znext-solver=globally"]
rustdocflags = ["-Znext-solver=globally"]

I still can't seem to make proc macros to compile with -Znext-solver=globally.

I tried adding this to the config without success:

[host]
rustflags = ["-Znext-solver=globally"]

After `RUSTFLAGS="-Znext-solver"` doesn't take effect when cross-compiling - #12 by nazar-pc I tried this:

MIRIFLAGS="-Znext-solver=globally" cargo miri test -Ztarget-applies-to-host -Zhost-config --config 'host.rustflags=["-Znext-solver=globally"]' --target aarch64-unknown-linux-gnu

Now I'm getting this:

error: failed to run custom build command for `serde_core v1.0.228`

Caused by:
  process didn't exit successfully: `/home/nazar-pc/.rustup/toolchains/nightly-2026-06-05-x86_64-unknown-linux-gnu/bin/cargo-miri runner /home/nazar-pc/.cache/cargo/target/miri/debug/build/serde_core-071fc8bcc02c7003/build-script-build` (exit status: 1)
  --- stderr
  fatal error: file "/home/nazar-pc/.cache/cargo/target/miri/debug/build/serde_core-071fc8bcc02c7003/build-script-build" contains outdated or invalid JSON; try `cargo clean`
warning: build failed, waiting for other jobs to finish...
error: failed to run custom build command for `serde_core v1.0.228`

Caused by:
  process didn't exit successfully: `/home/nazar-pc/.rustup/toolchains/nightly-2026-06-05-x86_64-unknown-linux-gnu/bin/cargo-miri runner /home/nazar-pc/.cache/cargo/target/miri/debug/build/serde_core-071fc8bcc02c7003/build-script-build` (exit status: 1)
  --- stderr
  fatal error: file "/home/nazar-pc/.cache/cargo/target/miri/debug/build/serde_core-071fc8bcc02c7003/build-script-build" contains outdated or invalid JSON; try `cargo clean`
error: failed to run custom build command for `thiserror v2.0.18`

Caused by:
  process didn't exit successfully: `/home/nazar-pc/.rustup/toolchains/nightly-2026-06-05-x86_64-unknown-linux-gnu/bin/cargo-miri runner /home/nazar-pc/.cache/cargo/target/miri/debug/build/thiserror-67153f49ac334a81/build-script-build` (exit status: 1)
  --- stderr
  fatal error: file "/home/nazar-pc/.cache/cargo/target/miri/debug/build/thiserror-67153f49ac334a81/build-script-build" contains outdated or invalid JSON; try `cargo clean`
error: failed to run custom build command for `thiserror v2.0.18`

Caused by:
  process didn't exit successfully: `/home/nazar-pc/.rustup/toolchains/nightly-2026-06-05-x86_64-unknown-linux-gnu/bin/cargo-miri runner /home/nazar-pc/.cache/cargo/target/miri/debug/build/thiserror-67153f49ac334a81/build-script-build` (exit status: 1)
  --- stderr
  fatal error: file "/home/nazar-pc/.cache/cargo/target/miri/debug/build/thiserror-67153f49ac334a81/build-script-build" contains outdated or invalid JSON; try `cargo clean`
error: failed to run custom build command for `quote v1.0.45`

Caused by:
  process didn't exit successfully: `/home/nazar-pc/.rustup/toolchains/nightly-2026-06-05-x86_64-unknown-linux-gnu/bin/cargo-miri runner /home/nazar-pc/.cache/cargo/target/miri/debug/build/quote-ea5213dddb613b84/build-script-build` (exit status: 1)
  --- stderr
  fatal error: file "/home/nazar-pc/.cache/cargo/target/miri/debug/build/quote-ea5213dddb613b84/build-script-build" contains outdated or invalid JSON; try `cargo clean`

I did try cleaning target, but it made no difference.

I'm out of options now, I don't understand what that error means anymore. Any ideas?

1 post - 1 participant

Read full topic

🏷️ Rust_feed