Skip to content

Implemented --ignore-unknown-features with --include-features.#300

Open
Zenithsiz wants to merge 1 commit into
taiki-e:mainfrom
Zenithsiz:main
Open

Implemented --ignore-unknown-features with --include-features.#300
Zenithsiz wants to merge 1 commit into
taiki-e:mainfrom
Zenithsiz:main

Conversation

@Zenithsiz

Copy link
Copy Markdown

Adds support for --ignore-unknown-features with --include-features.

The fix just filters all features by whether the package has them before returning them from determine_kind, but I'm not sure if this can miss any features.

The feature type decides whether or not it's filtered:

  • Normal features must match their name to one of the package features
  • Group features must match one of their names to one of the package features (I couldn't quite tell, but it seems that group features already filter themselves to the available features in the package? So as long as one of them exists, it should be fine to pass the group along).
  • Path features currently are always allowed. From what I can see, path features only come from --include-deps-features, and that is incompatible with --include-features, but it may be worth it at at least check that the dependency exists when filtering? (Although we can't check if the dependency feature exists, since we don't have access to that manifest)

All tests, including the one added for this specific case passed.

It's my first time both reading the codebase and contributing, so if I've missed anything, please tell me.

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant