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

Where should cargo verify-project go? #14679

Open
weihanglo opened this issue Oct 12, 2024 · 2 comments
Open

Where should cargo verify-project go? #14679

weihanglo opened this issue Oct 12, 2024 · 2 comments
Labels
C-feature-request Category: proposal for a feature. Before PR, ping rust-lang/cargo if this is not `Feature accepted` Command-verify-project S-needs-team-input Status: Needs input from team on whether/how to proceed.

Comments

@weihanglo
Copy link
Member

Problem

I never found cargo verify-project useful. It never checks semantics of Cargo.toml. What it does is merely

  • Locating a workspace.
  • Parsing Cargo.toml and ensuring that be valid TOML, during the course of locating a workspace.

I don't know if in the wild it is heavily used, but apparently on GitHub it's not (see this search result). It also causes confusions like people expecting it to verify more stuff (#11202).

I wonder if it's time to decide how this command should be.

Proposed Solution

We have at least two choices.

  • Make it clear that what cargo verify-project verifies. Perhaps at this moment only TOML syntax. We could expand to simple manifest semantic, though the line will never be clear and can't be a complete verification.

  • Mark cargo verify-project as deprecated. Whomever want to use it could continue, though we don't add any support in the future.

    cargo locate-project --workspace might be a good alternative. (Well, not completely. locate-project additionally checks UTF8 for some unknown reason. And IMO it should be allowed.)

Notes

Commit: e8adba9

@weihanglo weihanglo added C-feature-request Category: proposal for a feature. Before PR, ping rust-lang/cargo if this is not `Feature accepted` Command-verify-project S-needs-team-input Status: Needs input from team on whether/how to proceed. labels Oct 12, 2024
@weihanglo
Copy link
Member Author

This is the oldest commit I found 4de86d2 relevant. Looks like cargo-verify-project ought to be more useful than it is now.

cargo/README.md

Lines 32 to 39 in 4de86d2

### cargo-verify
```
$ cargo verify --manifest=MANIFEST
```
Verifies that the manifest is in the location specified, in a valid
format, and contains all of the required sections.

@epage
Copy link
Contributor

epage commented Oct 13, 2024

... I wonder if this predates the rename of project to package which would explain why it uses project in the name.

In general, I want to re-examing our plumbing and see if there is a better route to go, inspired by the Argon/smelt ideas.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
C-feature-request Category: proposal for a feature. Before PR, ping rust-lang/cargo if this is not `Feature accepted` Command-verify-project S-needs-team-input Status: Needs input from team on whether/how to proceed.
Projects
None yet
Development

No branches or pull requests

2 participants