Skip to content
Advertisement

Problem with TravisCI version matrix after updating to composer 2.0

After updating to Composer 2.0 I got into problems on doing my Travis.

I have a TYPO3 Extension, that I want to test with multiple TYPO3 Versions. Till yesterday I could do this with composer require nimut/typo3-complete:$TYPO3_VERSION (coming from the version Matrix).

After the update I got following error/information.

JavaScript

As I have no composer.lock in my repository, I tested my pipeline with a composer install first, and then did the update. This is all fine until I go to the next version as the dependencies are different, and the composer.lock from the composer install cannot update the additional dependencies.

I have tried it with composer require --dev nimut/typo3-complete:^10.4 --with-all-dependencies the response from composer:

JavaScript

The -W option is the one I’m trying out already. I have tried both -w and -W, no luck so far.

I’m not sure how to get around this problem yet, your input your be very helpful.

Link to .travis.yml https://github.com/AOEpeople/crawler/blob/master/.travis.yml#L50

Link to Travis Build where testing it out. https://travis-ci.org/github/AOEpeople/crawler/jobs/738603105#L1138

Advertisement

Answer

The issue with composer require was reported and fixed in PR 9336 on Composer’s GitHub repository. It will be in Composer 2.0.2 just about to be released now. So you can upgrade to 2.0.2 and it should resolve your problem.

To explain why your workaround failed:

composer require nimut/typo3-complete:$TYPO3_VERSION edits the composer.json file to add "nimut/typo3-complete": "^$TYPO3_VERSION". Then it runs composer update nimut/typo3-complete, or (on Composer 1.x or 2.0.2+) a plain composer update if no lock file exists yet.

If you run a composer install without a lock file first, this executes a composer update because there is no lock file. The subsequent composer require then still edits the json file and now runs composer update nimut/typo3-complete because there is a lock file. Even with all the dependency options enabled, this may have a different outcome or even a conflict from running a plain composer update as you are restricting the update to only the new package and its dependencies.

User contributions licensed under: CC BY-SA
10 People found this is helpful
Advertisement