Odin
Odin copied to clipboard
Keep version constant when recompiling source for tagged releases on arbitrary date
Currently, the version number is set based on output of date, which means that rebuilding source from dev-YYYY-MM tag will producible different version numbers when re-built in a future month/year.
https://github.com/odin-lang/Odin/blob/6b89ff43eaa621aa4bdb859e367b6d85ea96676e/build_odin.sh#L8
I saw this in Homebrew (https://github.com/Homebrew/homebrew-core/pull/97679#issuecomment-1086928398) when building dev-2022-03 in April before dev-2022-04 was released.
For 3rd-party builds like Homebrew, it is possible that a rebuild will be needed on some arbitrary date, like when there are incompatibles with dependencies (e.g. llvm updates). So, keeping version number constant improves reproducibility of builds.
There are various ways to deal with this. Some examples:
- Get the information from git tag
- Modify the version number to not use
datewhen creating a tagged release. - Provide a manual option like a variable that can be set during build.