-
Notifications
You must be signed in to change notification settings - Fork 2.4k
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
Support versions starting with v
in cargo add
#12331
Comments
From the angle of prior art (see #10472)
|
If we supported |
Personally, I think a |
|
It sounds like there are good reasons not to support this, as it could produce other inconsistencies. In that case, I would advocate for the "friendly error message" in the vein that Rust is known for:
|
Just to note: |
|
The tricky part of this error message is that the suggestion “please run: cargo add [email protected]” might not be the correct one. People run with toolchain override If we want this, suggesting |
Problem
I keep doing something the following:
This causes the following error:
I do this because I have a strong habit of prefixing my version numbers with
v
where possible, asvX.Y.Z
tends to be a more unmistakable way to specify a version. And although it is not universal, it is also very common to prefix project release tags withv
— to the point that the canonicalcargo
test for for atag
dependency even uses a value like this: https://github.com/rust-lang/cargo/blob/5b377cece0e0dd0af686cf53ce4637d5d85c2a10/tests/testsuite/cargo_add/git_tag/mod.rs#L22C1-L22C1(I know that doesn't have a semantic meaning in this case, but it illustrates how widespread it is to indicate a version using a prefix of
v
.)Further, other tools like
npm
allow a prefix ofv
(e.g.npm install [email protected]
), which is an inconsistency that causes a small stumbling block when working with multiple web technologies.Proposed Solution
In order of preference:
v
before a semantic version number.v
and provide a helpful error message that includes something like:If you want to install a specific version, please run: cargo add [email protected]
Notes
No response
The text was updated successfully, but these errors were encountered: