Skip to content

Make it possible to override values in Cargo.toml from external source #7554

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

Closed
magnusart opened this issue Oct 29, 2019 · 2 comments
Closed
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`

Comments

@magnusart
Copy link

magnusart commented Oct 29, 2019

Describe the problem you are trying to solve
I wish to be able to set cargo package version from an external source. Maybe I'm ignorant but I could not figure out how to do this.

My use case is to correlate artifacts built with CI to specific commits. These artifacts I typically store for a longer period of time.

Example of a custom version would be running git describe --always --dirty --abbrev=7 --tags which could result in something like 1.0.0-RC1-10-g0a51bc6 (ten commits since git tag 1.0.0-RC1 with hash g0a51bc6).

Describe the solution you'd like
I would have expected to be able to do something like println!("cargo:package-version={}", myCustomVersion); in build.rs. Being able to override values in Cargo.toml I assume is a general use case.

@magnusart magnusart added the C-feature-request Category: proposal for a feature. Before PR, ping rust-lang/cargo if this is not `Feature accepted` label Oct 29, 2019
@ehuss ehuss added the A-manifest Area: Cargo.toml issues label Nov 8, 2019
@Kaiser1989
Copy link

Similar to this one:
#6583

@epage
Copy link
Contributor

epage commented Oct 27, 2023

While the title is generic, motivation and use cases are only for version. I'm going to close in favor of #6583 so we can keep all of the conversation around that in one place. If there is a reason we should reconsider this, let us know!

@epage epage closed this as not planned Won't fix, can't repro, duplicate, stale Oct 27, 2023
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`
Projects
None yet
Development

No branches or pull requests

4 participants