Skip to content

CI: master is unbuildable both from a clean checkout and on already-patched trees — the #36250 guard demands exactly one replaceVariablesByCfgWalk (a correctly patched file has two) and the pass-manager patch no longer lands on old trees, so every AOT build dies in the new light-opt step (script/apply-patches.sh, patches/php-cfg-simplifier-use-chain.patch, patches/php-llvm-module-createfunctionpassmanager.patch) (re-#36250, re-#36213, re-#36229) #36377

Description

@PurHur

Category

Regression: · the patch mechanism, third distinct master breakage in 36 h · child of #36188

Problem (master 1edb103c34, 2026-09-02, pinned image)

Clean checkout: rm -rf vendor && composer install --ignore-platform-reqs && script/apply-patches.sh →

php-cfg-simplifier-use-chain: expected exactly one replaceVariablesByCfgWalk
apply-patches rc=1

Pristine Simplifier.php contains 0 occurrences; git apply --check -p0 patches/php-cfg-simplifier-use-chain.patch applies cleanly and leaves 2 (the definition and its call). The guard added by the #36250 fix (6a…, "fix Simplifier use-chain guard for July-5 partial trees") encodes the July-5 partial state, not the correct end state, so every fresh tree — including every GitHub Actions run — fails in setup. Compiler gate and Bootstrap spine gate: 0 green runs on master in the last 60; the last 30 failures all die in apply-patches.sh.

Already-patched tree (the maintainer's, patched 2026-09-01): apply-patches.sh → ERROR: failed to apply php-llvm-module-createfunctionpassmanager.patch (the #36213 PR rewrote the patch to bind LLVMCreateFunctionPassManagerForModule, but the vendored Module.php:113 still calls the non-existent LLVMCreatePassManagerForModule), and because #36213 made the light pass pipeline default, every phpc build now dies:

PHP Fatal error: Uncaught Error: Call to undefined method llvm\llvm::LLVMCreatePassManagerForModule() in vendor/ircmaxell/php-llvm/lib/LLVMAbstract/Module.php:113
#0 lib/JIT/Context.php(3460): Module->createFunctionPassManager()
#1 lib/JIT/Context.php(3444): Context->runLightModuleOptimizationPasses()
aot-smoke: 0 passed, 9 failed

So the two populations of trees are broken in two different ways by two different wave-1 PRs, and dev-verify-fast/aot-smoke on the authors' boxes were green only because their vendor happened to be in a third state. This is exactly the failure #36229 (open, unclaimed) describes; each per-patch fix has produced the next breakage (#36143 → #36209 → #36250 → this).

PHP implementation target

  1. Immediate (S): guard = "file matches the patch's post-image" (git apply --check -R succeeds), never a marker count; verify both from pristine (patches/pristine-snapshots/) and from the current post-image. Run apply-patches.sh --verify-pristine on all patches in CI setup, not two.
  2. lib/JIT/Context.php::runLightModuleOptimizationPasses must not assume the vendor binding exists: check method_exists($lib, 'LLVMCreateFunctionPassManagerForModule') and fail with a message naming the patch, or fall back to the module pass manager.
  3. Then Foundation: patches/ are no longer the source of truth — apply-patches.sh is 7,508 lines with 85 overlay functions and 412 grep guards, 92 of 183 patches neither apply nor reverse cleanly; fork php-cfg/php-types and keep patches only for php-llvm (patches/, script/apply-patches.sh) #36229: fork php-cfg / php-types / php-llvm into PurHur/* and consume tags; delete the overlay machinery. Until that lands, the CONTRIBUTING rule for every PR touching patches/: prove with a fresh composer install in the pinned image, and paste the apply-patches.sh --verify-pristine output.
  4. Branch protection requiring Compiler gate the moment it is green, so this class cannot merge again.

Repro

docker run --rm -v "$PWD:/compiler" -w /compiler php-compiler:22.04-dev bash -lc 'rm -rf vendor && composer install -q --ignore-platform-reqs && script/apply-patches.sh; echo rc=$?'

Done when

  • The command above exits 0 and script/aot-smoke.sh is 9/9 on the resulting tree and on a tree patched before 2026-09-01
  • Compiler gate green on master (link the run); branch protection enabled
  • apply-patches.sh --verify-pristine covers every patch; the guard-by-count is gone

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    MOST IMPORTANTThis are the most important targetsarea:toolingTooling / CI / docsbugSomething isn't workingimplementation-readySpec complete: repro, php-src ref, done-when — safe for workers to claimphase-0:FoundationPhase 0 – foundation & DevExrelease-blockerBlocks tagged user release

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions