Skip to content

"./x run miri" does not work with "--target" #145839

@RalfJung

Description

@RalfJung

Summary

Miri can run things for arbitrary targets, so ./x run miri --target <foo> should just work. However, something does not seem to be wired up correctly:

$ ./x run miri --stage 1 --target aarch64-apple-darwin -- src/tools/miri/tests/pass/hello.rs
Building bootstrap
    Finished `dev` profile [unoptimized] target(s) in 0.07s

thread 'main' panicked at src/bootstrap/src/core/build_steps/compile.rs:1841:13:
assertion `left == right` failed: Cross-compiling is not yet supported with `download-rustc`
  left: x86_64-unknown-linux-gnu
 right: aarch64-apple-darwin

This shouldn't be cross-compiling anything so the error makes little sense. But okay, let's disable download-rustc:

$ ./x run miri --stage 1 --target aarch64-apple-darwin --set rust.download-rustc=false -- src/tools/miri/tests/pass/hello.rs
Building bootstrap
    Finished `dev` profile [unoptimized] target(s) in 0.11s

thread 'main' panicked at src/bootstrap/src/core/builder/mod.rs:1436:17:
It is not possible to build the standard library for `aarch64-apple-darwin` using the stage0 compiler.
You have to build a stage1 compiler for `x86_64-unknown-linux-gnu` first, and then use it to build a standard library for `aarch64-apple-darwin`.

At the same time, ./x test miri --target ... works fine.

I guess the problem here is that --target is ambiguous: it could mean "build miri for that target and then run it", or it could mean"build miri for the host and then run it for the given target". But IMO it makes most sense to be consistent with test here, where it means the latter.

Operating system

Debian testing

HEAD

6ba0ce4

Metadata

Metadata

Assignees

No one assigned

    Labels

    C-bugCategory: This is a bug.T-bootstrapRelevant to the bootstrap subteam: Rust's build system (x.py and src/bootstrap)

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions