Skip to content

Get "required-features" for target and set them #68

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

Closed
little-arhat opened this issue Aug 17, 2018 · 4 comments
Closed

Get "required-features" for target and set them #68

little-arhat opened this issue Aug 17, 2018 · 4 comments

Comments

@little-arhat
Copy link
Contributor

Since it's currently impossible to define additional dependencies for a binary, some projects use workaround with required-features (link). To build such target one need to provide these required features:

cargo build --bin pwm
error: target `pwm` in package `proving_ground` requires the features: `with_device`
Consider enabling them by passing e.g. `--features="with_device"`

flycheck-rust should extract required-features and configure rust-cargo checker to use it.
rust-cargo will have to be extended as well to support --features flag, I guess?

@fmdkdd
Copy link
Member

fmdkdd commented Aug 20, 2018

flycheck-rust should extract required-features and configure rust-cargo checker to use it.
rust-cargo will have to be extended as well to support --features flag, I guess?

That how we should handle it, yes.

Please notify us when the required-features is added to nightly.

@little-arhat
Copy link
Contributor Author

rust-lang/cargo#5902 (comment) -- pull request adding required-features to cargo metadata output has been merged.

@fmdkdd
Copy link
Member

fmdkdd commented Aug 22, 2018

That was quick! Do you want to make the PR that extracts the required-features field as well?

@little-arhat
Copy link
Contributor Author

@fmdkdd here is my attempt: #69. Not sure it's the best solution (I had to fix all the tests), so feel free to fix, abandon or suggest a better way %)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants