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 note to cargo install --help that says cargo install --vers x.x.x requires =x.x.x to install specific version #3321

Closed
ducks opened this issue Nov 23, 2016 · 11 comments · Fixed by #3338

Comments

@ducks
Copy link
Contributor

ducks commented Nov 23, 2016

From cargo install --help:

"Crates from crates.io can optionally specify the version they wish to install
via the --vers VERS flags,"

Make a note that VERS needs to be in the format =x.x.x (equal before version)

@steveklabnik
Copy link
Member

That is, VERS is a semver version range, not an exact version.

@alexcrichton
Copy link
Member

Hm this was intended to be a precise semver version. If we made a mistake and took a range though I guess that ship has sailed...

@steveklabnik
Copy link
Member

@alexcrichton we should double check the behavior but this is what @ducks observed in IRC.

@ducks
Copy link
Contributor Author

ducks commented Nov 23, 2016

@alexcrichton
Copy link
Member

Yes this was accidentally implemented as a version requirement, not a version itself. Oh well :(

@sfackler
Copy link
Member

It seems like this is a thing we should just fix? As long as we can have some kind of nice error message if you try to give it a version requirement it seems fine to do.

alexcrichton added a commit to alexcrichton/cargo that referenced this issue Nov 28, 2016
Historically Cargo accidentally took a semver version *requirement*, so let's
start issuing warnings about how this is now legacy behavior.

Closes rust-lang#3321
@alexcrichton
Copy link
Member

I've opened #3338 to fix this behavior.

bors added a commit that referenced this issue Dec 2, 2016
Require `cargo install --vers` takes a semver version

Historically Cargo accidentally took a semver version *requirement*, so let's
start issuing warnings about how this is now legacy behavior.

Closes #3321
@bors bors closed this as completed in #3338 Dec 2, 2016
@azerupi
Copy link
Contributor

azerupi commented Jun 21, 2017

I actually have a use case for installing a binary using a semver range.
mdBook is used to render some of the books for Rust and other projects in the community and we sometimes have to issue a breaking release. However, since books are often automatically deployed through CI, we don't want to break all the guides when we push a breaking release. So we have to advise users to pin the version of mdBook in their deployment scripts.

If we had semver ranges for binaries, CI scripts could automatically install the latest non-breaking version, benefiting from all the improvements without the risk of breakage. This would reduce manual intervention to only breaking releases instead of every point release.

I know this feature still works, so technically I could tell users to use it. But I don't want to push the use of a deprecated feature that could disappear in the future. Do you think this is a valid argument to consider undeprecating this feature?

@alexcrichton
Copy link
Member

@azerupi it seems reasonable to me, yeah! I think we'd just want a new flag for this, like cargo install --range ... because --vers sounds too much like "I want this precise version"

@azerupi
Copy link
Contributor

azerupi commented Jun 22, 2017

I think we'd just want a new flag for this, like cargo install --range ...

Sure, that makes a lot of sense!
Should I create a new issue to track and discuss this? Also I wouldn't mind trying to make a PR for this if it a desirable feature. :)

@alexcrichton
Copy link
Member

Sure yeah a new issue sounds good, and a PR sounds even better!

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

Successfully merging a pull request may close this issue.

5 participants