feat: embed git SHA in version string #110
Reference in New Issue
Block a user
Delete Branch "feat/build-version"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Summary
Follow-up to #109. Addresses #108's request to distinguish release builds from source/AUR/main-branch builds.
build.rs(~40 LOC) that runsgit describe --tags --always --dirtyat compile time and setsNUMA_BUILD_VERSIONas a rustc env var.numa::version()function returns the build version everywhere: CLI (numa --version), dashboard header,/statsendpoint,/healthendpoint.CARGO_PKG_VERSIONwhen git is unavailable (source tarballs, Docker builds without.git).env!("CARGO_PKG_VERSION")call sites with the singleversion()function.Version strings by build context:
v0.13.1)0.13.10.13.1+a87f9070.13.1+a87f907-dirty0.13.1Test plan
make all— fmt + clippy + audit + 285 tests passnuma --versionon current branch →0.13.1+0118ab0-dirty(commits ahead + dirty).gitremoved → falls back to0.13.1(no crash, no build error)build.rsre-runs ongit HEADchange (tracked viacargo:rerun-if-changed)