-
Notifications
You must be signed in to change notification settings - Fork 2.3k
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
Export the vcs information as environment variable #11456
Comments
Thanks for the proposal. I am not quite sure what you mean by "exported as environment variable". Could you clarify what your scenario is and what you expect to see having those environment variables? It could be exposed either for crates, build scripts, external subcommands, or even If you just want to get those infos in your crate via Lines 47 to 68 in 7bdb969
Besides, there is no guarantee that the users has Git installed. A user may use arbitrary VCS tool, though in Cargo the support of Git is way better than others. The other issue is when to extract those infos. We may not want to choke Cargo in every launch to check VCS info (though Cargo already did that to some extent). |
I assumed that it uses libgit2 for it as |
I see. I understand you as trying to get the information at compile time via |
the git-describe-like GIT_VERSION as built is preferable but anything would be nice to have. |
imo |
Mainly you avoid building again and again depedencies that are not light. I opened this issue after I got enough people complaining after we used |
Though you've since made |
Our downstreams have an userbase of enthusiasts and without knowing the commit hash gets fairly difficult to figure out exactly what went wrong :) |
At the same time we have distributions that are very happy to use just the release tarballs and want to optimize the build time as much as they could. My patch making the git components optional should make most people using rav1e happy, but I'd rather move the the fix up in the toolchain since cargo needs to be aware of git already. |
Problem
Cargo is aware of the vcs information of the tree it is building, would be great to have it exported as environment variable.
Proposed Solution
Populate
CARGO_VCS_VERSION
,CARGO_VCS_VERSION_LONG
with a compact and a long representation of the current tree, e.g. whatgit describe --tags
and the full commit hash.Notes
No response
The text was updated successfully, but these errors were encountered: