Skip to content

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

Description

@little-arhat

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?

Activity

  1. fmdkdd commented on Aug 20, 2018

    @fmdkdd
    Member

    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.

  2. little-arhat commented on Aug 21, 2018

    @little-arhat
    ContributorAuthor

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

  3. fmdkdd commented on Aug 22, 2018

    @fmdkdd
    Member

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

  4. little-arhat commented on Aug 23, 2018

    @little-arhat
    ContributorAuthor

    @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

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions