Skip to content

DevEx: make examples-aot-smoke — phpc build + execute for 001-004 when LLVM ready #667

@PurHur

Description

@PurHur

Problem

make examples-web-smoke exercises VM phpc serve + curl for 001, 002, 004 (and 003 when enabled). There is no one Make target for contributors to run AOT build + CLI execute across shipped examples after LLVM install — they must remember per-example phpc build commands from examples/README.md.

ExamplesCompileTest covers lint/build in full CI (#203 ✅) but not a fast, copy-paste smoke script for pre-PR checks.

Goal

make examples-aot-smoke   # skips gracefully when LLVM missing

Runs for each of 000-HelloWorld, 001-SimpleWeb, 002-StaticWeb, 004-ApiJson:

  1. phpc build to temp output under .phpc/smoke/
  2. Execute with runtime CGI env where needed (001 QUERY_STRING=name=Smoke)
  3. Assert stdout substring (no HTTP)

003-MiniWebApp remains skipped until #568 / #485 (document in script stderr).

Scope

  • script/examples-aot-smoke.sh + Makefile target
  • Respect PHP_COMPILER_LLVM_PATH / .llvm/ probe (exit 0 with skip message if missing)
  • Optional gate in ci-local.sh llvm aot-link phase behind env EXAMPLES_AOT_SMOKE_GATE=1 (default off — full suite already has ExamplesCompileTest)
  • Document in examples/README.md CI section

Acceptance criteria

make docker-build-22
docker run --rm -v "$(pwd):/compiler" -w /compiler php-compiler:22.04-dev make examples-aot-smoke

All non-skipped examples print expected markers; exit 0.

Dependencies

Verification

Local/Docker only — not GitHub Actions.

Links

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions