Page MenuHomePhabricator

Your Composer dependencies require a PHP version ">= 8.0.2". You are running ...
Closed, ResolvedPublicBUG REPORT

Description

Whenever I try to run PHPUnit tests with a PHP version less than 8, I get an error like this:

Composer detected issues in your platform:

Your Composer dependencies require a PHP version ">= 8.0.2". You are running 7.4.28.

PHP Fatal error:  Composer detected issues in your platform: Your Composer dependencies require a PHP version ">= 8.0.2". You are running 7.4.28. in /var/www/html/w/vendor/composer/platform_check.php on line 24
PHP Stack trace:
PHP   1. {main}() /var/www/html/w/vendor/bin/phpunit:0
PHP   2. include() /var/www/html/w/vendor/bin/phpunit:115
PHP   3. require() phpvfscomposer:///var/www/html/w/vendor/phpunit/phpunit/phpunit:95
PHP   4. ComposerAutoloaderInitf73e0b5361229c8c90eee54c77b9cd00::getLoader() /var/www/html/w/vendor/autoload.php:7
PHP   5. require() /var/www/html/w/vendor/composer/autoload_real.php:25
PHP   6. trigger_error($message = 'Composer detected issues in your platform: Your Composer dependencies require a PHP version ">= 8.0.2". You are running 7.4.28.', $error_type = 256) /var/www/html/w/vendor/composer/platform_check.php:24

This wouldn't be the end of the world, except when I try to generate a code coverage report, I get:

Error:         This version of PHPUnit does not support code coverage on PHP 8

I tried grepping in vendor for >=.*8\.0\.2, and found that symfony/string, symfont/deprecation-contracts, and symfony/var-dumper all seem to have this requirement. I have no idea how Composer works, so I don't really know how to debug further.

Event Timeline

Which version of /vendor are you using? Presumably not mediawiki/vendor.git but a local build?

How are you getting your vendor folder?

Looking at https://github.com/wikimedia/mediawiki-vendor/blob/master/composer.lock suggests it's not MediaWiki-Vendor, so presumably one you installed yourself.

Re-run composer update using PHP 7.4 and I presume that should fix your problem (by downgrading some of those symfony libraries). It would sound like you previously ran it with PHP 8+

Simetrical claimed this task.

I have no idea where I originally got my vendor, I installed it years ago. I probably just followed whatever the instructions were on the wiki.

Reedy gets a prize! Yes, that fixed the problem. Very logical, too. Thanks!

Change 856547 had a related patch set uploaded (by WgevaertWikiBase; author: WgevaertWikiBase):

[mediawiki/extensions/DisplayTitle@REL1_35] Fix T305624 and T309051: Do not remove fragments if not proper part of text

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

Change 856547 had a related patch set uploaded (by Aklapper; author: WgevaertWikiBase):

[mediawiki/extensions/DisplayTitle@REL1_35] Do not remove fragments if not proper part of text

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

Change 856547 had a related patch set uploaded (by WgevaertWikiBase; author: WgevaertWikiBase):

[mediawiki/extensions/DisplayTitle@REL1_35] Fix T305624 and T309051: Do not remove fragments if not proper part of text

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