Skip to content

Let the ubuntu static analysis jobs fork their workers on PHP 8.2+ - #6595

Open
SanderMuller wants to merge 1 commit into
phpstan:2.3.xfrom
SanderMuller:ci-static-analysis-fork-workers
Open

SanderMuller wants to merge 1 commit into
phpstan:2.3.xfrom
SanderMuller:ci-static-analysis-fork-workers

Conversation

@SanderMuller

Copy link
Copy Markdown
Contributor

On ubuntu, the self-analysis jobs for PHP 8.2–8.6 spawned their workers, while the ones for 7.4–8.1 forked them. bin/phpstan diagnose in those jobs said Reason fork not used: pcntl/posix functions are not available.

pcntl is loaded there, but the runner's /etc/php/8.x/cli/php.ini lists every pcntl_* function in disable_functions (422 characters on 8.2, 540 on 8.6). The 8.2 runner also does not load posix: there is no 20-posix.ini among its parsed ini files. With php -d disable_functions=, function_exists('pcntl_fork') is true. In the 7.4–8.1 jobs, disable_functions is empty.

The Install PHP step now adds pcntl and posix and clears disable_functions for the ubuntu jobs. Windows has no pcntl, so its jobs keep mbstring only and spawn as before.

Tested in the throwaway draft #6594, with the same step plus a diagnose step (run):

  • ubuntu 8.2–8.6: Mechanism: fork, all pass. The main process peaks at 354.5–356.5 MB, against 405–407 MB in the run for 9c49ae3, when they spawned.
  • ubuntu 7.4–8.1: fork as before, all pass.
  • Windows 7.4–8.6: spawn as before, all pass.

So these jobs now run the fork path that parallel analysis uses on most Linux machines.

🤖 Generated with Claude Code

@ondrejmirtes

Copy link
Copy Markdown
Member

Please start contributing similar things to 2.3.x only. 2.2.x is reserved for recently-broken things that would need an immediate release 😊 Thanks.

@SanderMuller
SanderMuller force-pushed the ci-static-analysis-fork-workers branch from 511c1c8 to 7852cf4 Compare September 25, 2026 20:20
@SanderMuller
SanderMuller changed the base branch from 2.2.x to 2.3.x September 25, 2026 20:20
The runner's php.ini for PHP 8.2+ lists every pcntl_* function in
disable_functions, and the 8.2 runner does not load posix either, so
parallel analysis spawned its workers there instead of forking them. In
the 7.4-8.1 jobs disable_functions is empty, and they already forked.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
@SanderMuller
SanderMuller force-pushed the ci-static-analysis-fork-workers branch from 7852cf4 to eef8351 Compare September 26, 2026 14:29
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.

2 participants