ci: stop the Windows binary check rebuilding PHP on every run - #208
Merged
Merged
Conversation
The job takes about 15 minutes. Profiling it: 727s Build static PHP binary 153s Combine PHP + PHAR -> binary 30s Install NASM 11s Smoke-test binary The build dominates, and it should not be running at all. The Linux job caches the same artefacts and its build step takes 1 second on a hit. The Windows cache was never saved: Failed to save: Unable to reserve cache with key spc-win32-x64-v1-php8.3-... so every run compiled PHP from scratch. The key included a hash of the whole workflow file, which gives a different key per branch and a fresh rebuild for any edit to the file — including edits to the Linux job or a comment. The key is now over the four values that actually determine the build: the SPC version, the PHP version, and the two extension lists. That is stable across branches, so the cache is written once and hit by everything after it. restore-keys are deliberately not used here. A prefix match would restore a buildroot compiled with a different extension set, and the result would be a binary quietly missing extensions — which is the failure this job exists to catch. The combine step piped a ~30 MB concatenation through PowerShell's object pipeline one byte at a time. A stream copy does it in about a second. The Linux job is untouched: its cache is restoring and its build takes 1s. Rewriting a working fast path for consistency would risk more than it gains. Expected: about 15 minutes on the first run that populates the cache, then roughly 1-2 minutes. Co-Authored-By: Claude <noreply@anthropic.com>
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.



The Windows job takes about 15 minutes on every pull request. Profiled:
The build should not be running at all
The Linux job caches the same artefacts, and its build step takes 1 second on a hit. The Windows cache was never being saved:
so every run compiled PHP from scratch.
The key included a hash of the whole workflow file, which produces a different key per branch and a fresh rebuild for any edit to that file — including edits to the Linux job, or a comment.
It is now keyed on the four values that actually determine the build: the SPC version, the PHP version, and the two extension lists. That is stable across branches, so the cache is written once and hit by everything afterwards.
restore-keysare deliberately not used. A prefix match would restore abuildrootcompiled with a different extension set, producing a binary quietly missing extensions — which is precisely the failure this job exists to catch.The combine step
Get-Content -AsByteStreampipes a ~30 MB concatenation through PowerShell's object pipeline one byte at a time. A stream copy does the same work in about a second.Linux is untouched
Its cache restores and its build takes 1s. Rewriting a working fast path for consistency would risk more than it gains — the diff here touches no Linux line.
Expected result
About 15 minutes on the first run, which populates the cache, then roughly 1–2 minutes.
🤖 Generated with Claude Code