Last modified: 2014-10-03 23:28:23 UTC

Wikimedia Bugzilla is closed!

Wikimedia migrated from Bugzilla to Phabricator. Bug reports are handled in Wikimedia Phabricator.
This static website is read-only and for historical purposes. It is not possible to log in and except for displaying bug reports and their history, links might be broken. See T73629, the corresponding Phabricator task for complete and up-to-date bug report information.
Bug 71629 - integration/phpunit has an older composer/ClassLoader.php that doesn't understand psr-4
integration/phpunit has an older composer/ClassLoader.php that doesn't unders...
Status: RESOLVED FIXED
Product: Wikimedia
Classification: Unclassified
Continuous integration (Other open bugs)
wmf-deployment
All All
: High normal (vote)
: ---
Assigned To: Bryan Davis
:
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2014-10-03 21:52 UTC by Bryan Davis
Modified: 2014-10-03 23:28 UTC (History)
3 users (show)

See Also:
Web browser: ---
Mobile Platform: ---
Assignee Huggle Beta Tester: ---


Attachments

Description Bryan Davis 2014-10-03 21:52:08 UTC
The wikimedia/iegreview project is using a PSR-4 autoloading scheme (just like PSR-0 except you don't have to have a bunch of empty directories in your path to define the full namespace).

The phpunit job for this repository is failing with this error:

PHP Fatal error:  Call to undefined method Composer\Autoload\ClassLoader::setPsr4() in /srv/ssd/jenkins-slave/workspace/wikimedia-iegreview-phpunit/vendor/composer/autoload_real.php on line 33
PHP Stack trace:
PHP   1. {main}() /srv/deployment/integration/phpunit/vendor/phpunit/phpunit/composer/bin/phpunit:0
PHP   2. PHPUnit_TextUI_Command::main() /srv/deployment/integration/phpunit/vendor/phpunit/phpunit/composer/bin/phpunit:63
PHP   3. PHPUnit_TextUI_Command->run() /srv/deployment/integration/phpunit/vendor/phpunit/phpunit/PHPUnit/TextUI/Command.php:129
PHP   4. PHPUnit_TextUI_Command->handleArguments() /srv/deployment/integration/phpunit/vendor/phpunit/phpunit/PHPUnit/TextUI/Command.php:138
PHP   5. PHPUnit_TextUI_Command->handleBootstrap() /srv/deployment/integration/phpunit/vendor/phpunit/phpunit/PHPUnit/TextUI/Command.php:606
PHP   6. PHPUnit_Util_Fileloader::checkAndLoad() /srv/deployment/integration/phpunit/vendor/phpunit/phpunit/PHPUnit/TextUI/Command.php:778
PHP   7. PHPUnit_Util_Fileloader::load() /srv/deployment/integration/phpunit/vendor/phpunit/phpunit/PHPUnit/Util/Fileloader.php:76
PHP   8. include_once() /srv/deployment/integration/phpunit/vendor/phpunit/phpunit/PHPUnit/Util/Fileloader.php:92
PHP   9. require() /srv/ssd/jenkins-slave/workspace/wikimedia-iegreview-phpunit/tests/bootstrap.php:24
PHP  10. ComposerAutoloaderInit219a9bfa76f2ac9b53cf75ea98d99ffa::getLoader() /srv/ssd/jenkins-slave/workspace/wikimedia-iegreview-phpunit/vendor/autoload.php:7



After a lot of head scratching I figured out that this is caused by the vendor/composer/ClassLoader.php that is loaded from the integration/phpunit project to run phpunit. This older version of the \Composer\Autoload\ClassLoader class shadows the newer version present in wikimedia/iegreview/vendor/composer/ClassLoader.php.

The fix for this should be as easy as regenerating the classloader for the integration/phpunit project using a newer version of Composer that supports PSR-4 autoloaders.
Comment 1 Gerrit Notification Bot 2014-10-03 21:59:20 UTC
Change 164683 had a related patch set uploaded by BryanDavis:
Update to phpunit 3.7.37 and PSR-4 classloader

https://gerrit.wikimedia.org/r/164683
Comment 2 Gerrit Notification Bot 2014-10-03 22:14:07 UTC
Change 164687 had a related patch set uploaded by BryanDavis:
Regenerate autoloader

https://gerrit.wikimedia.org/r/164687
Comment 3 Gerrit Notification Bot 2014-10-03 22:31:05 UTC
Change 164687 merged by BryanDavis:
Regenerate autoloader

https://gerrit.wikimedia.org/r/164687
Comment 4 Bryan Davis 2014-10-03 23:28:23 UTC
Tests needing PSR-4 autoloader are passing now. I left a pending patch for Antoine to look at that would upgrade phpunit to the latest 3.7.x version.

Note You need to log in before you can comment on or make changes to this bug.


Navigation
Links