frewsxcv / cargo-all-features

A Cargo subcommand to build and test all feature flag combinations.
Apache License 2.0
146 stars 20 forks source link

Bug: Tries too many / invalid combinations of features on beta/nightly Rust #27

Closed faern closed 2 years ago

faern commented 2 years ago

I just added this to my CI. But I noticed when it runs on the Rust beta and nightly channels it tries a very odd combination of features. My crate has two optional dependencies, those are the only two features. The crate has env_logger and structopt as optional features.

On stable (only the relevant output):

$ cargo +stable build-all-features 2> /dev/null
    Building crate=udp-over-tcp features=[]
    Building crate=udp-over-tcp features=[env_logger]
    Building crate=udp-over-tcp features=[structopt]
    Building crate=udp-over-tcp features=[env_logger, structopt]

The above is exactly what I expect. But it does the following on beta:

 $ cargo +beta build-all-features 2> /dev/null
    Building crate=udp-over-tcp features=[]
    Building crate=udp-over-tcp features=[env_logger]
    Building crate=udp-over-tcp features=[structopt]
    Building crate=udp-over-tcp features=[env_logger]
    Building crate=udp-over-tcp features=[structopt]
    Building crate=udp-over-tcp features=[env_logger, structopt]
    Building crate=udp-over-tcp features=[env_logger, env_logger]
    Building crate=udp-over-tcp features=[env_logger, structopt]
    Building crate=udp-over-tcp features=[structopt, env_logger]
    Building crate=udp-over-tcp features=[structopt, structopt]
    Building crate=udp-over-tcp features=[env_logger, structopt]
    Building crate=udp-over-tcp features=[env_logger, structopt, env_logger]
    Building crate=udp-over-tcp features=[env_logger, structopt, structopt]
    Building crate=udp-over-tcp features=[env_logger, env_logger, structopt]
    Building crate=udp-over-tcp features=[structopt, env_logger, structopt]
    Building crate=udp-over-tcp features=[env_logger, structopt, env_logger, structopt]

This is not what I would expect it to try with only two features :sweat_smile:

Manishearth commented 2 years ago

https://github.com/frewsxcv/cargo-all-features/issues/29