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

Improve error when versions start with v #15259

Conversation

DeveloperC286
Copy link

@DeveloperC286 DeveloperC286 commented Mar 3, 2025

Fixes #12331

@rustbot
Copy link
Collaborator

rustbot commented Mar 3, 2025

r? @epage

rustbot has assigned @epage.
They will have a look at your PR within the next two weeks and either review your PR or reassign to another reviewer.

Use r? to explicitly pick a reviewer

@rustbot rustbot added A-cli Area: Command-line interface, option parsing, etc. A-interacts-with-crates.io Area: interaction with registries Command-yank S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. labels Mar 3, 2025
@epage epage changed the title 12331 semver v prefix compatibility Improve error when versions start with v Mar 4, 2025
@DeveloperC286 DeveloperC286 force-pushed the 12331_semver_v_prefix_compatibility branch 2 times, most recently from 5d420fb to e851db7 Compare March 4, 2025 01:22
@DeveloperC286 DeveloperC286 force-pushed the 12331_semver_v_prefix_compatibility branch from e851db7 to 466a8e2 Compare March 5, 2025 19:09
@DeveloperC286 DeveloperC286 force-pushed the 12331_semver_v_prefix_compatibility branch from eed5e97 to 3d3457a Compare March 6, 2025 20:10
@DeveloperC286
Copy link
Author

While working on this I have the questions

  1. Do we want to standardise the error messages for the same error across the commands?
  2. Do we want to support a v in a version range?

@epage
Copy link
Contributor

epage commented Mar 7, 2025

Do we want to standardise the error messages for the same error across the commands?

We should be consistent where it makes sense

Do we want to support a v in a version range?

As in not error? This was discussed in the issue and the issue is currently scoped to just improving the error messages. If there is a reason to reconsider that, the case should be made in the issue. We should probably still move forward with this PR.

@weihanglo
Copy link
Member

@DeveloperC286
I believe what Ed said is backing out the support of v prefix in this PR. That part is still in discussion. We should focus on improving the error messages in this PR.

@DeveloperC286
Copy link
Author

Oh okay, I got my wires crossed somewhere. I thought there was support for handing versions prefixed with 'v'.

While a version prefixed with a v is not strictly a semantic version it is commonly used, e.g. output by automated release tooling etc, so not supporting it just makes it harder to integrate with other tools.

I'm not sure I see the point if I run cargo install [email protected] of an error message saying did you mean 'cargo... @0.5.0'?. I think if your able to produce an error message that clear then the intent is clear and if the intent is clear I don't see the point in being pedantic and not just doing it.

@epage
Copy link
Contributor

epage commented Mar 11, 2025

Please see my earlier comment at #15259 (comment)

@DeveloperC286
Copy link
Author

I only have limited free time ATM and was doing this piecemeal, I think reworking this PR to just improved error messages takes me back basically to the start. Someone feel free to take this over, I will close this as I don't have the time ATM.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-cli Area: Command-line interface, option parsing, etc. A-interacts-with-crates.io Area: interaction with registries Command-add Command-install Command-yank S-waiting-on-review Status: Awaiting review from the assignee but also interested parties.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Improve the error message when running cargo add cubing @v0.5.0
4 participants