Skip to content

Conversation

Kobzol
Copy link
Member

@Kobzol Kobzol commented Aug 25, 2025

Previously we were building Miri for the passed --target, which was wrong.

Fixes: #145839

r? @jieyouxu

@rustbot rustbot added the S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. label Aug 25, 2025
@rustbot
Copy link
Collaborator

rustbot commented Aug 25, 2025

This PR modifies src/bootstrap/src/core/config.

If appropriate, please update CONFIG_CHANGE_HISTORY in src/bootstrap/src/utils/change_tracker.rs.

@rustbot rustbot added the T-bootstrap Relevant to the bootstrap subteam: Rust's build system (x.py and src/bootstrap) label Aug 25, 2025
@Kobzol
Copy link
Member Author

Kobzol commented Aug 25, 2025

@RalfJung Could you please check if this PR fixes the issue for you? With the changes from this PR, I was able to build miri, but the actual x run miri invocation fails (not sure if that's expected):

thread 'rustc' panicked at /projects/personal/rust/rust/compiler/rustc_hir/src/hir.rs:1205:35:
invalid enum variant tag while decoding `Attribute`, expected 0..2, actual 161

@RalfJung
Copy link
Member

That's definitely not expected, that indicates an invalid rlib so something got seriously mixed up.

@Kobzol
Copy link
Member Author

Kobzol commented Aug 25, 2025

When I build miri with stage 0 rustc, and miri links to stage 1 rustc, then cargo miri setup should be invoked with the stage 1 rustc, right?

@RalfJung
Copy link
Member

That's just invoking a binary? Not sure what you mean.

cargo miri needs to invoke Miri which should be the Miri that has just been built.

@RalfJung
Copy link
Member

RalfJung commented Aug 25, 2025

FWIW ./x run miri --stage 1 --target aarch64-apple-darwin --set rust.download-rustc=false -- src/tools/miri/tests/pass/hello.rs actually works for me with this PR. :)

@bors
Copy link
Collaborator

bors commented Aug 25, 2025

☔ The latest upstream changes (presumably #145472) made this pull request unmergeable. Please resolve the merge conflicts.

@jieyouxu
Copy link
Member

Needs a rebase.
@rustbot author

@rustbot rustbot added S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. and removed S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. labels Aug 26, 2025
@rustbot
Copy link
Collaborator

rustbot commented Aug 26, 2025

This PR was rebased onto a different master commit. Here's a range-diff highlighting what actually changed.

Rebasing is a normal part of keeping PRs up to date, so no action is needed—this note is just to help reviewers.

@Kobzol
Copy link
Member Author

Kobzol commented Aug 26, 2025

Rebased.

@rustbot ready

@rustbot rustbot added S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. and removed S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. labels Aug 26, 2025
Copy link
Member

@jieyouxu jieyouxu left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks, tiny doc question

View changes since this review

@jieyouxu
Copy link
Member

Feel free to r=me with or without the doc nit.

@jieyouxu
Copy link
Member

@rustbot author

@rustbot rustbot added S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. and removed S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. labels Aug 26, 2025
@Kobzol
Copy link
Member Author

Kobzol commented Aug 26, 2025

@bors r=jieyouxu rollup

@bors
Copy link
Collaborator

bors commented Aug 26, 2025

📌 Commit 0781c47 has been approved by jieyouxu

It is now in the queue for this repository.

@bors bors added S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. and removed S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. labels Aug 26, 2025
bors added a commit that referenced this pull request Aug 26, 2025
Rollup of 11 pull requests

Successful merges:

 - #144373 (remove deprecated Error::description in impls)
 - #144551 (Add aarch64_be-unknown-linux-musl target)
 - #145076 (Add new Tier-3 target: riscv64a23-unknown-linux-gnu)
 - #145481 (Add parentheses for closure when suggesting calling closure)
 - #145596 (Losslessly optimize PNG files)
 - #145615 (Fix doc of `std::os::windows::io::BorrowedSocket::borrow_raw`)
 - #145841 (Always build miri for the host in `x run miri`)
 - #145861 (bootstrap: vendor `clippy_test_deps` too)
 - #145863 (formatting_options: Make all methods `const`)
 - #145867 (cg_llvm: Assert that LLVM range-attribute values don't exceed 128 bits)
 - #145875 (Make bootstrap command caching opt-in)

r? `@ghost`
`@rustbot` modify labels: rollup
@bors bors merged commit 2ac7fdd into rust-lang:master Aug 26, 2025
10 checks passed
@rustbot rustbot added this to the 1.91.0 milestone Aug 26, 2025
rust-timer added a commit that referenced this pull request Aug 26, 2025
Rollup merge of #145841 - Kobzol:fix-miri-run, r=jieyouxu

Always build miri for the host in `x run miri`

Previously we were building Miri for the passed `--target`, which was wrong.

Fixes: #145839

r? `@jieyouxu`
@RalfJung
Copy link
Member

Thanks :-)

@Kobzol Kobzol deleted the fix-miri-run branch August 26, 2025 18:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. T-bootstrap Relevant to the bootstrap subteam: Rust's build system (x.py and src/bootstrap)
Projects
None yet
Development

Successfully merging this pull request may close these issues.

"./x run miri" does not work with "--target"
5 participants