Milestone
M0/M5 prerequisite — parent #1492. Breaks every fresh git clone + composer install + script/apply-patches.sh (and therefore north-star5-verify, ci-local, all selfhost probes) on master.
Problem
On a clean tree, script/apply-patches.sh aborts:
php-types-magic-script-const: TypeReconstructor anchor not found
apply-patches: 1 patch(es) failed
apply-patches.sh runs under set -euo pipefail, so the first failing overlay aborts the whole run — vendor patches after it never apply.
Root cause
php-types-yield-from.patch inserts a case 'Expr_YieldFrom': line into the resolveOp switch of vendor/ircmaxell/php-types/lib/PHPTypes/TypeReconstructor.php:
case 'Expr_Yield':
case 'Expr_YieldFrom': // inserted by php-types-yield-from.patch
case 'Expr_Include':
// TODO: we may be able to determine these...
return false;
It runs before the apply_php_types_magic_script_const_overlay and apply_php_types_first_class_callable_overlay overlays. Those overlays anchor on the pre-yield-from text (Expr_Yield immediately followed by Expr_Include), so after yield-from has run, neither anchor matches and both overlays fail.
Fix
Include the case 'Expr_YieldFrom': line in all 6 anchor strings of the two overlays so they match the post-yield-from file. Verified: after the change script/apply-patches.sh applies cleanly (exit 0) on a fresh clone and is idempotent on re-run.
Repro
git clone https://github.com/PurHur/php-compiler.git fresh && cd fresh
composer install --ignore-platform-reqs
./script/apply-patches.sh # aborts at php-types-magic-script-const on master
Done when
script/apply-patches.sh exits 0 on a fresh composer install tree
- Re-running is idempotent (all "Skip … already applied")
make north-star5-verify reaches its vendor-prelink steps without a patch abort
Milestone
M0/M5 prerequisite — parent #1492. Breaks every fresh
git clone+composer install+script/apply-patches.sh(and thereforenorth-star5-verify,ci-local, all selfhost probes) onmaster.Problem
On a clean tree,
script/apply-patches.shaborts:apply-patches.shruns underset -euo pipefail, so the first failing overlay aborts the whole run — vendor patches after it never apply.Root cause
php-types-yield-from.patchinserts acase 'Expr_YieldFrom':line into theresolveOpswitch ofvendor/ircmaxell/php-types/lib/PHPTypes/TypeReconstructor.php:It runs before the
apply_php_types_magic_script_const_overlayandapply_php_types_first_class_callable_overlayoverlays. Those overlays anchor on the pre-yield-from text (Expr_Yieldimmediately followed byExpr_Include), so after yield-from has run, neither anchor matches and both overlays fail.Fix
Include the
case 'Expr_YieldFrom':line in all 6 anchor strings of the two overlays so they match the post-yield-from file. Verified: after the changescript/apply-patches.shapplies cleanly (exit 0) on a fresh clone and is idempotent on re-run.Repro
Done when
script/apply-patches.shexits 0 on a freshcomposer installtreemake north-star5-verifyreaches its vendor-prelink steps without a patch abort