taiki-e / cargo-hack

Cargo subcommand to provide various options useful for testing and continuous integration.
Apache License 2.0
628 stars 28 forks source link

feat: Support mixed MSRV in --version-range #213

Closed epage closed 1 year ago

epage commented 1 year ago

This expands on the approach taken in #212 bucketing packages into rust-versions to run. If we skipped the MSRV (due to --version-step), we automatically inject it. If a package's MSRV isn't within the range, we skip it.

Benefits

I did have to specialize --rust-version vs --version-range to avoid --rust-version range users walking more than they needed.

To keep the progress total accurate, I shifted the calculating of the total from determine_package_list to after we have bucketed everything. To make this feasible, I saved off the how many iterations a package will have without the version range being taken into account.

As a byproduct, this fixes a bug in #212 where it didn't take the rust-version into account when determining the total.

Fixes #199

epage commented 1 year ago

@taiki-e CI is passing

taiki-e commented 1 year ago

Great! Could you add a test case for --version-step?

epage commented 1 year ago

I also should add a warning when a selected package is skipped due to msrv being higher than the end of the range in case it isn't intentional

epage commented 1 year ago

CI is passing again with the applied changes

taiki-e commented 1 year ago

Published in 0.6.6. Thanks again @epage!