Skip to content

Self-host M5: PHPTypes::fromDecl fails on docblock */ token (php-cfg vendor bundle) #3035

Description

@PurHur

Milestone

M5 (vendor prelink) — parent #1492. First concrete blocker for #3028 (umbrella #3022).

Problem

Native build/selfhost-native-compile-driver reports only parseAndCompile returned null on the php-cfg vendor bundle. Zend bin/compile.php -l surfaces the real front-end failure:

parseAndCompile failure: target=test/bootstrap-vendor-prelink/generated/ircmaxell-php-cfg_bundle.php:
  Unknown type declaration found: */
RuntimeException in vendor/ircmaxell/php-types/lib/PHPTypes/Type.php:419
  PHPTypes\Type::fromDecl() ← Type::extractTypeFromComment()

The bundle pulls in ircmaxell/php-cfg plus PHPTypes\TypeReconstructor during Runtime::parse() — docblock extraction misparses a */ fragment as a type name.

Scope

Path Work
vendor/ircmaxell/php-types/lib/PHPTypes/Type.php Harden fromDecl / extractTypeFromComment for malformed or closing docblock tokens
patches/php-types-*.patch Prefer patch overlay over editing vendor when possible (#3033 patch ordering)
lib/Runtime.php Only if compiler must skip type reconstruction for vendor prelink bundles
test/bootstrap-vendor-prelink/generated/ircmaxell-php-cfg_bundle.php Repro TU (auto-generated)

Out of scope: committed .o without native rebuild (#2865).

Repro

./script/docker-exec.sh -- bash -lc '
  source script/php-env.sh
  php bin/compile.php -l test/bootstrap-vendor-prelink/generated/ircmaxell-php-cfg_bundle.php
'

./script/docker-exec.sh --sync-back build/selfhost-native-compile-driver -- bash -lc '
  PHP_COMPILER_VENDOR_PRELINK=1 php script/bootstrap-vendor-objects.php --compile 2>&1 | head -20
'

Done when

  • php bin/compile.php -l …/ircmaxell-php-cfg_bundle.php exits 0 on master
  • bootstrap-vendor-objects.php --compile reports ircmaxell/php-cfg object_ok under native invoker
  • #3028 can close or narrow to remaining php-cfg-only CFG gaps (if any)

Activity

  1. PurHur commented on May 29, 2026

    @PurHur
    OwnerAuthor

    Backlog-architect probe 2026-05-29: green on master via Docker. Superseded by #3050 for honest rebuild path; see #1492 probe comment.

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

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions