Odin icon indicating copy to clipboard operation
Odin copied to clipboard

Keep version constant when recompiling source for tagged releases on arbitrary date

Open cho-m opened this issue 3 years ago • 0 comments
trafficstars

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:

  1. Get the information from git tag
  2. Modify the version number to not use date when creating a tagged release.
  3. Provide a manual option like a variable that can be set during build.

cho-m avatar May 06 '22 21:05 cho-m