Skip to content

Travis builds are failing due to composer-plugin-api version mismatch #558

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
shrop opened this issue Apr 11, 2020 · 4 comments
Closed

Travis builds are failing due to composer-plugin-api version mismatch #558

shrop opened this issue Apr 11, 2020 · 4 comments

Comments

@shrop
Copy link

shrop commented Apr 11, 2020

Travis builds are failing due to composer-plugin-api version mismatch. Issue is Travis is using a snapshot version of Composer that appears the have composer-plugin-api v2 and that conflicts with cweagans/composer-patches, which requires composer-plugin-api v1.

We first noticed this in same issue in Guardr, which leverages Drupal Project code. Reference: https://www.drupal.org/project/guardr/issues/3126162#comment-13549572. @joestewart resolves this by commenting out the snapshot build for Composer in the Travis config file. guardrdistro/guardr-project#26.

See: https://travis-ci.org/github/drupal-composer/drupal-project/jobs/673820359

Your requirements could not be resolved to an installable set of packages.

  Problem 1

    - cweagans/composer-patches 1.6.5 requires composer-plugin-api ^1.0 -> found composer-plugin-api[2.0.0] but it does not match your constraint.

    - cweagans/composer-patches 1.6.6 requires composer-plugin-api ^1.0 -> found composer-plugin-api[2.0.0] but it does not match your constraint.

    - cweagans/composer-patches 1.6.7 requires composer-plugin-api ^1.0 -> found composer-plugin-api[2.0.0] but it does not match your constraint.

    - Root composer.json requires cweagans/composer-patches ^1.6.5 -> satisfiable by cweagans/composer-patches[1.6.7, 1.6.6, 1.6.5].

You are using a snapshot build of Composer 2, which some of your plugins seem to be incompatible with. Make sure you update your plugins or report an issue to them to ask them to support Composer 2. To work around this you can run Composer with --ignore-platform-reqs, but this will also ignore your PHP version and may result in bigger problems down the line.

The command "composer --verbose install" failed and exited with 2 during .
@shrop
Copy link
Author

shrop commented Apr 12, 2020

PR #559 should resolves this issue. All tests pass: https://travis-ci.org/github/drupal-composer/drupal-project/builds/673931674. This PR also has a fix for #561.

Nothing there could be a better fix than commenting out the composer snapshot setting. Maybe just remove that line, but not 100% on that and would love some feedback.

@joestewart
Copy link

Drupal 8.x may continue to specify Composer 1.x - https://www.drupal.org/project/drupal/issues/3126566#comment-13550328

The snapshot channel seems to only be 2.x

 php composer.phar self-update --1 --snapshot
Updating to version be1ddcf29356cea48c87ff8a8d670311f3d78a38 (snapshot channel).
   Downloading (100%)         
Use composer self-update --rollback to return to version 1.10.5

php composer.phar --version
Composer version 2.0-dev (2.0-dev+be1ddcf29356cea48c87ff8a8d670311f3d78a38) 2020-04-13 10:48:43

@shrop
Copy link
Author

shrop commented Apr 13, 2020

Thanks @joestewart!

@normanlolx
Copy link
Collaborator

Seems to have been fixed in #575.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants