0Previously, if the builder exported $VERSION in their environment (as
1past Gitian-building docs told them to), but their HEAD does not
2actually point to v$VERSION, their build outputs will differ from those
3of other builders.
4
5This is because the contrib/guix/guix-* scripts only ever act on the
6current git worktree, and does not try to check out $VERSION if $VERSION
7is set in the environment.
8
9Setting $VERSION only makes the scripts pretend like the current
10worktree is $VERSION.
11
12This problem was seen in jonatack's attestation for all.SHA256SUMS,
13where only his bitcoin-22.0rc3-osx-signed.dmg differed from everyone
14else's.
15
16Here is my deduced sequence of events:
17
181. Aug 27th: He guix-builds 22.0rc3 and uploads his attestations up to
19 guix.sigs
20
212. Aug 30th, sometime after POSIX time 1630310848: he pulls the latest
22 changes from master in the same worktree where he guix-built 22.0rc3
23 and ends up at 7be143a960e2
24
253. Aug 30th, sometime before POSIX time 1630315907: With his worktree
26 still on 7be143a960e2, he guix-codesigns. Normally, this would result
27 in outputs going in guix-build-7be143a960e2, but he had
28 VERSION=22.0rc3 in his environment, so the guix-* scripts pretended
29 like he was building 22.0rc3, and used 22.0rc3's guix-build directory
30 to locate un-codesigned outputs and dump codesigned ones.
31
32 However, our SOURCE_DATE_EPOCH defaults to the POSIX time of HEAD
33 (7be143a960e2), which made all timestamps in the resulting codesigned
34 DMG 1630310848, 7be143a960e2's POSIX timestamp. This differs from the
35 POSIX timestamp of 22.0rc3, which is 1630348517. Note that the
36 windows codesigning procedure does not consider SOURCE_DATE_EPOCH.
37
38We resolve this by only allowing VERSION overrides via the FORCE_VERSION
39environment variable.
Please ignore the branch name, it’s not relevant to the change.