Reproducible build and prelease information
Jesse Rehmer
jesse.rehmer at blueworldhosting.com
Fri Nov 18 19:37:03 UTC 2022
> On Nov 18, 2022, at 1:32 PM, Julien ÉLIE <julien at trigofacile.com> wrote:
>
> Also, when building a prerelease version of INN, support/mkversion adds the current date (YYYYMMDD) in the source code, so that it is displayed for instance in the NNTP greeting banner.
> In order to make the build reproducible, I suggest an improvement for people building from Git (the date used will be the one of the latest commit instead of the current date). Otherwise, it won't change from the current behaviour.
>
> if [ x"$extra" = x"prerelease" ]; then
> # Ensure a reproducible build when the source code has not changed.
> LAST_COMMIT_DATE=$(git log -1 --pretty=%cd --date=format:%Y%m%d 2>/dev/null | tr -d '-')
> if [ -n "$LAST_COMMIT_DATE" ]; then
> date="$LAST_COMMIT_DATE"
> else
> date=$(date +%Y%m%d)
> fi
> extra="$date $extra"
> fi
>
>
> Does someone see any drawback with that?
> (The inn-CURRENT-20221118 snapshot would advertise 20221004 as the date of the latest commit, instead of the date of the build.)
I think this approach is good. While I don’t do much development or testing, it makes sense for the version information to reflect the Git commit or branch the source came from instead of the build date.
Cheers,
Jesse Rehmer
More information about the inn-workers
mailing list