Skip to content

ci: cache vcpkg binary packages in the Windows build - #2683

Merged
dunglas merged 4 commits into
mainfrom
ci/vcpkg-binary-cache
Oct 2, 2026
Merged

dunglas merged 4 commits into
mainfrom
ci/vcpkg-binary-cache

Conversation

@dunglas

@dunglas dunglas commented Oct 1, 2026 •

Copy link
Copy Markdown
Member

The Windows build failed on main because vcpkg's download of the pthreads sources from SourceForge failed its hash check on every mirror (https://github.com/php/frankenphp/actions/runs/36826386435). The same file downloads with the correct hash outside GitHub Actions, so SourceForge is likely serving runners something other than the archive.

This PR saves vcpkg's built packages in the Actions cache. The cache key includes the runner image version and vcpkg.json. Sources are now downloaded only when the runner image or the manifest changes a package's hash, instead of on every run.

Release runs (tag pushes, scheduled builds, and versioned workflow_dispatch runs) now skip both the vcpkg and Go caches, so published binaries never come from restored cache entries. The same applies to the static macOS build and the release workflow.

SourceForge occasionally serves GitHub runners a body that fails the
pthreads source hash check, breaking the Windows build. Restore built
vcpkg packages from the Actions cache so sources are only downloaded
when the runner image or manifest changes.
Caching vcpkg's default archives directory removes the custom binary
source. Tag builds publish release assets, so they skip the cache
restore, matching setup-go and satisfying zizmor's cache-poisoning
audit.
Scheduled and versioned workflow_dispatch runs upload release assets
too, not only tag pushes. Gate both caches on REF, which is set for all
three. zizmor only recognizes the tag-ref expression, so its
cache-poisoning finding is ignored on the vcpkg step.
Scheduled static builds publish release binaries without a tag ref, and
the release workflow commits a PGO profile built on the runner. Disable
the Go cache for both, as already done for the Windows build.
@dunglas
dunglas merged commit cab7033 into main Oct 2, 2026
42 of 43 checks passed
@dunglas
dunglas deleted the ci/vcpkg-binary-cache branch October 2, 2026 06:10
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.

1 participant