Exposing Git Information in Rust Binaries Built With Nix

12 points by jeezy


rtpg

In the past I had a similar issue with an app reporting its version and git ref... which would mean that tests written up in Bazel would not be able to cache results because the git ref would always change!

Ended up with the tests being run with the version being a "fake" git ref... kinda hard to do anything else in that scenario IMO. You do open the floodgates a bit to the reality that your test environment is never going to be exactly identical to the prod one. But you can still try

max-headroom

The branch does not matter. There is no difference between the source tree of a commit "deadbeefdeadbeefdeadbeef" on master, and the same commit on a feature branch, so why should there be a difference in the build output?