Skip to content

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

Description

@PurHur

Category

Foundation: · dependency management (the failure class behind #36209 and the August php-cfg-bare-variable-read-stmt.patch outage) · child of #36188

Problem

Measured on master 4eed6a2785:

patches 183 files, 5,495 diff lines (avg 30); 8 contain zero hunks (e.g. php-cfg-instanceof-union.patch is one comment line)
script/apply-patches.sh 7,508 lines — 37 % larger than every patch combined; 85 hand-written overlay functions (bash/sed/python) bypass patch(1) entirely (40 dispatch branches at :6680-7010); 412 grep -q idempotency guards
audit vs the current vendor tree 3 apply cleanly, 88 reverse cleanly, 92 (50 %) neither
concentration PHPCfg/Parser.php 50, PHPTypes/InternalArgInfo.php 35, TypeReconstructor.php 22, Type.php 22 — 129 of 183 touch four files
categories php-cfg 78 (feature backports: enums, match, readonly, hooks…), php-types 76 (mostly arginfo data + docblock parsing), php-llvm 25 (binding fixes), parser/pre 4

The per-patch grep guard means a patch can be "applied" by marker while its hunks would fail or duplicate: php-llvm-structgep-assert.patch today applies hunk 1 with fuzz 2 and fails hunk 2 while both edits are already present — a non-dry-run would have duplicated the assert. Every fresh composer install (CI, a new box, a worktree) is a roll of the dice, and the .patch files cannot be reviewed as the change they claim to be.

PHP implementation target

Done when

  • composer install --ignore-platform-reqs && script/apply-patches.sh on a clean checkout is deterministic; apply-patches.sh < 1,500 lines; zero overlay functions for php-cfg/php-types
  • git apply --check clean for every remaining patch under --verify-pristine; the compliance/differential name-sets unchanged after the switch
  • Bootstrap vendor prelink (make bootstrap-vendor-objects) re-proved object_ok against the forked sources

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

    IMPORTANTCritical patharea:toolingTooling / CI / docsenhancementNew feature or requestimplementation-readySpec complete: repro, php-src ref, done-when — safe for workers to claimphase-0:FoundationPhase 0 – foundation & DevEx

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions