Problem
When phpc build --project examples/003-MiniWebApp links but .phpc/bin/app prints 0 stdout bytes (#764), contributors grep lib/Cli/PhpcBuild.php and re-run full ci-local.sh llvm phases.
There is no lightweight way to see which PHP files entered the project graph, link order, and whether public/index.php is the LLVM entry.
Goal
phpc build --project examples/003-MiniWebApp --list-units
# or: phpc build --project . --list-units --dry-run
Prints to stderr (stable, grep-friendly):
- Resolved
phpc.json entry + includes[]
- Sorted translation unit paths (bundled vs on-disk)
- Native entry symbol / main script path
- Optional: skipped files with reason (
lint, unsupported syntax)
Exit 0 without requiring link when combined with existing --dry-run.
Scope
Implementation hints
| Piece |
File |
Notes |
| CLI |
lib/Cli/PhpcBuild.php |
Parse --list-units before compile |
| Manifest |
lib/Web/ProjectManifest.php |
entry, includes, binary |
| Bundler |
lib/Web/SourceBundler.php |
Same graph as link |
| Tests |
test/unit/PhpcBuildProjectTest.php |
Assert stdout lists public/index.php + src/Router.php for 003 |
Example output
entry: public/index.php
units: config.php, src/Router.php, templates/layout.php, …
binary: .phpc/bin/app
Acceptance criteria
./phpc build --project examples/003-MiniWebApp --list-units --dry-run | grep Router.php
Docker:
docker run --rm -v "$(pwd):/compiler" -w /compiler php-compiler:22.04-dev \
php bin/phpc.php build --project examples/003-MiniWebApp --list-units --dry-run
Dependencies
Verification
Local/Docker only. No GitHub Actions.
Links
Problem
When
phpc build --project examples/003-MiniWebApplinks but.phpc/bin/appprints 0 stdout bytes (#764), contributors greplib/Cli/PhpcBuild.phpand re-run fullci-local.shllvm phases.There is no lightweight way to see which PHP files entered the project graph, link order, and whether
public/index.phpis the LLVM entry.Goal
phpc build --project examples/003-MiniWebApp --list-units # or: phpc build --project . --list-units --dry-runPrints to stderr (stable, grep-friendly):
phpc.jsonentry +includes[]lint, unsupported syntax)Exit 0 without requiring link when combined with existing
--dry-run.Scope
PhpcBuild/bin/phpc.php buildlib/Web/SourceBundler.php/ project discovery used by--projectexamples/003-MiniWebApp/README.mddebugging section (DevEx: phpc build --project hints when linked binary prints 0 stdout bytes #792 companion)Implementation hints
lib/Cli/PhpcBuild.php--list-unitsbefore compilelib/Web/ProjectManifest.phpentry,includes,binarylib/Web/SourceBundler.phptest/unit/PhpcBuildProjectTest.phppublic/index.php+src/Router.phpfor 003Example output
Acceptance criteria
./phpc build --project examples/003-MiniWebApp --list-units --dry-run | grep Router.phpDocker:
docker run --rm -v "$(pwd):/compiler" -w /compiler php-compiler:22.04-dev \ php bin/phpc.php build --project examples/003-MiniWebApp --list-units --dry-runDependencies
phpc doctor --aot-project-probe— higher-level green/red probeVerification
Local/Docker only. No GitHub Actions.
Links