Repository navigation
Generate the expected turbo extension version on autoloader dump - #6784
Merged
Merged
Conversation
TurboExtensionEnabler no longer carries the expected version as a hand-maintained constant. build/generate-turbo-manifest.php writes it into vendor/turbo-extension-version.php from the same git computation the extension's Makefile bakes into the binary (the short SHA of the last commit touching turbo-ext/src), so a binary built from a checkout matches that checkout by construction. The phar compilation dumps the autoloader too and packs the file, so the phar carries the version of the commit it was compiled from. `make build-turbo` regenerates the file, so a rebuild after a turbo-ext/src commit needs no extra dump. The `bump-turbo` target, the follow-up "Bump expected turbo version" commits and the CI check of the constant are gone; the workflows compare the built binaries against `php build/turbo-extension-version.php`, and the compiler job checks the version packed in the phar. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_013qRnM7saDyd5yKXxJAnR7o
ondrejmirtes
force-pushed
the
turbo-generated-version
branch
from
October 23, 2026 07:31
3111dd0 to
409c3e0
Compare
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.
Every commit touching
turbo-ext/src/used to need a follow-up "Bump expected turbo version" commit settingTurboExtensionEnabler::EXPECTED_EXTENSION_VERSIONto that commit's short SHA, recomputed again after every rebase.Now the expected version is generated instead of maintained by hand:
build/PHPStan/Build/TurboExtensionVersion.phpcomputes it the same way the extension's Makefile bakes it into the binary:git log -1 --format=%H -- turbo-ext/src, first 7 characters (null without a usable git checkout, which keeps the extension inactive).build/generate-turbo-manifest.phpwrites it intovendor/turbo-extension-version.phpon every autoloader dump, next to the manifest and the class map.TurboExtensionEnabler::getExpectedVersion()reads it, replacing the constant.box.jsonpacks the file, so the phar carries the version of the commit it was compiled from. A new step in the compiler job reads it out of the built phar and compares it against git.make build-turboreruns the generator, so a rebuild after aturbo-ext/srccommit needs no extracomposer dump-autoload(a plainmakeinturbo-ext/does).php build/turbo-extension-version.php, which needs no Composer dependencies and runs in the compile jobs and Alpine containers too.make bump-turbo, theturbo-versionjob's constant check, the.typos.tomlexception for the constant, and the bump instructions in the docs.Branches still carrying "Bump expected turbo version" commits will conflict on the removed constant when rebased; drop those commits.
🤖 Generated with Claude Code
https://claude.ai/code/session_013qRnM7saDyd5yKXxJAnR7o