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

allow runner configuration to use feature flags #14314

Closed
BartMassey opened this issue Jul 27, 2024 · 1 comment
Closed

allow runner configuration to use feature flags #14314

BartMassey opened this issue Jul 27, 2024 · 1 comment
Labels
C-feature-request Category: proposal for a feature. Before PR, ping rust-lang/cargo if this is not `Feature accepted` S-triage Status: This issue is waiting on initial triage.

Comments

@BartMassey
Copy link
Contributor

Problem

In the embedded space, I have several chips with the same target triple, but which require a different runner. My Cargo.toml contains features that are sufficient to know which runner to use. However, my .cargo/config.toml cannot choose a runner based on those features. Error-prone manual editing is required.

(Specifically, target is thumbv7em-none-eabihf, runner is probe-rs run --chip=nrf52833-xxAA or probe-rs run --chip=nrf52840-xxAA depending on board feature flags.)

Proposed Solution

It would be great to be able to have the full Cargo cfg() available in cargo.toml. Specifically, it would be nice to be able to write something like

[target.'cfg(feature = "myfeature")']

I'm not wedded to the particulars: anything that lets me pick the correct runner automagically would be fine.

Notes

No response

@BartMassey BartMassey added C-feature-request Category: proposal for a feature. Before PR, ping rust-lang/cargo if this is not `Feature accepted` S-triage Status: This issue is waiting on initial triage. labels Jul 27, 2024
@weihanglo
Copy link
Member

weihanglo commented Jul 27, 2024

Thanks for providing your use case. This seems like a duplicate of #8170. In the meanwhile custom --cfg is an alternative. Close in favor of #8170.

See also #14306.

@weihanglo weihanglo closed this as not planned Won't fix, can't repro, duplicate, stale Jul 27, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
C-feature-request Category: proposal for a feature. Before PR, ping rust-lang/cargo if this is not `Feature accepted` S-triage Status: This issue is waiting on initial triage.
Projects
None yet
Development

No branches or pull requests

2 participants