Description
Describe the problem you are trying to solve
Cargo currently provides a build.target
configuration key that allows to change the default target triple. This changes the default target for all cargo commands, including cargo build
, cargo run
, cargo test
and cargo bench
. For embedded/OS crates it often makes sense to set that key so that the project is automatically built for the bare-metal target system instead of the host system.
The problem is that one might still want to run the cargo test
and cargo bench
commands on the host architecture because they depend on std
(and thus don't work on the embedded target). Currently the only way to do this is to specify the full host triple on each cargo test
invocation, which is not portable across different host systems.
Describe the solution you'd like
It would be nice if there would be an additional build.build-target
configuration key that overrides the target only for cargo build
, cargo check
, and cargo run
, but not for cargo test
and cargo bench
.
Notes
I'm happy to create a PR for this if something like this is desired.
Metadata
Metadata
Assignees
Labels
Type
Projects
Status