rules_rust icon indicating copy to clipboard operation
rules_rust copied to clipboard

`crate.annotate` has no way to remove optional features like `crate.override` did

Open SlyMarbo opened this issue 2 years ago • 3 comments

In the previous crates_universe functionality, crate.override could be used to remove optional features. There doesn't seem to be any similar functionality in the corresponding crate.annotate feature now that rules_rust has switched to crates_repository. This might be useful for turning off some default features, for example. See #1168 for more context.

SlyMarbo avatar Mar 07 '22 19:03 SlyMarbo

Note that this is not strictly necessary, as the same problem can be solved by using default_features = False in the crate.spec, along with any desired features in the features field.

SlyMarbo avatar Mar 07 '22 21:03 SlyMarbo

What do folks think of allowing negative patterns in crate.annotations.crate_features? This way features auto-included could be removed via ["-feature"].

cc @illicitonion

UebelAndre avatar Jun 26 '22 17:06 UebelAndre

https://doc.rust-lang.org/cargo/reference/features.html#the-features-section documents that features may not start with -, so that sounds good!

illicitonion avatar Jun 27 '22 12:06 illicitonion