docs: build in a fixed timezone to prevent heading date from varying.
Background
The problem reported in bug #1064404 is that the snapd binary package does not build reproducibly due to variance in manual page output when using golang-go-flags.
An initial attempt to solve the problem in merge request !7 (merged) was incomplete; the golang-go-flags has indeed added support for the prerequisite SOURCE_DATE_EPOCH environment variable -- but golang-go-flags also (and reasonably) localizes the output dates displayed in headerfiles to the build host's timezone.
This follow-up merge request resolves the problem by assigning a fixed, static timezone when building the manual page, as discussed in the bugreport message thread.
Test Results
The reprotest tool was used with timezone variance enabled; however, it was necessary to customize this slightly and to set the control and experimental values of TZ to file paths to zoneinfo files (as described below) rather than the default GMT+12 and GMT-14 values in the version used.
The customizations were:
- Control
TZ=/usr/share/zoneinfo/Etc/GMT+12 - Experiment
TZ=/usr/share/zoneinfo/Etc/GMT-14
Without patch applied (snapd-2.61.2)
$ DEB_BUILD_OPTIONS=nocheck reprotest --variations=timezone .
...
dpkg-buildpackage: info: binary-only upload (no source included)
Binary files /tmp/..path-was-here../control/snapd_2.61.2-2_amd64.deb and /tmp/..path-was-here../experiment-1/snapd_2.61.2-2_amd64.deb differ
With patch applied (snapd-2.61.2)
$ DEB_BUILD_OPTIONS=nocheck reprotest --variations=timezone .
...
dpkg-buildpackage: info: binary-only upload (no source included)
=======================
Reproduction successful
=======================
No differences in ./../*.*deb
8f07f82cb2755b24cb35c8304a764c912333d568411bab5368d36806347ae725 ./../golang-github-snapcore-snapd-dev_2.61.2-2_all.deb
13b7371ade8edbf0fe00a4ddb5d2b69b2e5b452ef7e8baef4d1e5edb2211add5 ./../snap-confine_2.61.2-2_amd64.deb
87f0ac259c945f4954f1e64b444c3053e3589fd95e87ca897db526787e4c3d00 ./../snapd-dbgsym_2.61.2-2_amd64.deb
ce5f1368807e25f1e7865d0dba6ffbd23de9fcd3a83fa672d168e4fbe1357acb ./../snapd_2.61.2-2_amd64.deb
3eadea91101f85f82db1f2b579fb798839a7451b7f2f4184a037f89b27ff5f9e ./../ubuntu-core-launcher_2.61.2-2_amd64.deb
However, other factors may still make the build unreproducible; try re-running with --vary=+all.
Related Items
Follow-up-for / relates-to commit d8befb23 (merge request !7 (merged)).
Closes #1064404.