Skip to content

The Windows release build takes protoc from protobuf's own pinned zip and stops at once without it - #301

Merged
pitis merged 2 commits into
mainfrom
fix/windows-protoc
Nov 29, 2026
Merged

pitis merged 2 commits into
mainfrom
fix/windows-protoc

Conversation

@pitis

@pitis pitis commented Nov 29, 2026 •

Copy link
Copy Markdown
Owner

What changed

  • .github/workflows/release.yml, Windows job: protoc no longer comes from Chocolatey. The "Rust and protoc" step downloads protobuf's own release zip, protoc-36.2-win64.zip from github.com/protocolbuffers/protobuf (curl -f --retry 5), checks it against its pinned SHA-256 (sha256sum -c; the hash matches the one GitHub lists for the asset and a local download), unpacks it with 7-Zip into $RUNNER_TEMP/protoc and puts its bin on GITHUB_PATH. A failed download, a wrong hash or a broken zip fails that step.
  • Build step: its first line is protoc --version, so the build looks protoc up the same way the build scripts do (PATH), and a missing protoc fails the step at once (exit 127), not 4 minutes later in spqr's build script.
  • Version: 36.2 is what Chocolatey installed for the earlier green releases (protoc-36.2-win64.zip, in run 46309832317's log) and what local macOS builds use; prost-build 0.14.4 (core/Cargo.lock) works with it.
  • Hardening unchanged: actions still pinned to full SHAs, top-level contents: read, contents: write only on the two upload jobs, GH_TOKEN only on the Upload steps, persist-credentials: false. The download needs no token.
  • Linux job: no change. Its protoc comes from apt-get install -yq ... protobuf-compiler, which exits 100 when a package can't be found or fetched, and the step's shell is bash -e: it can't succeed with protoc missing the way choco did (0/0 packages installed, exit 0).

Why

The v0.1.2 Windows job (run 46310803851) failed: choco install protoc got an error from the Chocolatey community feed, installed 0/0 packages, exited 0, and the build died minutes later with "Could not find protoc".

How it was tested

Release workflows run from the tag's commit, so each run below is a throwaway pre-release on a throwaway branch; all three releases, their tags (remote and local) and the branches were deleted afterwards. No v… release was touched.

  • The change, for real: run 46316821885 (test-299-1, this PR's commit b6517b3), both jobs green. Windows: protoc.zip: OK, unpacked, the protoc step took 10 s (Chocolatey's took over a minute); the Build step printed libprotoc 36.2 and built in 12m35s; the start check passed (hush.log has Hush started version=test-299-1); uploaded Hush-test-299-1-windows-x64.zip (25 MB). Linux: green as before, uploaded its tarball.
  • Probe: a wrong hash (test-299-2, one digit of PROTOC_SHA256 changed): sha256sum: WARNING: 1 computed checksum did NOT match, protoc.zip: FAILED, the step failed 25 s into the job; nothing after it ran.
  • Probe: protoc not on PATH (test-299-3, the GITHUB_PATH line removed): the Build step's first line failed with protoc: command not found (exit 127), 27 s into the job, before cargo started. This also shows the runner image has no protoc of its own, so the build uses the pinned one.
  • Both probes' Linux jobs were cancelled (not needed).
  • actionlint 1.7.12 with shellcheck 0.11: clean (installed into a scratch folder).
  • make check on the head, up to date with main: pass (fmt, both clippy runs, 402 + 553 tests).

Closes #299

@pitis

pitis commented Nov 29, 2026

Copy link
Copy Markdown
Owner Author

Review (pr-review-toolkit:review-pr: code, silent failures, comments)

No Critical or Important findings. The reviewers checked that the pinned hash matches GitHub's digest for the asset, that each command in the protoc step fails the step under bash -e -o pipefail (curl -f, sha256sum -c - with an empty hash or a missing file, every non-zero 7-Zip exit), and that the hardening is unchanged. They also checked that every build-time protoc user finds the pinned protoc: the prost-build crates read PROTOC, then PATH, and libsignal's protobuf-parse reads PATH only, which is why the fix puts protoc on PATH. The green run was a cold build (no cache), so every protoc-using build script really ran with it. The Linux apt-get install can't exit 0 with protoc missing: it exits 100.

Suggestions:

  • Comment, lines 38-39: it said Chocolatey's feed exits 0 (it's choco install), and "the earlier releases" was vague. Fixed in a81f4e5: "choco install can fail on its feed and still exit 0", "for v0.1 to v0.1.6". Comment only, so no new run.
  • curl --retry-all-errors (retry a connection reset or TLS failure too): declined. Timeouts and HTTP 408/429/5xx already retry, and the other errors fail the step at once with curl's message. A failed run re-runs with gh workflow run release.yml -f tag=v…. The flag would also retry a real 404 for about 30 s, and the command as it stands is the one the run proved.
  • Check the version in the Build step (protoc --version | grep -F 'libprotoc 36.2'): declined. GITHUB_PATH puts the pinned protoc first, and probe 3 showed the image has no other protoc. Pinning the version a second time is one more place to update on a bump. The step prints the version, so the log shows which protoc ran (libprotoc 36.2 in the green run).

Gate on the head, which is up to date with main (make update: nothing to merge): make check passes (fmt, both clippy runs, 402 + 553 tests). actionlint 1.7.12 with shellcheck 0.11: clean.

@pitis
pitis merged commit c3f74e7 into main Nov 29, 2026
@pitis
pitis deleted the fix/windows-protoc branch November 29, 2026 22:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

The Windows release build installs protoc reliably, or fails at once

1 participant