Repository navigation
php: Future-proof OPcache configuration logic for PHP 8.6 - #24380
Conversation
With the release of PHP 8.6 the `php` formula which currently installs PHP 8.5 will likely start installing PHP 8.6, which PHP 8.5 being made available as `php@8.5`. This means the PHP configuration logic will attempt to enable OPcache for PHP 8.5 since the `context_name == "php"` check no longer matches, which will then break since `opcache.so` is not a thing for PHP 8.5. Check for the existence of `opcache.so` instead to make this PHP version / formula name agnostic.
📝 Summary
Priority: Merge Risk:
|
There was a problem hiding this comment.
Actionable comments posted: 1

Review info
-
Run configuration-
- Source mode: Auto
- Repository: Unavailable
- Branch: Unavailable
- File: No configuration file from this repository applied
- Commit: Unavailable
- Layers: Organization UI
- Review profile: CHILL
- Plan: Advanced
- Run ID:
f9811091-91d4-4683-9ff0-7acb8e96302b
Files selected for processing: 2-
Library/Homebrew/install_steps/formula_actions.rbLibrary/Homebrew/test/install_steps_spec.rb
Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 9 remain after this review.
-
With the release of PHP 8.6 the
phpformula which currently installs PHP 8.5 will likely start installing PHP 8.6, which PHP 8.5 being made available asphp@8.5. This means the PHP configuration logic will attempt to enable OPcache for PHP 8.5 since thecontext_name == "php"check no longer matches, which will then break sinceopcache.sois not a thing for PHP 8.5.Check for the existence of
opcache.soinstead to make this PHP version / formula name agnostic.Found as part of #24377.
brew benchmarkresults.brewcommands to reproduce the bug?brew lgtm(style, typechecking and tests) locally?Claude Opus 5.5 created the initial patch including the test. I was unhappy with the initial version and gave specific instructions to refine the patch. The comment in
formula_actions.rbis written by myself, as is the commit message and PR description.I verified that the tests fail when reverting the change to the logic. I also built the Docker image and verified that
brew install phpandbrew install php@8.4continue to work (including the creation of opcache.ini for PHP 8.4). I did not verify correct functionality for a (as of yet non-existent)php@8.5formula.