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

feat(toml): Add support for setting the default package version (#6583) #14919

Closed

Conversation

sunhaitao
Copy link

Allow changing the default package version by setting the CARGO_SUGGESTED_PKG_VERSION environment variable.

…-lang#6583)

Allow changing the default package version by setting the `CARGO_SUGGESTED_PKG_VERSION` environment variable.
@rustbot
Copy link
Collaborator

rustbot commented Dec 11, 2024

Thanks for the pull request, and welcome! The Rust team is excited to review your changes, and you should hear from @weihanglo (or someone else) some time within the next two weeks.

Please see the contribution instructions for more information. Namely, in order to ensure the minimum review times lag, PR authors and assigned reviewers should ensure that the review label (S-waiting-on-review and S-waiting-on-author) stays updated, invoking these commands when appropriate:

  • @rustbot author: the review is finished, PR author should check the comments and take action accordingly
  • @rustbot review: the author is ready for a review, this PR will be queued again in the reviewer's queue

@rustbot rustbot added A-documenting-cargo-itself Area: Cargo's documentation A-manifest Area: Cargo.toml issues S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. labels Dec 11, 2024
@@ -566,7 +567,16 @@ fn normalize_package_toml<'a>(
.clone()
.map(|value| field_inherit_with(value, "version", || inherit()?.version()))
.transpose()?
.map(manifest::InheritableField::Value),
.map(manifest::InheritableField::Value)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the contribution, though this PR seems incomplete. How does this one play well with SemVer? How does the env affect the entire dependency graph?

Note that there are a couple of different use cases in #6583. The design of it is not yet settled, so I am going to mark this as draft. In Cargo we encourage discussions before implementations. See https://doc.crates.io/contrib/process/working-on-cargo.html#before-hacking-on-cargo

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Note that its not just S-needs-design or S-needs-team-input but its S-propose-close.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes. Going to close this as it is incomplete and unlikely to merge. Feel free to put your use cases in #6583 and we may consider changing its label status.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It plays as well as current practices with SemVer. When building multiple packages in a call of cargo, all unversioned packages will be affected -- as many similar tools for other languages. I'll post more details on #6583.

@weihanglo weihanglo linked an issue Dec 11, 2024 that may be closed by this pull request
@weihanglo weihanglo marked this pull request as draft December 11, 2024 14:47
@weihanglo weihanglo closed this Dec 11, 2024
@sunhaitao sunhaitao deleted the cargo_suggested_pkg_version branch December 12, 2024 02:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-documenting-cargo-itself Area: Cargo's documentation A-manifest Area: Cargo.toml issues 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.

4 participants