Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add a build.build-target config key #6825

Closed
wants to merge 5 commits into from

Conversation

phil-opp
Copy link
Contributor

@phil-opp phil-opp commented Apr 6, 2019

This key allows overriding the default target for build operations (e.g. cargo build, cargo check, cargo run), but not for test operations (cargo test, cargo bench).

See #6784 and https://internals.rust-lang.org/t/set-default-target-for-cargo-build-but-not-for-cargo-test/9777 for motivation.

Fixes #6784

phil-opp added 3 commits April 6, 2019 20:42
This key allows overriding the default target for build operations (e.g. `cargo build`, `cargo check`, `cargo run`), but not for test operations (`cargo test`, `cargo bench`).
@rust-highfive
Copy link

r? @ehuss

(rust_highfive has picked a reviewer for you, use r? to override)

@rust-highfive rust-highfive added the S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. label Apr 6, 2019
@alexcrichton
Copy link
Member

Thanks for the PR! This seems like a sort of odd feature to me though... The naming "build target" makes me think that $HOST is being changed for build scripts, but then I was surprised to learn that it's quite different from what this PR is implementing. I'm not really sure if there's a good name though for this, and I'm not really sure how to rationalize the feature myself...

I suspect though this is something we'd want to for sure land as unstable rather than insta-stable

@phil-opp
Copy link
Contributor Author

Thanks for taking a look! I agree that setting different default targets for cargo build and cargo test is probably a niche use case. I'm of course happy to change the name and implement it behind a feature gate.

I'm currently exploring an alternative solution to my problem: Custom test frameworks (rust-lang/rust#53410) might allow to run cargo test for the bare metal target system too. If this works, I probably don't need the feature of this PR anymore. I will report back soon!

@phil-opp
Copy link
Contributor Author

I managed to get custom test frameworks working, so I'm now able to run cargo test for the target system too. I no longer need the feature of this PR, so I'm closing it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
S-waiting-on-review Status: Awaiting review from the assignee but also interested parties.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Different default targets for cargo build and cargo test?
4 participants