Page MenuHomePhabricator

Build PHP 8.3 packages for bookworm
Closed, ResolvedPublic

Description

In order to migrate PHP workloads to bookworm, we need to rebuild the PHP packages for it. This will use the bookworm-native versions of ICU (72) and PCRE2 (i.e., rather than the backports thereof we use under bullseye, which are no longer needed).

The plan is to include those packages in component/php83 so that we can switch the php8.3 image stack to bookworm in-place, and deprecate the temporary php8.3-icu72 stack (along with component/php83-icu72). More details on the high-level plan in T418200#11877390.

Event Timeline

Scott_French changed the task status from Open to In Progress.Tue, May 26, 6:09 PM
Scott_French triaged this task as High priority.
Scott_French moved this task from Inbox to In Progress on the ServiceOps new board.

Change #1293789 had a related patch set uploaded (by Scott French; author: Scott French):

[operations/puppet@production] aptrepo: add component/php83 to bookworm-wikimedia

https://gerrit.wikimedia.org/r/1293789

Change #1293790 had a related patch set uploaded (by Scott French; author: Scott French):

[operations/puppet@production] package_builder: Use DIST in the D04php hook

https://gerrit.wikimedia.org/r/1293790

Change #1293789 merged by Scott French:

[operations/puppet@production] aptrepo: add component/php83 to bookworm-wikimedia

https://gerrit.wikimedia.org/r/1293789

Change #1293790 merged by Scott French:

[operations/puppet@production] package_builder: Use @distribution in the D04php hook

https://gerrit.wikimedia.org/r/1293790

Mentioned in SAL (#wikimedia-operations) [2026-05-27T20:27:13Z] <swfrench-wmf> reprepro include php8.3_8.3.31-1+wmf12u2 into component/php83 for bookworm-wikimedia - T427312

Mentioned in SAL (#wikimedia-operations) [2026-05-27T20:38:20Z] <swfrench-wmf> reprepro include php-defaults_94+wmf12u1 into component/php83 for bookworm-wikimedia - T427312

Mentioned in SAL (#wikimedia-operations) [2026-05-27T20:43:56Z] <swfrench-wmf> reprepro include dh-php_5.5+wmf12u1 into component/php83 for bookworm-wikimedia - T427312

Made some progress today - package builds are progressing, and indeed there have been no build-time surprises thus far.

I did however run into the following just now, when attempting to include apcu in component/php83 before building igbinary (build dependency):

$ sudo -i reprepro -C component/php83 include bookworm-wikimedia $(pwd)/php-apcu_5.1.24-1+wmf12u1_amd64.changes
File "pool/component/php83/p/php-apcu/php-apcu_5.1.24.orig.tar.gz" is already registered with different checksums!
md5 expected: 65494e2af7c92bdef075030b9d9e2da4, got: fc0b3e12758087aa6928386add77e7f5
sha1 expected: e35801f98f41d1ffab669bbc7fa85bd1c5ed3500, got: 226c2ae088865e89158eb9c855ce3ca6e9deee08
sha256 expected: 5c28a55b27082c69657e25b7ecf553e2cf6b74ec3fa77d6b76f4fb982e001e43, got: 3f3856ccd537d40e2b2226c1991dfaa671f579827192d05eb123183b3fe1eaab
size expected: 90866, got: 92011
There have been errors!

Indeed, there's already a php-apcu_5.1.24.orig.tar.gz in component/php83 as a result of the bullseye builds already present.

What's interesting is that these files contain identical source code - i.e., the apcu-5.1.24 subdirectory of each contains identical content - but they have a different top-level structure:

  • The existing php-apcu_5.1.24.orig.tar.gz file - which was built from a gbp clone of php-apcu on salsa - expands to apcu-5.1.24/ and package.xml at the top-level.
  • The new php-apcu_5.1.24.orig.tar.gz file - which was built from a gbp import-dsc of the bullseye build on apt.wm.o - expands to a top-level php-apcu-5.1.24/ directory that then contains apcu-5.1.24/ and package.xml.

While it's clear that the difference is probably due to the way the trees were initialized, I'm at a loss as to how to fix that, together with how to avoid building a new archive at all (since file metadata will presumably never match the original). One option, of course, might be to just use an identical procedure (i.e., bootstrap from gbp clone) rather than using gbp import-dsc as a mechanism to try to ensure (largely) identical trees. I can certainly do that, though it does require repeating a bunch of work.

@MoritzMuehlenhoff - Is this something you might have seen before, if so, do you have any recommendations for how to work around it? Thanks! See Edit below.

Edit: Alright, I see ... I inadvertently dropped the pristine-tar branch initialization in my gbp import-dsc, which means we never reconstituted the branch from the original source archive, and then fell back to building the latter anew from the upstream branch during the subsequent gbp buildpackage. Once I fix that, I get the expected results. I'll just do that.

Mentioned in SAL (#wikimedia-operations) [2026-05-28T00:04:02Z] <swfrench-wmf> reprepro include php-apcu_5.1.24-1+wmf12u1 into component/php83 for bookworm-wikimedia - T427312

Mentioned in SAL (#wikimedia-operations) [2026-05-28T00:08:39Z] <swfrench-wmf> reprepro include php-igbinary_3.2.16-4+wmf12u1 into component/php83 for bookworm-wikimedia - T427312

Mentioned in SAL (#wikimedia-operations) [2026-05-28T00:09:40Z] <swfrench-wmf> reprepro include php-msgpack_3.0.0-1+wmf12u1 into component/php83 for bookworm-wikimedia - T427312

Alright, once I fixed the pristine-tar init on my import-dsc, everything works smoothly. I've now built, but not yet fully included (i.e., only those necessary to satisfy inter-package dependencies), all of the necessary packages.

I'll include the rest tomorrow and do some basic testing in a locally built bookworm-based image.


Why didn't I run into this issue for php, php-defaults, or dh-php? Interestingly, the import-dsc-initialized builds of these packages use a different compression scheme (.tar.gz) for the original source archive vs. the clone-initialized ones (.tar.xz). Thus, even though they do technically differ from the existing archives on apt.wm.o, there is no conflict.

Why didn't I run into this issue for php, php-defaults, or dh-php?

These are native packages, which means they are specific to Debian and don't have a relative upstream release on php.net. As such there is no .orig tarball release and all changes are in the dsc and debian.tar.xz

Interestingly, the import-dsc-initialized builds of these packages use a different compression scheme (.tar.gz) for the original source archive vs. the clone-initialized ones (.tar.xz). Thus, even though they do technically differ from the existing archives on apt.wm.o, there is no conflict.

There's ongoing work to simplify all of this, https://diziet.dreamwidth.org/20436.html has more pointers if you want to dive into it.

Mentioned in SAL (#wikimedia-operations) [2026-05-28T16:14:30Z] <swfrench-wmf> reprepro include php-excimer_1.2.5-1+wmf12u1 into component/php83 for bookworm-wikimedia - T427312

Mentioned in SAL (#wikimedia-operations) [2026-05-28T16:14:50Z] <swfrench-wmf> reprepro include php-imagick_3.7.0-13+wmf12u1 into component/php83 for bookworm-wikimedia - T427312

Mentioned in SAL (#wikimedia-operations) [2026-05-28T16:15:08Z] <swfrench-wmf> reprepro include php-luasandbox_4.1.2-1+wmf12u1 into component/php83 for bookworm-wikimedia - T427312

Mentioned in SAL (#wikimedia-operations) [2026-05-28T16:15:26Z] <swfrench-wmf> reprepro include php-memcached_3.3.0-1+wmf12u1 into component/php83 for bookworm-wikimedia - T427312

Mentioned in SAL (#wikimedia-operations) [2026-05-28T16:15:48Z] <swfrench-wmf> reprepro include php-pcov_1.0.12-1+wmf12u1 into component/php83 for bookworm-wikimedia - T427312

Mentioned in SAL (#wikimedia-operations) [2026-05-28T16:16:07Z] <swfrench-wmf> reprepro include php-redis_6.2.0-1+wmf12u1 into component/php83 for bookworm-wikimedia - T427312

Mentioned in SAL (#wikimedia-operations) [2026-05-28T16:16:24Z] <swfrench-wmf> reprepro include php-uuid_1.3.0-1+wmf12u1 into component/php83 for bookworm-wikimedia - T427312

Mentioned in SAL (#wikimedia-operations) [2026-05-28T16:16:44Z] <swfrench-wmf> reprepro include php-wmerrors_2.0.0-1+wmf12u1 into component/php83 for bookworm-wikimedia - T427312

Mentioned in SAL (#wikimedia-operations) [2026-05-28T16:16:56Z] <swfrench-wmf> reprepro include php-xhprof_2.3.10-1+wmf12u1 into component/php83 for bookworm-wikimedia - T427312

Mentioned in SAL (#wikimedia-operations) [2026-05-28T16:17:11Z] <swfrench-wmf> reprepro include php-yaml_2.2.4-1+wmf12u1 into component/php83 for bookworm-wikimedia - T427312

Mentioned in SAL (#wikimedia-operations) [2026-05-28T16:17:27Z] <swfrench-wmf> reprepro include wikidiff2_1.14.1-2+wmf12u1 into component/php83 for bookworm-wikimedia - T427312

Mentioned in SAL (#wikimedia-operations) [2026-05-28T16:17:41Z] <swfrench-wmf> reprepro include xdebug_3.4.4-1+wmf12u1 into component/php83 for bookworm-wikimedia - T427312

Thanks for the pointers, Moritz!

All packages have now been included. A local rebuild of the php8.3 images (after switching to bookworm) succeeds and looks like what I would expect:

$ for im in cli fpm fpm-multiversion-base; do docker run --entrypoint /bin/bash docker-registry.wikimedia.org/php8.3-$im:8.3.31-1-u1 -c "cat /etc/issue.net; php -v; php -i | grep -w ICU; apt list --installed | grep php"; echo; done
Debian GNU/Linux 12
PHP 8.3.31 (cli) (built: May 26 2026 20:31:22) (NTS)
Copyright (c) The PHP Group
Zend Engine v4.3.31, Copyright (c) Zend Technologies
    with Zend OPcache v8.3.31, Copyright (c), by Zend Technologies
ICU version => 72.1
ICU Data version => 72.1
ICU TZData version => 2022e
ICU Unicode version => 15.0
php-common/now 2:94+wmf12u1 all [installed,local]
php8.3-apcu/now 5.1.24-1+wmf12u1 amd64 [installed,local]
php8.3-bcmath/now 8.3.31-1+wmf12u2 amd64 [installed,local]
php8.3-bz2/now 8.3.31-1+wmf12u2 amd64 [installed,local]
php8.3-cli/now 8.3.31-1+wmf12u2 amd64 [installed,local]
php8.3-common/now 8.3.31-1+wmf12u2 amd64 [installed,local]
php8.3-curl/now 8.3.31-1+wmf12u2 amd64 [installed,local]
php8.3-dba/now 8.3.31-1+wmf12u2 amd64 [installed,local]
php8.3-excimer/now 1.2.5-1+wmf12u1 amd64 [installed,local]
php8.3-gd/now 8.3.31-1+wmf12u2 amd64 [installed,local]
php8.3-gmp/now 8.3.31-1+wmf12u2 amd64 [installed,local]
php8.3-igbinary/now 3.2.16-4+wmf12u1 amd64 [installed,local]
php8.3-intl/now 8.3.31-1+wmf12u2 amd64 [installed,local]
php8.3-mbstring/now 8.3.31-1+wmf12u2 amd64 [installed,local]
php8.3-memcached/now 3.3.0-1+wmf12u1 amd64 [installed,local]
php8.3-msgpack/now 1:3.0.0-1+wmf12u1 amd64 [installed,local]
php8.3-mysql/now 8.3.31-1+wmf12u2 amd64 [installed,local]
php8.3-opcache/now 8.3.31-1+wmf12u2 amd64 [installed,local]
php8.3-readline/now 8.3.31-1+wmf12u2 amd64 [installed,local]
php8.3-redis/now 6.2.0-1+wmf12u1 amd64 [installed,local]
php8.3-uuid/now 1.3.0-1+wmf12u1 amd64 [installed,local]
php8.3-xml/now 8.3.31-1+wmf12u2 amd64 [installed,local]

Debian GNU/Linux 12
PHP 8.3.31 (cli) (built: May 26 2026 20:31:22) (NTS)
Copyright (c) The PHP Group
Zend Engine v4.3.31, Copyright (c) Zend Technologies
    with Zend OPcache v8.3.31, Copyright (c), by Zend Technologies
ICU version => 72.1
ICU Data version => 72.1
ICU TZData version => 2022e
ICU Unicode version => 15.0
php-common/now 2:94+wmf12u1 all [installed,local]
php8.3-apcu/now 5.1.24-1+wmf12u1 amd64 [installed,local]
php8.3-bcmath/now 8.3.31-1+wmf12u2 amd64 [installed,local]
php8.3-bz2/now 8.3.31-1+wmf12u2 amd64 [installed,local]
php8.3-cli/now 8.3.31-1+wmf12u2 amd64 [installed,local]
php8.3-common/now 8.3.31-1+wmf12u2 amd64 [installed,local]
php8.3-curl/now 8.3.31-1+wmf12u2 amd64 [installed,local]
php8.3-dba/now 8.3.31-1+wmf12u2 amd64 [installed,local]
php8.3-excimer/now 1.2.5-1+wmf12u1 amd64 [installed,local]
php8.3-fpm/now 8.3.31-1+wmf12u2 amd64 [installed,local]
php8.3-gd/now 8.3.31-1+wmf12u2 amd64 [installed,local]
php8.3-gmp/now 8.3.31-1+wmf12u2 amd64 [installed,local]
php8.3-igbinary/now 3.2.16-4+wmf12u1 amd64 [installed,local]
php8.3-intl/now 8.3.31-1+wmf12u2 amd64 [installed,local]
php8.3-mbstring/now 8.3.31-1+wmf12u2 amd64 [installed,local]
php8.3-memcached/now 3.3.0-1+wmf12u1 amd64 [installed,local]
php8.3-msgpack/now 1:3.0.0-1+wmf12u1 amd64 [installed,local]
php8.3-mysql/now 8.3.31-1+wmf12u2 amd64 [installed,local]
php8.3-opcache/now 8.3.31-1+wmf12u2 amd64 [installed,local]
php8.3-readline/now 8.3.31-1+wmf12u2 amd64 [installed,local]
php8.3-redis/now 6.2.0-1+wmf12u1 amd64 [installed,local]
php8.3-uuid/now 1.3.0-1+wmf12u1 amd64 [installed,local]
php8.3-xml/now 8.3.31-1+wmf12u2 amd64 [installed,local]

Debian GNU/Linux 12
PHP 8.3.31 (cli) (built: May 26 2026 20:31:22) (NTS)
Copyright (c) The PHP Group
Zend Engine v4.3.31, Copyright (c) Zend Technologies
    with Zend OPcache v8.3.31, Copyright (c), by Zend Technologies
ICU version => 72.1
ICU Data version => 72.1
ICU TZData version => 2022e
ICU Unicode version => 15.0
php-common/now 2:94+wmf12u1 all [installed,local]
php8.3-apcu/now 5.1.24-1+wmf12u1 amd64 [installed,local]
php8.3-bcmath/now 8.3.31-1+wmf12u2 amd64 [installed,local]
php8.3-bz2/now 8.3.31-1+wmf12u2 amd64 [installed,local]
php8.3-cli/now 8.3.31-1+wmf12u2 amd64 [installed,local]
php8.3-common/now 8.3.31-1+wmf12u2 amd64 [installed,local]
php8.3-curl/now 8.3.31-1+wmf12u2 amd64 [installed,local]
php8.3-dba/now 8.3.31-1+wmf12u2 amd64 [installed,local]
php8.3-excimer/now 1.2.5-1+wmf12u1 amd64 [installed,local]
php8.3-fpm/now 8.3.31-1+wmf12u2 amd64 [installed,local]
php8.3-gd/now 8.3.31-1+wmf12u2 amd64 [installed,local]
php8.3-gmp/now 8.3.31-1+wmf12u2 amd64 [installed,local]
php8.3-igbinary/now 3.2.16-4+wmf12u1 amd64 [installed,local]
php8.3-intl/now 8.3.31-1+wmf12u2 amd64 [installed,local]
php8.3-luasandbox/now 4.1.2-1+wmf12u1 amd64 [installed,local]
php8.3-mbstring/now 8.3.31-1+wmf12u2 amd64 [installed,local]
php8.3-memcached/now 3.3.0-1+wmf12u1 amd64 [installed,local]
php8.3-msgpack/now 1:3.0.0-1+wmf12u1 amd64 [installed,local]
php8.3-mysql/now 8.3.31-1+wmf12u2 amd64 [installed,local]
php8.3-opcache/now 8.3.31-1+wmf12u2 amd64 [installed,local]
php8.3-readline/now 8.3.31-1+wmf12u2 amd64 [installed,local]
php8.3-redis/now 6.2.0-1+wmf12u1 amd64 [installed,local]
php8.3-uuid/now 1.3.0-1+wmf12u1 amd64 [installed,local]
php8.3-wikidiff2/now 1.14.1-2+wmf12u1 amd64 [installed,local]
php8.3-wmerrors/now 2.0.0-1+wmf12u1 amd64 [installed,local]
php8.3-xml/now 8.3.31-1+wmf12u2 amd64 [installed,local]
php8.3-yaml/now 2.2.4-1+wmf12u1 amd64 [installed,local]

I'll post the production-images patch in T427312#11964352 shortly, which we can reuse for the actual switch (wherever that ends up being tracked). For now, I think that's everything tracked here.