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

Allow any string for version field if publish = false #14083

Closed
wiiznokes opened this issue Jun 16, 2024 · 3 comments
Closed

Allow any string for version field if publish = false #14083

wiiznokes opened this issue Jun 16, 2024 · 3 comments
Labels
A-manifest Area: Cargo.toml issues C-feature-request Category: proposal for a feature. Before PR, ping rust-lang/cargo if this is not `Feature accepted` S-needs-info Status: Needs more info, such as a reproduction or more background for a feature request. S-propose-close Status: A team member has nominated this for closing, pending further input from the team

Comments

@wiiznokes
Copy link

wiiznokes commented Jun 16, 2024

Problem

I'm creating an application, and i would like to use a different type of version format that semver. I know i could use an env var for this, and i will probably do this, but specify the version in the version field will have some benefit for me:

  • automatic support for clap
  • automatic support for cargo-packager

Proposed Solution

Allow any string to be used when publish = false.

Notes

No response

@wiiznokes wiiznokes added C-feature-request Category: proposal for a feature. Before PR, ping rust-lang/cargo if this is not `Feature accepted` S-triage Status: This issue is waiting on initial triage. labels Jun 16, 2024
@weihanglo
Copy link
Member

Thanks for the proposal. Looks like it is a duplicate of #6583? See also questions in this comment #6583 (comment). Note that if it is meant to be published to crates.io, then the version is required to follow SemVer. If not, #12786 makes package.version optional so you can just omit the field.

@weihanglo weihanglo added S-needs-info Status: Needs more info, such as a reproduction or more background for a feature request. and removed S-triage Status: This issue is waiting on initial triage. labels Jun 16, 2024
@weihanglo
Copy link
Member

Okay it is not effectively a duplicate. I can see the benefit of clap auto-populating the value. However, the proposed change will complicate Cargo internals and how external tools parsing the field quite a bit. We may need more use cases so can weigh between those options.

@weihanglo weihanglo added the A-manifest Area: Cargo.toml issues label Jun 16, 2024
@epage epage added the S-propose-close Status: A team member has nominated this for closing, pending further input from the team label Jun 21, 2024
@epage
Copy link
Contributor

epage commented Jun 21, 2024

While not a duplicate of #6583, an important shared part to them is whether the version string is meant solely for the use of publishing or to also meet other needs (marketing version, PIP version, etc).

This also has the workaround that tools that want a non-registry version could use package.metadata.

With that, I would lean towards closing this as not planned.

@wiiznokes wiiznokes closed this as not planned Won't fix, can't repro, duplicate, stale Jun 21, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-manifest Area: Cargo.toml issues C-feature-request Category: proposal for a feature. Before PR, ping rust-lang/cargo if this is not `Feature accepted` S-needs-info Status: Needs more info, such as a reproduction or more background for a feature request. S-propose-close Status: A team member has nominated this for closing, pending further input from the team
Projects
None yet
Development

No branches or pull requests

3 participants