-
-
Notifications
You must be signed in to change notification settings - Fork 3.1k
Improve the error message when running cargo add cubing @v0.5.0 #12331
Copy link
Copy link
Closed
Labels
C-feature-requestCategory: proposal for a feature. Before PR, ping rust-lang/cargo if this is not `Feature accepted`Category: proposal for a feature. Before PR, ping rust-lang/cargo if this is not `Feature accepted`Command-addS-acceptedStatus: Issue or feature is accepted, and has a team member available to help mentor or reviewStatus: Issue or feature is accepted, and has a team member available to help mentor or review
Description
Activity
Metadata
Metadata
Assignees
Labels
C-feature-requestCategory: proposal for a feature. Before PR, ping rust-lang/cargo if this is not `Feature accepted`Category: proposal for a feature. Before PR, ping rust-lang/cargo if this is not `Feature accepted`Command-addS-acceptedStatus: Issue or feature is accepted, and has a team member available to help mentor or reviewStatus: Issue or feature is accepted, and has a team member available to help mentor or review
This has now been rescoped to providing a good error message if a
vprefix is present, see #12331 (comment)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
vwhere possible, asvX.Y.Ztends 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 canonicalcargotest for for atagdependency 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
npmallow a prefix ofv(e.g.npm install cubing@v0.38.1), which is an inconsistency that causes a small stumbling block when working with multiple web technologies.Proposed Solution
In order of preference:
vbefore a semantic version number.vand provide a helpful error message that includes something like:If you want to install a specific version, please run: cargo add cubing@0.5.0Notes
No response