Skip to content

Bootstrap: self-host compile blocked by duplicate use-import aliases (867+ ext/* files, bootstrap-inventory-triage) #9252

Description

@PurHur

Category

bootstrap · blocks #1492 / #9068 after Unknown-type fixes

Problem

php script/bootstrap-inventory-triage.php ranks the top self-host CFG gap as 867 files failing parse/compile with:

Cannot use PHPCompiler\Frame as Frame because the name is already in use on line 7

Similar collisions for Context, BasicBlockHelper, VmString, VmReflection, etc. across ext/* JIT lowering files. These are not Zend parity gaps — they block compiling lib/ + ext/ through the native bootstrap pipeline even when link succeeds (make bootstrap-selfhost-link).

Snapshot: docs/bootstrap-inventory-triage-top50.json (regenerate via triage script).

php-src reference

N/A (self-host compile hygiene). Pattern: PSR-12 use + short class name reuse in same file.

Repro

php script/bootstrap-inventory-triage.php | head -25
# Rank 1: Frame alias collision — 867 files

./script/docker-exec.sh -- bash -lc 'make bootstrap-selfhost-helloworld'
# Often fails earlier on Unknown type (#9068); import-alias failures appear compiling ext/standard JIT units

Example paths: ext/bcmath/BcmathFunction.php, ext/standard/JitArrayPush.php, lib/VM/Builtin/DateTimeFormat.php.

Scope (this repo)

Layer Path
Mechanical fix ext/**, lib/JIT/** — normalize imports (use PHPCompiler\Frame as VmFrame or fully-qualified names)
Guard script/bootstrap-inventory.php / triage — keep ranking alias collisions
Docs docs/bootstrap-inventory.md regeneration after gap count drops

PHP-in-PHP first: fix imports in PHP sources; no new runtime/*.c.

Done when

Related

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:compilerCompiler / CFG / JITenhancementNew 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