Skip to content

Fix AOT LLVM discovery in Docker; add str_contains AOT PHPT#265

Merged
PurHur merged 1 commit into
masterfrom
feat/aot-llvm-docker-resolution
May 19, 2026
Merged

Fix AOT LLVM discovery in Docker; add str_contains AOT PHPT#265
PurHur merged 1 commit into
masterfrom
feat/aot-llvm-docker-resolution

Conversation

@PurHur
Copy link
Copy Markdown
Owner

@PurHur PurHur commented May 19, 2026

Summary

  • LLVM 9 resolution: AOT/LLVM PHPUnit code only checked repo/.llvm, so tests in the php-compiler:22.04-dev image (toolchain at /opt/llvm9) were skipped silently (45 skipped, 0 assertions). Added test/LlvmToolchain.php mirroring script/php-env.sh (repo .llvmPHP_COMPILER_LLVM_PATH/opt/llvm9) and wired it through BaseTest, all test/aot/*, ServeAotTest, ExamplesCompileTest, and JITTest setup.
  • Bootstrap: src/llvm-env.php now uses the same resolution order so in-process PHPLLVM loads in Docker.
  • New coverage: test/fixtures/aot/cases/str_contains.phpt for str_contains() (web routing / header checks).

Test output (Docker, Runforge harness)

Harness bind-mount is empty; used ./script/docker-ci-local.sh pattern (tar pipe):

$ tar -cf - --exclude='.git' --exclude='.llvm' . | docker run --rm -i -w /compiler php-compiler:22.04-dev \
    bash -c 'tar -xf - && script/apply-patches.sh 2>/dev/null; php vendor/bin/phpunit test/aot/'

OK (46 tests, 86 assertions)

Before this change, the same command reported Skipped: 45 with OK, but incomplete.

LLVM 9 reported at /opt/llvm9 by script/ci-local.sh when PHP_COMPILER_LLVM_PATH is set in the image.

Test plan

  • php vendor/bin/phpunit test/aot/ in php-compiler:22.04-dev (46 tests, 86 assertions)
  • Full ./script/ci-local.sh in Docker (recommended before merge)

Made with Cursor

AOT/LLVM PHPUnit helpers only looked for repo/.llvm, so the 22.04-dev
image toolchain at /opt/llvm9 was ignored and 45+ tests skipped silently.
Centralize resolution (repo .llvm, PHP_COMPILER_LLVM_PATH, /opt/llvm9) in
LlvmToolchain, align src/llvm-env.php with script/php-env.sh, and add an
AOT PHPT for str_contains().

Co-authored-by: Cursor <cursoragent@cursor.com>
@PurHur PurHur merged commit 435aa8f into master May 19, 2026
1 check failed
@PurHur PurHur deleted the feat/aot-llvm-docker-resolution branch May 19, 2026 11:28
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant