Page MenuHomePhabricator

Remove okvpn/clock-lts post WMF PHP 8.3 upgrade
Open, Needs TriagePublic

Description

We swapped from lcobucci/clock to okvpn/clock-lts in T405031: lcobucci/clock needs upgrading for PHP 8.3 to allieviate some PHP upgrade issues.

lcobucci/clock predates PSR-20, there is no reason for a modern PHP library to depend on it. So hopefully we can just upgrade everything to the point where it goes away as a dependency, and then use ConvertibleTimestamp's clock instead.

Related Objects

StatusSubtypeAssignedTask
OpenNone
OpenNone
OpenNone
OpenNone
OpenNone
ResolvedKrinkle
ResolvedKrinkle
ResolvedJdforrester-WMF
ResolvedJdforrester-WMF
ResolvedJdforrester-WMF
ResolvedLucas_Werkmeister_WMDE
ResolvedNone
ResolvedJdforrester-WMF
ResolvedDaimona
ResolvedJdforrester-WMF
DeclinedNone
ResolvedScott_French
ResolvedScott_French
ResolvedScott_French
Resolvedcscott
ResolvedScott_French
DuplicatePRODUCTION ERRORNone
ResolvedPRODUCTION ERRORMichael
ResolvedPRODUCTION ERRORMichael
ResolvedMichael
DuplicatePRODUCTION ERRORNone
ResolvedTgr
ResolvedNone
ResolvedDAlangi_WMF
ResolvedTgr
ResolvedDAlangi_WMF
ResolvedTgr
ResolvedTgr
ResolvedAtieno
OpenNone
Resolvedbrouberol
ResolvedScott_French
ResolvedScott_French
ResolvedScott_French
ResolvedScott_French
ResolvedScott_French
ResolvedScott_French
ResolvedKrinkle
ResolvedKrinkle
ResolvedScott_French
ResolvedKrinkle
ResolvedTgr
ResolvedScott_French
Resolvedjnuche
ResolvedJdforrester-WMF
ResolvedBUG REPORTbd808

Event Timeline

I think it might be worth sticking to clock-lts. The author of clock has strongly decided that they do not maintain more than 1-2 versions of PHP support and will enforce this via composer.json at install time. This means we'll be here again.

If we install the clock package in mediawiki/vendor, the repo becomes un-installable in any local/third-party context with a PHP version other the one we run at WMF. It's quite inflexible.

Assuming WMF stays within the last 2 versions of PHP going forward, we will be able run the latest version of clock in production. But through vendor, it makes PHP upgrades hard even when upgrading from latest minus one to latest. The author basically requires intermediary packages to specify a range of versions, and then assumes that you run composer install in production.

There's also CI pipelines. We couldn't run mediawiki-vendor in CI on the master branch. After we drop PHP 8.1, we'll be down to supporting 3-4 versions only (PHP 8.2-8.4) which seems managable, yet is still incompatible with clock.

Reedy renamed this task from Swap back to lcobucci/clock post WMF PHP 8.3 upgrade to Swap back to lcobucci/clock post WMF PHP 8.3 upgrade?.Oct 7 2025, 11:06 AM
Reedy updated the task description. (Show Details)

lcobucci/clock predates PSR-20, there is no reason for a modern PHP library to depend on it. So hopefully we can just upgrade everything to the point where it goes away as a dependency, and then use ConvertibleTimestamp's clock instead.

Sounds good to me, even better.

Reedy renamed this task from Swap back to lcobucci/clock post WMF PHP 8.3 upgrade? to Remove lcobucci/clock (or replacement) post WMF PHP 8.3 upgrade.Oct 29 2025, 12:24 PM
Reedy renamed this task from Remove lcobucci/clock (or replacement) post WMF PHP 8.3 upgrade to Remove okvpn/clock-lts post WMF PHP 8.3 upgrade.Nov 18 2025, 4:11 PM
Reedy updated the task description. (Show Details)

Reedy renamed this task from Remove lcobucci/clock (or replacement) post WMF PHP 8.3 upgrade to Remove okvpn/clock-lts post WMF PHP 8.3 upgrade.

This is more, "when we drop PHP 8.1 support from OATHAuth" and is blocked by T405344, right?

            "name": "web-auth/webauthn-lib",
            "version": "4.9.2",
...
            "suggest": {
...
                "psr/clock-implementation": "As of 4.5.x, the PSR Clock implementation will replace lcobucci/clock",

^ It kinda looks like we could replace it away (now), if we have have something that satisfies https://packagist.org/providers/psr/clock-implementation, which wikimedia/timestamp does.. as per Gergo above. I haven't looked what extra wiring would be needed, if any.

OAuth however has dependancies on it too via lcobucci/jwt and then league/oauth2-server...

So that brings in T261462: Migrate OAuth extension back from wikimedia/oauth2-server fork to upstream to the tree

lcobucci/jwt also only depends on psr/clock (if we can get to a reasonably recent version of it). So yeah oauth2-server is the weak link.