Skip to content

fix: compile generated extensions with GCC 14+, pass CI on Ubuntu 26.04 - #2834

Merged
henderkes merged 3 commits into
php:mainfrom
nicolas-grekas:fix-ubuntu-2604
Nov 16, 2026
Merged

henderkes merged 3 commits into
php:mainfrom
nicolas-grekas:fix-ubuntu-2604

Conversation

@nicolas-grekas

@nicolas-grekas nicolas-grekas commented Nov 12, 2026 •

Copy link
Copy Markdown
Contributor

ubuntu-latest is now Ubuntu 26.04, where nine jobs fail on every PR (see the checks of #2833):

  • "Integration Tests": GCC 14+ rejects the generated extensions. cgo includes <stdlib.h> before php.h, so they now define _GNU_SOURCE as cgo.go does, and nullable int and bool arguments point to values of the types cgo declares.
  • "Tests" abort at the second phpinfo() of the process: PHP unloads shared extensions when it shuts down, and libenchant 2.8 can't be loaded twice, GObject still knows its types. The PHP of the CI jobs no longer loads enchant.
  • "msan": MemorySanitizer in clang 21 takes the index of _mm512_permutex2var_epi8() for uninitialized memory (fixed in clang 22 by [msan] Fix 'Simplify 'maskedCheckAVXIndexShadow' #147839' llvm/llvm-project#148785). The sanitizer jobs now use clang 22, which Ubuntu 26.04 has in its archive.

The enchant abort is not only a CI matter: on such a system, a server dies at the first use of enchant after a worker restart, an opcache_reset() or a config reload. Setting ZEND_DONT_UNLOAD_MODULES from FrankenPHP avoids it, and #2730 too, but I left that out: net-snmp doesn't expect to be initialized twice, it floods the log at each start and the suite segfaults on the runner.

@nicolas-grekas nicolas-grekas changed the title fix: build and run on Ubuntu 26.04 fix: compile generated extensions with GCC 14+, pass CI on Ubuntu 26.04 Nov 12, 2026
@nicolas-grekas
nicolas-grekas marked this pull request as ready for review November 12, 2026 09:42
@henderkes

Copy link
Copy Markdown
Contributor

Does GitHub offer operating system runners than Ubuntu? I'd rather just run the san tests on an OS that gets proper bug fixes pulled in instead of whatever silly thing Canonical is doing.

@nicolas-grekas

Copy link
Copy Markdown
Contributor Author

Ubuntu is what a big chunk of end users use so it makes sense to keep it, don't you think?

@henderkes

Copy link
Copy Markdown
Contributor

🫣

@nicolas-grekas

Copy link
Copy Markdown
Contributor Author

php/php-src#25412 FYI

@henderkes

Copy link
Copy Markdown
Contributor

I guess we can leave it for this backwards OS, but perhaps with a note. I'm generally not terribly happy with the changes here, they feel a bit misplaced in frankenphp. For enchant we should just wait for upstream fix (it's a bugfix so will go into 8.4+), and for running san tests I would prefer running them on new versions of software (e.g. gcc 16, clang 23).

@nicolas-grekas

Copy link
Copy Markdown
Contributor Author

PR updated: the sanitizer jobs now use clang 22, which Ubuntu 26.04 has in its archive, instead of skipping the AVX-512 code. And a note next to the enchant line says when to drop it.

Waiting for the php-src fix alone would keep every PR red for weeks, and 8.2/8.3 won't get it while we test them. The rest is ours: the generator emits C that GCC 14+ refuses.

Comment thread .github/actions/setup-php/action.yaml Resolved
Comment thread .github/workflows/sanitizers.yaml Resolved
Generated extensions now define _GNU_SOURCE, and pass nullable int and bool arguments as pointers to values of the types cgo declares. On CI, the PHP of the Tests jobs no longer loads enchant (php/php-src#25412), and the sanitizers use clang 22.
@nicolas-grekas

Copy link
Copy Markdown
Contributor Author

Thank you @henderkes, comments addressed and PR squashed.

Comment thread docs/extensions.md Resolved
Comment thread docs/extensions.md Resolved
Signed-off-by: Marc <m@pyc.ac>
Comment thread docs/extensions.md Resolved
Signed-off-by: Marc <m@pyc.ac>
@henderkes
henderkes merged commit 2615a85 into php:main Nov 16, 2026
27 checks passed
@nicolas-grekas
nicolas-grekas deleted the fix-ubuntu-2604 branch November 16, 2026 12:02
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.

4 participants