Skip to content

Commit 8f76f9f

Browse files
committed
Merge bitcoin/bitcoin#22531: guix: Fixes to guix-{attest,verify}
9b313df guix: Ensure EPOCH_SOURCE_DATE does not include GPG information (Andrew Chow) 43225f0 guix: Remove extra \r from all.SHA256SUMS line ending (Andrew Chow) d080c27 guix, doc: Add a note that codesigners need to rebuild after tagging (Andrew Chow) 4a46638 guix: Allow changing the base manifest in guix-verify (Andrew Chow) 33455c7 guix: Make all.SHA256SUMS rather than codesigned.SHA256SUMS (Andrew Chow) Pull request description: `guix-verify` expects `all.SHA256SUMS` but `guix-attest` produces `codesigned.SHA256SUMS`. Since `all.SHA256SUMS` makes more sense (as the file contains all the sha256sums, not just the codesigned ones), `guix-attest` has been changed to output a file of that name. As a quality of life improvement, `guix-verify` can take `SIGNER` and use the signer's manifest as the base to compare against. This makes it easier to compare a single person's attestations with everyone else's and can make it more obvious when one builder is clearly mismatching with everyone else. Lastly `release-process.md` is updated with a note about a gotcha that can cause a mismatch in the codesigned attestation. ACKs for top commit: fanquake: ACK 9b313df Tree-SHA512: 0d60627def38288dbd3059ad1e72cad224f9205da11b1a561c082ef28250a074df5cc5f2797c91a7be027bc486a3fda3319c2e496a8724e5b539337236c6f990
2 parents be92dc5 + 9b313df commit 8f76f9f

File tree

5 files changed

+38
-10
lines changed

5 files changed

+38
-10
lines changed

contrib/guix/guix-attest

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -207,29 +207,28 @@ mkdir -p "$outsigdir"
207207
exit 1
208208
fi
209209

210-
temp_codesigned="$(mktemp)"
211-
trap 'rm -rf -- "$temp_codesigned"' EXIT
210+
temp_all="$(mktemp)"
211+
trap 'rm -rf -- "$temp_all"' EXIT
212212

213213
if (( ${#codesigned_fragments[@]} )); then
214214
# Note: all.SHA256SUMS attests to all of $sha256sum_fragments, but is
215215
# not needed if there are no $codesigned_fragments
216216
cat "${sha256sum_fragments[@]}" \
217217
| sort -u \
218218
| sort -k2 \
219-
| sed 's/$/\r/' \
220219
| rfc4880_normalize_document \
221-
> "$temp_codesigned"
222-
if [ -e codesigned.SHA256SUMS ]; then
220+
> "$temp_all"
221+
if [ -e all.SHA256SUMS ]; then
223222
# The SHA256SUMS already exists, make sure it's exactly what we
224223
# expect, error out if not
225-
if diff -u all.SHA256SUMS "$temp_codesigned"; then
224+
if diff -u all.SHA256SUMS "$temp_all"; then
226225
echo "An all.SHA256SUMS file already exists for '${VERSION}' and is up-to-date."
227226
else
228227
shasum_already_exists all.SHA256SUMS
229228
exit 1
230229
fi
231230
else
232-
mv "$temp_codesigned" codesigned.SHA256SUMS
231+
mv "$temp_all" all.SHA256SUMS
233232
fi
234233
else
235234
# It is fine to have the codesigned outputs be missing (perhaps the

contrib/guix/guix-build

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -232,7 +232,7 @@ host_to_commonname() {
232232
}
233233

234234
# Determine the reference time used for determinism (overridable by environment)
235-
SOURCE_DATE_EPOCH="${SOURCE_DATE_EPOCH:-$(git log --format=%at -1)}"
235+
SOURCE_DATE_EPOCH="${SOURCE_DATE_EPOCH:-$(git -c log.showSignature=false log --format=%at -1)}"
236236

237237
# Execute "$@" in a pinned, possibly older version of Guix, for reproducibility
238238
# across time.

contrib/guix/guix-codesign

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -220,7 +220,7 @@ fi
220220
JOBS="${JOBS:-$(nproc)}"
221221

222222
# Determine the reference time used for determinism (overridable by environment)
223-
SOURCE_DATE_EPOCH="${SOURCE_DATE_EPOCH:-$(git log --format=%at -1)}"
223+
SOURCE_DATE_EPOCH="${SOURCE_DATE_EPOCH:-$(git -c log.showSignature=false log --format=%at -1)}"
224224

225225
# Execute "$@" in a pinned, possibly older version of Guix, for reproducibility
226226
# across time.

contrib/guix/guix-verify

Lines changed: 27 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,11 @@ cmd_usage() {
2828
cat <<EOF
2929
Synopsis:
3030
31-
env GUIX_SIGS_REPO=<path/to/guix.sigs> ./contrib/guix/guix-verify
31+
env GUIX_SIGS_REPO=<path/to/guix.sigs> [ SIGNER=<signer> ] ./contrib/guix/guix-verify
32+
33+
Example overriding signer's manifest to use as base
34+
35+
env GUIX_SIGS_REPO=/home/dongcarl/guix.sigs SIGNER=achow101 ./contrib/guix/guix-verify
3236
3337
EOF
3438
}
@@ -92,6 +96,17 @@ echo "--------------------"
9296
echo ""
9397
if (( ${#all_noncodesigned[@]} )); then
9498
compare_noncodesigned="${all_noncodesigned[0]}"
99+
if [[ -n "$SIGNER" ]]; then
100+
signer_noncodesigned="$OUTSIGDIR_BASE/$SIGNER/noncodesigned.SHA256SUMS"
101+
if [[ -f "$signer_noncodesigned" ]]; then
102+
echo "Using $SIGNER's manifest as the base to compare against"
103+
compare_noncodesigned="$signer_noncodesigned"
104+
else
105+
echo "Unable to find $SIGNER's manifest, using the first one found"
106+
fi
107+
else
108+
echo "No SIGNER provided, using the first manifest found"
109+
fi
95110

96111
for current_manifest in "${all_noncodesigned[@]}"; do
97112
verify "$compare_noncodesigned" "$current_manifest"
@@ -112,6 +127,17 @@ echo "--------------------"
112127
echo ""
113128
if (( ${#all_all[@]} )); then
114129
compare_all="${all_all[0]}"
130+
if [[ -n "$SIGNER" ]]; then
131+
signer_all="$OUTSIGDIR_BASE/$SIGNER/all.SHA256SUMS"
132+
if [[ -f "$signer_all" ]]; then
133+
echo "Using $SIGNER's manifest as the base to compare against"
134+
compare_all="$signer_all"
135+
else
136+
echo "Unable to find $SIGNER's manifest, using the first one found"
137+
fi
138+
else
139+
echo "No SIGNER provided, using the first manifest found"
140+
fi
115141

116142
for current_manifest in "${all_all[@]}"; do
117143
verify "$compare_all" "$current_manifest"

doc/release-process.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -160,6 +160,9 @@ Codesigner only: Sign the windows binaries:
160160
Enter the passphrase for the key when prompted
161161
signature-win.tar.gz will be created
162162

163+
Code-signer only: It is advised to test that the code signature attaches properly prior to tagging by performing the `guix-codesign` step.
164+
However if this is done, once the release has been tagged in the bitcoin-detached-sigs repo, the `guix-codesign` step must be performed again in order for the guix attestation to be valid when compared against the attestations of non-codesigner builds.
165+
163166
Codesigner only: Commit the detached codesign payloads:
164167

165168
```sh

0 commit comments

Comments
 (0)