PR #100 opened: fix(docker): split opcache into its own RUN on PHP 8.5
Summary
#97 attempted to fix the nightly base-image build failure with -j$(nproc) → -j1. Manual verification afterwards showed the build still fails with the same error. Different root cause.
What's actually wrong
PHP 8.5 added a JIT IR to opcache. The opcache extension now needs build-time helper tools — ext/opcache/jit/ir/gen_ir_fold_hash and ext/opcache/jit/ir/minilua — which are produced during opcache's own compile phase.
docker-php-ext-install runs a teardown between extensions in the same invocation. From the build log on run 25675646255:
113.7 intl install — Build complete.
113.8 find . -name *.gcno ... ← teardown
113.9 find . -name *.la ... ← teardown
113.9 find . -name .libs -a -type d ... ← teardown
113.9 rm -f libphp.la modules/* libs/* ← teardown
113.9 rm -f ext/opcache/jit/ir/gen_ir_fold_hash ← WIPES opcache JIT helpers
113.9 rm -f ext/opcache/jit/ir/minilua ← WIPES opcache JIT helpers
115.5 configure: creating Makefile ← opcache configure starts
116.0 Installing shared extensions: ... ← but no compile output between!
116.1 cp: cannot stat 'modules/*': No such file
The teardown deletes the JIT helpers before opcache itself starts compiling. opcache then can't produce a .so because its build needs the helpers it just lost. modules/ stays empty, install-modules fails.
#97's -j1 change didn't help because parallelism wasn't the issue — teardown ordering was.
Fix
Install opcache in its own RUN. Shared-invocation teardown never touches its build artifacts. Also restored -j$(nproc) on the bulk install — without opcache in the mix, parallel build works fine on 8.5.
Net: nightly build time stays roughly where it was on 8.4. opcache's compile is fast even with a fresh make invocation; parallelism is restored for everything else.
Test plan
- CI lane builds clean on this PR
- Manual
build-base-images.ymldispatch after merge — confirm all 8.5 jobs go green - Watch the next nightly run lands green