Skip to content

CI: Run JIT compliance tests in CI (fix LLVM skip in PHPUnit) #98

Description

@PurHur

Problem

Locally, script/ci-local.sh can report 133 JIT compliance tests skipped while 133 VM compliance tests pass (266 total). When LLVM 9 is present under .llvm/ or /opt/llvm9, the JIT suite should execute, not skip entirely — otherwise JIT regressions slip through.

JITTest::setUp() skips when LlvmToolchain::isReady() is false. Historical failures were also caused by LD_LIBRARY_PATH not reaching PHPUnit child processes and PHPLLVM\Chooser::choose() failing silently.

#250 (closed) added script/check-jit-compliance-ran.php so ci-local.sh fails if LLVM exists but JIT compliance ran zero tests. This issue tracks fixing the root cause of skips when LLVM is actually installed.

Goal

./script/ci-local.sh (host or Docker) runs JIT compliance with the same pass/fail signal as VM compliance when libLLVM-9.so.1 is present.

GitHub Actions is optional; reproduce with Docker:

make docker-build-22
docker run --rm -v "$(pwd):/compiler" -w /compiler php-compiler:22.04-dev ./script/ci-local.sh

Implementation hints

  1. Reproduce: run vendor/bin/phpunit --group llvm --log-junit /tmp/llvm.xml inside php-compiler:22.04-dev; inspect /tmp/llvm.xml for JITTest skipped count.
  2. test/compliance/JITTest.php: extends BaseTest; ensure setUp() uses LlvmToolchain::isReady(dirname(__DIR__, 2)) — same root as ExampleWebAotTest.
  3. phpunit.xml.dist: confirm <env name="LD_LIBRARY_PATH" value="./.llvm"/> or that script/ci-local.sh exports LD_LIBRARY_PATH before PHPUnit (lines 32–37).
  4. test/bootstrap.php: mirror AOT bootstrap — call PHPLLVM\Chooser::choose() once and surface failure reason in skip message.
  5. script/check-jit-compliance-ran.php: already wired at end of llvm group in ci-local.sh — keep as guard; do not weaken when fixing skips.
  6. Escape hatch: PHP_COMPILER_ALLOW_JIT_SKIP=1 for broken dev laptops only — document in Docs: Local CI matrix (host, Docker, GHA skips) in README #245 matrix, not default in Docker.

Tasks

Acceptance criteria

When .llvm/libLLVM-9.so.1 exists (or /opt/llvm9 in 22.04-dev image):

./script/ci-local.sh

→ JUnit shows JITTest cases executed (not 100% skipped); check-jit-compliance-ran.php exits 0.

Key files

  • test/compliance/JITTest.php, test/BaseTest.php
  • lib/LlvmToolchain.php (if present) or test/aot/AotTest.php patterns
  • script/ci-local.sh, script/check-jit-compliance-ran.php
  • phpunit.xml.dist, test/bootstrap.php

Related (de-duplicated)

Issue Relationship
#250 Guard when LLVM present but JIT skipped — closed, keep enabled
#174 LLVM 9→14 upgrade — separate; do not block #98 on version bump
#245 Local CI matrix docs — host/Docker must run JIT; GHA may differ
#47 GHA workflow — closed; optional mirror of local CI
#272 Harness entry: make test-harness / docker-ci-local.sh

Verification (local only)

make test-docker
# or harness:
./script/docker-ci-local.sh

No GitHub Actions required to close this issue.

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

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions