Access to git version info in builds

Are there standard ways to get info such as the current Git revision ID into an executable during the cargo build process? There's CARGO_PKG_VERSION, but that's from Cargo.toml, not from Git.
The info you get from "git describe" would be fine as a "build ID".

(Yes, I could write a build script to run "git describe", but this seems like something that would already be available.)

The git_version crate provides macros that can query this for you during the build: git_version - Rust

Oh, that's great.

I didn't know you could cause a program to run at compile time without a build script.

This topic was automatically closed 90 days after the last reply. We invite you to open a new topic if you have further questions or comments.