You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Commit 528358e
Browse filesBrowse the repository at this point in the historyBrowse files
Generate the expected turbo extension version on autoloader dump
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
if [ "$INSTALLED" != "$SUPPORTED_PHP_PARSER_VERSION" ]; then
246
256
echo "::error::nikic/php-parser was updated to $INSTALLED but turbo-ext/src/parser/ was ported against $SUPPORTED_PHP_PARSER_VERSION."
247
-
echo "::error::Update procedure: diff ParserAbstract.php helpers between the two versions (grammar tables need nothing — they are read at run time), run turbo-ext/bin/generate-parser-actions.php and port any flagged closure bodies via action-overrides/, run turbo-ext/tests/parser-corpus.php and turbo-ext/tests/parser-upstream-corpus.php until byte-identical, run the full suite, then bump SUPPORTED_PHP_PARSER_VERSION here and the extension version pin."
257
+
echo "::error::Update procedure: diff ParserAbstract.php helpers between the two versions (grammar tables need nothing — they are read at run time), run turbo-ext/bin/generate-parser-actions.php and port any flagged closure bodies via action-overrides/, run turbo-ext/tests/parser-corpus.php and turbo-ext/tests/parser-upstream-corpus.php until byte-identical, run the full suite, then bump SUPPORTED_PHP_PARSER_VERSION here."
248
258
exit 1
249
259
fi
250
260
@@ -253,17 +263,8 @@ jobs:
253
263
php turbo-ext/bin/generate-parser-actions.php
254
264
git diff --exit-code turbo-ext/src/parser/
255
265
256
-
- name: "Check TurboExtensionEnabler::EXPECTED_EXTENSION_VERSION against the last commit touching turbo-ext/src"
266
+
- name: "Check turbo-ext/VERSION.txt is not committed"
echo "::error::TurboExtensionEnabler::EXPECTED_EXTENSION_VERSION must be the short SHA of the last commit touching turbo-ext/src/."
264
-
echo "::error::After changing the native side, verify the implementations still match and add a follow-up commit setting the constant to that commit's short SHA (the binary bakes its version from git at build time). Compute it only after the change lands on the target branch — a pull request commit gets a new SHA when rebased."
265
-
exit 1
266
-
fi
267
268
# VERSION.txt is generated into the phpstan/turbo-ext subsplit by
268
269
# subsplit-turbo-ext.yml; a copy committed here would go stale and
269
270
# silently win over git in phpize builds.
@@ -328,7 +329,7 @@ jobs:
328
329
- name: "Verify the built extension reports the expected version"
Copy file name to clipboardExpand all lines: CLAUDE.md
+1-1Lines changed: 1 addition & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -262,7 +262,7 @@ Every threshold, fan-out cap, recursion bound, or collection-size limit must be
262
262
263
263
### Classes marked with `#[ShadowedByTurboExtension]` have a native C++ mirror
264
264
265
-
Classes carrying the `PHPStan\Turbo\ShadowedByTurboExtension` attribute are reimplemented natively by the phpstan_turbo extension; the attribute names the `.cpp` file implementing it (`build/generate-turbo-manifest.php` derives the full map into `vendor/turbo-shadowed-classes.json` on composer dump-autoload). The two implementations must behave identically — analysis output is bit-for-bit identical with the extension on or off. When editing such a class, always check whether the `.cpp` mirror in `turbo-ext/` needs the same change; if it does, port it following `turbo-ext/CLAUDE.md` (method parity check, differential smoke test, full test suite with the extension loaded). Any commit touching `turbo-ext/src/` requires the follow-up commit bumping `TurboExtensionEnabler::EXPECTED_EXTENSION_VERSION` to that commit's short SHA — run `make bump-turbo`.
265
+
Classes carrying the `PHPStan\Turbo\ShadowedByTurboExtension` attribute are reimplemented natively by the phpstan_turbo extension; the attribute names the `.cpp` file implementing it (`build/generate-turbo-manifest.php` derives the full map into `vendor/turbo-shadowed-classes.json` on composer dump-autoload). The two implementations must behave identically — analysis output is bit-for-bit identical with the extension on or off. When editing such a class, always check whether the `.cpp` mirror in `turbo-ext/` needs the same change; if it does, port it following `turbo-ext/CLAUDE.md` (method parity check, differential smoke test, full test suite with the extension loaded). The extension version is the short SHA of the last commit touching `turbo-ext/src/`, baked into the binary at build time and written into `vendor/turbo-extension-version.php` on composer dump-autoload (and by `make build-turbo`) — there is nothing to bump.
266
266
267
267
New introduced classes in these categories should be shadowed with a native C++ mirror in the same commit:
if [ -n"$$BUILT" ] && [ "$$BUILT"!="$$EXPECTED" ];then \
247
-
echo"warning: TurboExtensionEnabler expects $$EXPECTED, so this build would load but stay inactive (run 'make bump-turbo' once the turbo-ext/src commit is in)";\
248
-
fi
249
-
250
-
# The expected turbo version is the short SHA of the last commit touching
251
-
# turbo-ext/src (enforced by the phar.yml turbo-version job), so the bump can
252
-
# never be part of the commit it points at. Refreshes an unpushed bump commit
253
-
# in place — after a rebase gives the watched commit a new SHA, rerunning
254
-
# this amends instead of stacking a second bump commit.
255
-
.PHONY: bump-turbo
256
-
bump-turbo:
257
-
@if [ -n"$$(git status --porcelain -- turbo-ext/src)" ];then\
258
-
echo"turbo-ext/src has uncommitted changes — commit them first, the expected version is the short SHA of the last commit touching turbo-ext/src";\
259
-
exit 1;\
260
-
fi;\
261
-
if! git diff --quiet HEAD -- src/Turbo/TurboExtensionEnabler.php;then \
262
-
echo"src/Turbo/TurboExtensionEnabler.php has uncommitted changes — commit or stash them first";\
0 commit comments