To ensure compatibility of PHP code with PHP 8.1 (released on Nov 25, 2021). It covers:
- MediaWiki core,
- MediaWiki extensions and skins, and
- Wikimedia-deployed non-MediaWiki PHP code.
To ensure compatibility of PHP code with PHP 8.1 (released on Nov 25, 2021). It covers:
WebAuthn patches are still failing, e.g. https://gerrit.wikimedia.org/r/c/mediawiki/extensions/WebAuthn/ /1096610
16:47:57 [25.6MiB/6.79s] Your requirements could not be resolved to an installable set of packages. 16:47:57 [25.6MiB/6.79s] 16:47:57 Problem 1 16:47:57 - mediawiki/minus-x is locked to version 1.1.3 and an update of this package was not requested. 16:47:57 - Root composer.json requires web-auth/webauthn-lib ~3.3.12 -> satisfiable by web-auth/webauthn-lib[v3.3.12]. 16:47:57 - mediawiki/minus-x 1.1.3 requires symfony/console ^3.3.5 || ^4 || ^5 || ^6 || ^7 -> satisfiable by symfony/console[v7.2.0]. 16:47:57 - symfony/console v7.2.0 conflicts with symfony/process v5.4.47. 16:47:57 - symfony/console v7.2.0 conflicts with symfony/process v5.3.2. 16:47:57 - symfony/console v7.2.0 conflicts with symfony/process v5.0.11. 16:47:57 - symfony/console v7.2.0 conflicts with symfony/process v4.4.44. 16:47:57 - symfony/console v7.2.0 conflicts with symfony/process v4.4.26. 16:47:57 - symfony/console v7.2.0 conflicts with symfony/process v3.4.47. 16:47:57 - symfony/console v7.2.0 conflicts with symfony/process v3.3.6. 16:47:57 - symfony/process[v4.0.0, v4.0.1, v4.0.2, v4.0.3, v4.0.4, v4.0.5, v4.0.6, v4.0.7, v4.0.8, v4.0.9, v4.0.10, v4.0.11, v4.0.12, v4.0.13, v4.0.14, v4.0.15, v4.1.0, v4.1.1, v4.1.2, v4.1.3, v4.1.4, v4.1.5, v4.1.6, v4.1.7, v4.1.8, v4.1.9, v4.1.10, v4.1.11, v4.1.12, v4.2.0, v4.2.1, v4.2.2, v4.2.3, v4.2.4, v4.2.5, v4.2.6, v4.2.7, v4.2.8, v4.2.9, v4.2.10, v4.2.11, v4.2.12, v4.3.0, v4.3.1, v4.3.2, v4.3.3, v4.3.4, v4.3.5, v4.3.6, v4.3.7, v4.3.8, v4.3.9, v4.3.10, v4.3.11, v4.4.0, v4.4.1, v4.4.2, v4.4.3, v4.4.4, v4.4.5, v4.4.6, v4.4.7, v4.4.8, v4.4.9, v4.4.10] require php ^7.1.3 -> your php version (8.2.25) does not satisfy that requirement. 16:47:57 - symfony/process[v5.0.0, v5.0.1, v5.0.2, v5.0.3, v5.0.4, v5.0.5, v5.0.6, v5.0.7, v5.0.8] require php ^7.2.5 -> your php version (8.2.25) does not satisfy that requirement. 16:47:57 - web-auth/webauthn-lib v3.3.12 requires symfony/process ^3.0|^4.0|^5.0 -> satisfiable by symfony/process[v3.0.0, v3.0.1, v3.0.2, v3.0.3, v3.0.4, v3.0.5, v3.0.6, v3.0.7, v3.0.8, v3.0.9, v3.1.0, v3.1.1, v3.1.2, v3.1.3, v3.1.4, v3.1.5, v3.1.6, v3.1.7, v3.1.8, v3.1.9, v3.1.10, v3.2.0, v3.2.1, v3.2.2, v3.2.3, v3.2.4, v3.2.5, v3.2.6, v3.2.7, v3.2.8, v3.2.9, v3.2.10, v3.2.11, v3.2.12, v3.2.13, v3.2.14, v3.3.0, v3.3.1, v3.3.2, v3.3.3, v3.3.4, v3.3.5, v3.3.6, v3.3.7, v3.3.8, v3.3.9, v3.3.10, v3.3.11, v3.3.12, v3.3.13, v3.3.14, v3.3.15, v3.3.16, v3.3.17, v3.3.18, v3.4.0, v3.4.1, v3.4.2, v3.4.3, v3.4.4, v3.4.5, v3.4.6, v3.4.7, v3.4.8, v3.4.9, v3.4.10, v3.4.11, v3.4.12, v3.4.13, v3.4.14, v3.4.15, v3.4.16, v3.4.17, v3.4.18, v3.4.19, v3.4.20, v3.4.21, v3.4.22, v3.4.23, v3.4.24, v3.4.25, v3.4.26, v3.4.27, v3.4.28, v3.4.29, v3.4.30, v3.4.31, v3.4.32, v3.4.33, v3.4.34, v3.4.35, v3.4.36, v3.4.37, v3.4.38, v3.4.39, v3.4.40, v3.4.41, v3.4.42, v3.4.43, v3.4.44, v3.4.45, v3.4.46, v3.4.47, v4.0.0, v4.0.1, v4.0.2, v4.0.3, v4.0.4, v4.0.5, v4.0.6, v4.0.7, v4.0.8, v4.0.9, v4.0.10, v4.0.11, v4.0.12, v4.0.13, v4.0.14, v4.0.15, v4.1.0, v4.1.1, v4.1.2, v4.1.3, v4.1.4, v4.1.5, v4.1.6, v4.1.7, v4.1.8, v4.1.9, v4.1.10, v4.1.11, v4.1.12, v4.2.0, v4.2.1, v4.2.2, v4.2.3, v4.2.4, v4.2.5, v4.2.6, v4.2.7, v4.2.8, v4.2.9, v4.2.10, v4.2.11, v4.2.12, v4.3.0, v4.3.1, v4.3.2, v4.3.3, v4.3.4, v4.3.5, v4.3.6, v4.3.7, v4.3.8, v4.3.9, v4.3.10, v4.3.11, v4.4.0, v4.4.1, v4.4.2, v4.4.3, v4.4.4, v4.4.5, v4.4.6, v4.4.7, v4.4.8, v4.4.9, v4.4.10, v4.4.11, v4.4.12, v4.4.13, v4.4.14, v4.4.15, v4.4.16, v4.4.17, v4.4.18, v4.4.19, v4.4.20, v4.4.22, v4.4.25, v4.4.26, v4.4.27, v4.4.30, v4.4.34, v4.4.35, v4.4.36, v4.4.37, v4.4.40, v4.4.41, v4.4.44, v5.0.0, v5.0.1, v5.0.2, v5.0.3, v5.0.4, v5.0.5, v5.0.6, v5.0.7, v5.0.8, v5.0.9, v5.0.10, v5.0.11, v5.1.0, v5.1.1, v5.1.2, v5.1.3, v5.1.4, v5.1.5, v5.1.6, v5.1.7, v5.1.8, v5.1.9, v5.1.10, v5.1.11, v5.2.0, v5.2.1, v5.2.2, v5.2.3, v5.2.4, v5.2.7, v5.2.10, v5.2.11, v5.2.12, v5.3.0, v5.3.2, v5.3.4, v5.3.7, v5.3.11, v5.3.12, v5.3.13, v5.3.14, v5.4.0, v5.4.2, v5.4.3, v5.4.5, v5.4.7, v5.4.8, v5.4.11, v5.4.19, v5.4.21, v5.4.22, v5.4.23, v5.4.24, v5.4.26, v5.4.28, v5.4.34, v5.4.35, v5.4.36, v5.4.39, v5.4.40, v5.4.44, v5.4.45, v5.4.46, v5.4.47].
If this is now a production error, it should be a blocker to wider 8.1 roll-out.
With https://gerrit.wikimedia.org/r/c/mediawiki/core/ /1004257 in place this shouldn't be causing issues in production on PHP 7.4 or 8.1, but it's been added as a blocker – @Reedy, did the work-around not work?
To summarise - looks like everything works and we don't need to upgrade the library at this moment. I'll be bold and resolve this ticket.
If you notice any problems regarding WebAuthn and PHP8.1 or have a use case when it doesn't work - please let me know and I'll investigate it.
Also, webauthn version I was using:
pmiazga@wmf3273:~/projects/mediawiki/extensions/WebAuthn » docker compose exec mediawiki composer info web-auth/webauthn-lib 1 ↵ name : web-auth/webauthn-lib descrip. : FIDO2/Webauthn Support For PHP keywords : FIDO2, fido, webauthn versions : * v3.3.12 type : library license : MIT License (MIT) (OSI approved) https://spdx.org/licenses/MIT.html#licenseText homepage : https://github.com/web-auth source : [git] https://github.com/web-auth/webauthn-lib.git 5ef9b21c8e9f8a817e524ac93290d08a9f065b33 dist : [zip] https://api.github.com/repos/web-auth/webauthn-lib/zipball/5ef9b21c8e9f8a817e524ac93290d08a9f065b33 5ef9b21c8e9f8a817e524ac93290d08a9f065b33 path : /var/www/html/w/vendor/web-auth/webauthn-lib names : web-auth/webauthn-lib
I tested two docker images: registry.wikimedia.org/dev/buster-php74-fpm:1.0.0-s3 and docker-registry.wikimedia.org/dev/buster-php81-fpm:1.0.1-s2. When testing I used or composer to install all dependencies under vendor folder, or cloned the bundled vendor (https://gerrit.wikimedia.org/r/mediawiki/vendor).
I also played with ExtensionDistributor to retrieve the WebAuthn library with dependencies.
A quick note - I tried logging in/logging out between two versions - docker-registry.wikimedia.org/dev/buster-php74-fpm:1.0.0-s3 and docker-registry.wikimedia.org/dev/buster-php81-fpm:1.0.1-s2 -> and the keys worked. EG - the key created under 7.4 worked when trying to log in on 8.1 -> and the same vice versa - 2FA created on 8.1 worked on 7.4.
I got fixated on the composer issue and spend most of my time trying to rebuild composer/etc. But I definitely see a valid point in getting keys set up on 7.4, then bump to 8.1 and try to log in again -> I'll try to do it right now - plus for 7.4 I'll fetch the mediawiki/vendor
In production, we run with what's in mediawiki/vendor, not "composer install". I suggest testing with that instead, since that's where the risk is. The code you get after running "composer update" on php81 is not what we run in production, and will likely expand and select different semver-ranges, etc.
I don't think it's a problem anymore. I tried to find out what could fix it but at first glance I don't see it. At this moment - I'm at:
On docker I'm running PHP 8.1.20 - composer install/update scripts worth without errors - I removed all vendor folders across the app.
~/projects/mediawiki(master○) » docker compose exec mediawiki php -v WARN[0000] /Users/pmiazga/projects/wmf/mediawiki/docker-compose.override.yml: `version` is obsolete PHP 8.1.20 (cli) (built: Jun 9 2023 07:40:35) (NTS) Copyright (c) The PHP Group Zend Engine v4.1.20, Copyright (c) Zend Technologies with Zend OPcache v8.1.20, Copyright (c), by Zend Technologies with Xdebug v3.2.1, Copyright (c) 2002-2023, by Derick Rethans
composer update output:
~/projects/mediawiki(master○) » docker compose exec mediawiki composer update > MediaWiki\Composer\VersionChecker::onEvent Loading composer repositories with package information Updating dependencies Nothing to modify in lock file Installing dependencies from lock file (including require-dev) Package operations: 0 installs, 0 updates, 0 removals Package fgrosse/phpasn1 is abandoned, you should avoid using it. No replacement was suggested. Package web-auth/metadata-service is abandoned, you should avoid using it. Use web-auth/webauthn-lib instead. Generating optimized autoload files 70 packages you are using are looking for funding. Use the `composer fund` command to find out more! > MediaWiki\Composer\ComposerVendorHtaccessCreator::onEvent
Since the property is used in a single class (except for tests and a hook handler made unnecessary by my proposed approach), it could be migrated to a static WeakMap as a stopgap solution once we’re on PHP 8: while it wouldn’t solve the issue, at least it would make core not depend on Scribunto (and remove the need for the hook handler, as cloning the Parser won’t duplicate the WeakMap entry). Making the state serializable won’t be easy: LuaStandaloneEngine keeps references to the Lua process and its standard input and output pipes – all three are resources and thus unserializable. (I guess the same mostly applies to LuaSandboxEngine as well, but its references are buried in a PHP extension.)
Mentioned in SAL (#wikimedia-operations) [2024-11-14T15:47:59Z] <reedy@deploy2002> Synchronized wmf-config/CommonSettings.php: T379834 (duration: 08m 02s)
Change #1090998 merged by jenkins-bot:
[operations/mediawiki-config@master] CommonSettings.php: Properly set $wgCSPReportOnlyHeader/$wgCSPHeader to array
Side effect of T319432: Migrate WMF production from PHP 7.4 to PHP 8.1