We should file a bug upstream with composer about their autoloader being slow with some performance info we have from the cluster and Tim's analysis (https://github.com/wmde/WikidataBuilder/pull/32).
Description
Details
Related Objects
- Mentioned In
- T55835: Provide a PSR-4 autoloader
rMW5b5b6974eb0d: composer.json: Set classmap-authoritative: true
T99865: Extension registration should support using a PSR-4 autoloader
rEDIV72856f022820: Rebuild composer autoloader
rMWVDb208abfd6ee5: Set classmap-authoritative: true
rOMWC0367b9073ec6: composer.json: Set classmap-authoritative: true
rMWVD7e92ce376c8b: Revert "Use classmap-authoritative setting"
rMWVDaa275e827461: Use classmap-authoritative setting
rCIPU8952c2862d48: Rebuild composer autoloader to support classmap-authoritative setting
T85737: Optimize Wikidata's Composer class loader impact - Mentioned Here
- T73629: integration/phpunit has an older composer/ClassLoader.php that doesn't understand psr-4
Event Timeline
A possible fix for the MediaWiki specific use case proposed at https://github.com/composer/composer/pull/3610.
Change 187151 had a related patch set uploaded (by Legoktm):
Use classmap-authoritative setting
Change 187181 had a related patch set uploaded (by Legoktm):
composer.json: Set classmap-authoritative: true
Change 187656 had a related patch set uploaded (by Hashar):
Revert "Use classmap-authoritative setting"
@Legoktm I am reverting the class map authoritative patch because that breaks scap on beta cluster:
deployment-bastion$ mwscript mergeMessageFileList.php --wiki=eowiki --list-file="/srv/mediawiki-staging/wmf-config/extension-list" PHP Fatal error: Call to undefined method Composer\Autoload\ClassLoader::setClassMapAuthoritative() in /mnt/srv/mediawiki-staging/php-master/vendor/composer/autoload_real.php on line 41
Which breaks beta-scap-eqiad job.
This is similar to T73629: integration/phpunit has an older composer/ClassLoader.php that doesn't understand psr-4. The Composer\Autoload\ClassLoader class is common to all Composer-managed vendor collections. Each vendor ships one but only the first one that is loaded is used by the PHP/HHVM runtime. In this case the version of the class from multiversion is being invoked. So multiversion needs to be rebuilt with the latest Composer before we can use this feature. When that hurdle is cleared I'm pretty sure we will need to update the version of the class from integration/phpunit.
Change 188393 had a related patch set uploaded (by Legoktm):
composer.json: Set classmap-authoritative: true
Change 188398 had a related patch set uploaded (by Legoktm):
Rebuild composer autoloader to support classmap-authoritative setting
Change 188398 merged by jenkins-bot:
Rebuild composer autoloader to support classmap-authoritative setting
@Legoktm Do you have a checklist somewhere of the various Composer ClassLoader classes that we need to be sure are up to date?
Are there any left that we need to fix before trying to set "classmap-authoritative": true again?
Change 202126 had a related patch set uploaded (by Legoktm):
Set classmap-authoritative: true
Enabled it for Wikidata: https://github.com/wmde/WikidataBuildResources/commit/31c9cc34a9372cbb4f95989c5929ccdb4e6123f4 Build for beta with it: https://gerrit.wikimedia.org/r/#/c/203340/1
@Legoktm I think this is {{done}} now. Is there anything else left that you wanted to do?