Upgrade of composer to v1.1.0 breaks some builds
Closed, ResolvedPublic

Description

We got composer upgraded to v1.1.0 and random builds are now failing. For example operations/mediawiki-config , a build running on Nodepool/Jessie/Hhvm:

./composer.json has been updated 
Loading composer repositories with package information
Updating dependencies (including require-dev) 
[Thu Mar  2 10:48:13 2017] [hphp] [1577:7f613ff036c0:0:000001] [] SlowTimer [6629ms] at curl: http://packagist.org/p/provider-2017-01%2486599eea03d545a7111fd4582ccf64efc63923832fdd84157347e47b0250a1ce.json
Dependency resolution completed in 0.029 seconds
Your requirements could not be resolved to an installable set of packages. 

  Problem 1
    - Installation request for phpunit/phpunit 3.7.37 -> satisfiable by phpunit/phpunit[3.7.37].
    - Conclusion: don't install phpunit/php-code-coverage 2.2.4
    - phpunit/phpunit 3.7.37 requires phpunit/php-code-coverage ~1.2 -> satisfiable by phpunit/php-code-coverage[1.2.0, 1.2.1, 1.2.10, 1.2.11, 1.2.12, 1.2.13, 1.2.14, 1.2.15, 1.2.16, 1.2.17, 1.2.18, 1.2.2, 1.2.3, 1.2.6, 1.2.7, 1.2.8, 1.2.9].
    - Can only install one of: phpunit/php-code-coverage[1.2.0, 2.2.4].
    - Can only install one of: phpunit/php-code-coverage[1.2.1, 2.2.4].
    - Can only install one of: phpunit/php-code-coverage[1.2.10, 2.2.4].
    - Can only install one of: phpunit/php-code-coverage[1.2.11, 2.2.4].
    - Can only install one of: phpunit/php-code-coverage[1.2.12, 2.2.4].
    - Can only install one of: phpunit/php-code-coverage[1.2.13, 2.2.4].
    - Can only install one of: phpunit/php-code-coverage[1.2.14, 2.2.4].
    - Can only install one of: phpunit/php-code-coverage[1.2.15, 2.2.4].
    - Can only install one of: phpunit/php-code-coverage[1.2.16, 2.2.4].
    - Can only install one of: phpunit/php-code-coverage[1.2.17, 2.2.4].
    - Can only install one of: phpunit/php-code-coverage[1.2.18, 2.2.4].
    - Can only install one of: phpunit/php-code-coverage[1.2.2, 2.2.4].
    - Can only install one of: phpunit/php-code-coverage[1.2.3, 2.2.4].
    - Can only install one of: phpunit/php-code-coverage[1.2.6, 2.2.4].
    - Can only install one of: phpunit/php-code-coverage[1.2.7, 2.2.4].
    - Can only install one of: phpunit/php-code-coverage[1.2.8, 2.2.4].
    - Can only install one of: phpunit/php-code-coverage[1.2.9, 2.2.4].
    - Installation request for phpunit/php-code-coverage (locked at 2.2.4) -> satisfiable by phpunit/php-code-coverage[2.2.4].
Installation failed, reverting ./composer.json to its original content.
hashar created this task.Mar 2 2017, 10:51 AM

Mentioned in SAL (#wikimedia-operations) [2017-03-02T10:51:32Z] <hashar> CI composer based builds are sometime broken since composer got upgraded to 1.1.0 . See https://phabricator.wikimedia.org/T159431

hashar updated the task description. (Show Details)Mar 2 2017, 10:52 AM
Paladox added a comment.EditedMar 2 2017, 11:07 AM

@hashar this is fixed in composer 1.1.1, see https://github.com/composer/composer/issues/5346 please

We should upgrade to the latest 1.1.x release and then to 1.3.x.

Change 340710 had a related patch set uploaded (by Hashar):
[integration/jenkins] composer-dev-args: spurt exception to stderr

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

operations-mw-config-composer-hhvm-jessie does:

node /srv/deployment/integration/slave-scripts/tools/composer-dev-args.js "composer.json" | xargs composer require --dev --ansi --no-progress --ignore-platform-reqs --prefer-dist -v

But /tools/composer-dev-args.js "composer.json" yields Error: Cannot find module 'composer.json'

Change 340712 had a related patch set uploaded (by Hashar):
[integration/config] [mediawiki-config] verbose xargs for mw-fetch-composer-dev

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

Change 340713 had a related patch set uploaded (by Hashar):
[integration/config] [mediawiki-config] use full path to composer.json

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

For operations/mediawiki-config we have not been using the require-dev from its composer.json. It never worked and we ended up using the fall back to phpunit/phpunit=3.7.37

The reason was nodejs require('composer.json'); which failed because it does not look in cwd. Using an absolute path via $(pwd)/composer.json solves that specific issue.

Change 340712 merged by Hashar:
[integration/config] [mediawiki-config] verbose xargs for mw-fetch-composer-dev

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

Change 340713 merged by Hashar:
[integration/config] [mediawiki-config] use full path to composer.json

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

Change 340710 merged by Hashar:
[integration/jenkins] composer-dev-args: spurt exception to stderr

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

hashar closed this task as Resolved.Mar 2 2017, 11:47 AM

Fixed by using an absolute paths to composer.json. As a side effect enhanced composer-fetch-dev to be more verbose overall.

hashar added a comment.Mar 2 2017, 9:05 PM

From T125343#3068454 and below, that also broke mwext-php70-phan-jessie . Got fixed by bumping to 1.1.3