Skip to content

Commit d795117

Browse files
CryptoFewkaclaude
andcommitted
build: pin the WineGDK prefix directly (WINEGDK_PREFIX_SHA256)
The engine reuse path verified the released WineGDK prefix only by its attestation and its own published sidecar, so the prefix was pinned to a repo-committed value only transitively (via the final engine archive hash). Commit the reproducible prefix SHA as WINEGDK_PREFIX_SHA256 and assert it in both places: build-winegdk.yml fails closed if the packed prefix does not reproduce it, and build-engine.yml's reuse path verifies a downloaded prefix against it (fail fast, before packaging) in addition to the attestation. Every reused artifact is now checked against a committed expectation directly. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_014pmkUWS6teoMZUUnMJG7Gr
1 parent e98b396 commit d795117

4 files changed

Lines changed: 19 additions & 0 deletions

File tree

‎.github/workflows/build-engine.yml‎

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -96,6 +96,10 @@ jobs:
9696
gh attestation verify "${{ runner.temp }}/wg-dl/winegdk-prefix-${short}.tar.gz" \
9797
-R "${{ github.repository }}"
9898
(cd "${{ runner.temp }}/wg-dl" && sha256sum -c "winegdk-prefix-${short}.tar.gz.sha256")
99+
# Also fail closed unless the reused prefix matches the committed pin,
100+
# not just its own published sidecar.
101+
pin="$(grep -m1 '^WINEGDK_PREFIX_SHA256 = ' bol/config.py | cut -d'"' -f2)"
102+
echo "${pin} ${{ runner.temp }}/wg-dl/winegdk-prefix-${short}.tar.gz" | sha256sum -c -
99103
100104
- name: Unpack WineGDK prefix
101105
run: |

‎.github/workflows/build-winegdk.yml‎

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -90,6 +90,15 @@ jobs:
9090
--mtime=@1784308597 --owner=0 --group=0 --numeric-owner \
9191
-C /mnt/engine -cf - prefix | gzip -n -6 > "$out"
9292
sha="$(sha256sum "$out" | cut -d' ' -f1)"
93+
# Fail closed unless the prefix reproduces the committed pin.
94+
pin="$(grep -m1 '^WINEGDK_PREFIX_SHA256 = ' bol/config.py | cut -d'"' -f2)"
95+
echo "pinned : $pin"
96+
echo "built : $sha"
97+
if [ "$sha" != "$pin" ]; then
98+
echo "::error::WineGDK prefix SHA-256 does not match WINEGDK_PREFIX_SHA256;" \
99+
"the build did not reproduce the reviewed prefix." >&2
100+
exit 1
101+
fi
93102
echo "$sha $out" > "$out.sha256"
94103
{
95104
echo "sha256=$sha"

‎bol/config.py‎

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -75,5 +75,10 @@
7575
# SHA-256 of the reviewed, deterministic engine archive. An invalid value makes
7676
# the installer fail closed rather than accepting a differently packed engine.
7777
WINEGDK_ARCHIVE_SHA256 = "d501d9fa86a01f51cd8697cd7c8012ce9cf5eeac701b41a8feaafb694a9757b5"
78+
# SHA-256 of the deterministic WineGDK prefix tarball (build intermediate, not a
79+
# runtime download). build-winegdk.yml asserts it, and build-engine.yml verifies
80+
# a reused prefix against it, so the reuse path fails fast against a committed
81+
# expectation instead of only transitively via the engine archive hash above.
82+
WINEGDK_PREFIX_SHA256 = "e65d30369729260f6e8ea067e98b17c3c9460d1ed2190a0a570a11ad60836046"
7883

7984
SELF_REPO = WINEGDK_PREBUILT_REPO

‎docs/BUILD.md‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -89,6 +89,7 @@ not to loosen the check:
8989
SHA in `provenance.env` and `package-engine.sh`).
9090
- xcurl set → `OPENSSL_XCURL_REV` + `OPENSSL_XCURL_ARCHIVE_SHA256` (regenerate
9191
`third_party/xcurl-msys2.lock` if msys2 rotated a package off the mirror).
92+
- WineGDK prefix → `WINEGDK_PREFIX_SHA256` (the reuse path and `build-winegdk.yml` both assert it).
9293
- engine → `WINEGDK_ARCHIVE_SHA256` and the `bol/vkd3d.py` manifest pins.
9394

9495
## CI environment

0 commit comments

Comments
 (0)