Page MenuHomePhabricator

lcobucci/clock needs upgrading for PHP 8.3
Closed, ResolvedPublic

Description

In T363639: web-auth/webauthn-lib must be upgraded to 4+ for PHP 8.2+ support we upgrade to "lcobucci/clock": "2.3.0",

https://packagist.org/packages/lcobucci/clock#2.3.0 php: ~8.1.0 || ~8.2.0

But those patches fail on PHP 8.3+ as seen in https://integration.wikimedia.org/ci/job/quibble-vendor-mysql-php83/13283/console

20:14:44   Problem 1
20:14:44     - lcobucci/clock is locked to version 2.3.0 and an update of this package was not requested.
20:14:44     - lcobucci/clock 2.3.0 requires php ~8.1.0 || ~8.2.0 -> your php version (8.3.24) does not satisfy that requirement.
20:14:44   Problem 2
20:14:44     - web-auth/webauthn-lib is locked to version 4.9.2 and an update of this package was not requested.
20:14:44     - lcobucci/clock 2.3.0 requires php ~8.1.0 || ~8.2.0 -> your php version (8.3.24) does not satisfy that requirement.
20:14:44     - web-auth/webauthn-lib 4.9.2 requires lcobucci/clock ^2.2|^3.0 -> satisfiable by lcobucci/clock[2.3.0].

https://packagist.org/packages/lcobucci/clock#3.3.1 php: ~8.2.0 || ~8.3.0 || ~8.4.0
https://packagist.org/packages/lcobucci/clock#3.2.0 php: ~8.2.0 || ~8.3.0
https://packagist.org/packages/lcobucci/clock#3.1.0 php: ~8.2.0
https://packagist.org/packages/lcobucci/clock#3.0.0 php: ~8.1.0 || ~8.2.0

Event Timeline

Upstream has declined supporting PHP 8.1 and 8.3 in the same release:

https://github.com/lcobucci/clock/issues/685

I now understand your constraints and you indeed won't be able to have a single lock file that will be usable for both php 8.1 and 8.3 using this library.

The policy I follow for PHP version support in my libs don't accommodate for what you need.

The irony is that the package works fine on PHP 8.1, it's just an artifically strict requirement.

The author suggested overriding platform dependencies, but htat's not workable as it would mean everyone installing it, including CI, has to specify this. It would fail by default for anyone trying to install it.

Someone has forked the package at https://github.com/okvpn/clock-lts, which literally just loosens the PHP requirement and declares to Composer that it is a replacement to satisfy lcobucci/clock dependencies elsewhere. That should do the trick.

Thanks!

Hopefully we’ll get the WebAuthn patch landed soon, and then we can update to using that to help ease the transition!

Change #1159483 had a related patch set uploaded (by Krinkle; author: Reedy):

[mediawiki/vendor@master] Upgrade web-auth/webauthn-lib and dependencies...

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

Change #1159483 merged by jenkins-bot:

[mediawiki/vendor@master] Upgrade web-auth/webauthn-lib and dependencies...

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

Can we declare this Resolved? Do we want a task for switching back once we drop 8.1 support?

It's a good question. The task itself is resolved

https://github.com/lcobucci/clock/commits/3.4.x/ seems to not get much actual development activity, mostly (a lot of) package bumping.

If https://github.com/okvpn/clock-lts continues to follow upstream updates in a timely fashion, is there much point swapping back?

If https://github.com/okvpn/clock-lts continues to follow upstream updates in a timely fashion, is there much point swapping back?

Well, any ways in which we deviate from "normal" is a minor increase in risk from lower coverage / exposure to issues in the wider install community. But it's certainly not absolutely required.

Reedy assigned this task to Krinkle.

Change #1201221 had a related patch set uploaded (by Arlolra; author: Arlolra):

[mediawiki/core@master] Add okvpn/clock-lts as requirement

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

Change #1201221 abandoned by Arlolra:

[mediawiki/core@master] Add okvpn/clock-lts as requirement

Reason:

Alright, nevermind, I'll leave this vendor only

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