Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add --version-range option #102

Merged
merged 1 commit into from
Dec 5, 2020
Merged

Add --version-range option #102

merged 1 commit into from
Dec 5, 2020

Conversation

taiki-e
Copy link
Owner

@taiki-e taiki-e commented Dec 4, 2020

Closes #93

This may be useful for catching issues like BurntSushi/termcolor#35, rust-lang/regex#685, rayon-rs/rayon#761 (comment), rust-lang/rust-clippy#6324.

--version-range <START>..[END]
    Perform commands on a specified (inclusive) range of Rust versions.

    If the given range is unclosed, the latest stable compiler is treated as the upper bound.

    Note that ranges are always inclusive ranges.

--version-step <NUM>
    Specify the version interval of --version-range.

Note: Ranges are always inclusive ranges. (start..=end)

$ cargo hack check --version-range 1.46..1.47
info: running `cargo +1.46 check` on cargo-hack (1/2)
    Finished dev [unoptimized + debuginfo] target(s) in 0.28s
info: running `cargo +1.47 check` on cargo-hack (2/2)
    Finished dev [unoptimized + debuginfo] target(s) in 0.23s

If the given range is unclosed, the latest stable compiler is treated as the upper bound.

$ cargo hack check --version-range 1.46..
info: running `cargo +1.46 check` on cargo-hack (1/3)
    Finished dev [unoptimized + debuginfo] target(s) in 0.28s
info: running `cargo +1.47 check` on cargo-hack (2/3)
    Finished dev [unoptimized + debuginfo] target(s) in 0.23s
info: running `cargo +1.48 check` on cargo-hack (3/3)
    Finished dev [unoptimized + debuginfo] target(s) in 0.28

You can also specify the version interval by using --version-step. ((start..=end).step_by(step))

$ cargo hack check --version-range 1.45.. --version-step 2
info: running `cargo +1.45 check` on cargo-hack (1/2)
    Finished dev [unoptimized + debuginfo] target(s) in 0.29s
info: running `cargo +1.47 check` on cargo-hack (2/2)
    Finished dev [unoptimized + debuginfo] target(s) in 0.25s

@taiki-e taiki-e added this to the v0.5 milestone Dec 4, 2020
@taiki-e taiki-e added the C-enhancement Category: A new feature or an improvement for an existing one label Dec 4, 2020
@taiki-e taiki-e force-pushed the version-range branch 11 times, most recently from 1475e7c to f8530b0 Compare December 4, 2020 07:46
@taiki-e taiki-e added the S-blocked Status: Blocked on something else label Dec 4, 2020
@taiki-e

This comment has been minimized.

@taiki-e taiki-e force-pushed the version-range branch 4 times, most recently from d8f51d6 to 3a558a9 Compare December 4, 2020 12:48
@taiki-e taiki-e mentioned this pull request Dec 4, 2020
bors bot added a commit that referenced this pull request Dec 4, 2020
103: Minor cleanup r=taiki-e a=taiki-e

Split from #102.

Co-authored-by: Taiki Endo <te316e89@gmail.com>
@taiki-e taiki-e force-pushed the version-range branch 2 times, most recently from b79b5fa to f156de7 Compare December 4, 2020 13:11
@taiki-e taiki-e marked this pull request as ready for review December 4, 2020 15:41
@taiki-e taiki-e force-pushed the version-range branch 6 times, most recently from 03b993c to c7f6d0e Compare December 5, 2020 12:22
@taiki-e taiki-e removed the S-blocked Status: Blocked on something else label Dec 5, 2020
@taiki-e taiki-e force-pushed the version-range branch 4 times, most recently from e1564ac to 02fae8b Compare December 5, 2020 13:15
@taiki-e
Copy link
Owner Author

taiki-e commented Dec 5, 2020

range

build:
strategy:
matrix:
range:
# This is the minimum supported Rust version of this crate.
# When updating this, the reminder to update the minimum supported Rust version in README.md.
- 1.36..1.40
- 1.41..1.45
- 1.46..

@taiki-e
Copy link
Owner Author

taiki-e commented Dec 5, 2020

bors r+

@bors
Copy link
Contributor

bors bot commented Dec 5, 2020

Build succeeded:

@bors bors bot merged commit 65b3653 into master Dec 5, 2020
@bors bors bot deleted the version-range branch December 5, 2020 13:40
bors bot added a commit to taiki-e/auto_enums that referenced this pull request Dec 6, 2020
120: ci: make sure can compile with all versions on or after MSRV r=taiki-e a=taiki-e

taiki-e/cargo-hack#102

Co-authored-by: Taiki Endo <te316e89@gmail.com>
bors bot added a commit to taiki-e/pin-project that referenced this pull request Dec 6, 2020
306: ci: make sure can compile with all versions on or after MSRV r=taiki-e a=taiki-e

taiki-e/cargo-hack#102

Co-authored-by: Taiki Endo <te316e89@gmail.com>
@taiki-e taiki-e added the A-version Area: --rust-version, --version-range, --version-step label Dec 9, 2020
@taiki-e taiki-e removed the C-enhancement Category: A new feature or an improvement for an existing one label Jan 6, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-version Area: --rust-version, --version-range, --version-step
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Options for running commands on a specified range of versions of cargo
1 participant