Magento-lts: Incompatibility with composer 2.0

Created on 28 Oct 2020  路  4Comments  路  Source: OpenMage/magento-lts

Preconditions (*)

  1. OpenMage version 19.4.7
  2. Composer version 1.10.13 2020-09-09 11:46:34
  3. PHP version 7.3.18

Steps to reproduce (*)

  1. Update composer file for installation
    "require": {
    "aydin-hassan/magento-core-composer-installer": "*",
    "openmage/magento-lts": "19.4.7"
    },
    "extra": {
    "magento-core-package-type": "magento-source",
    "magento-root-dir": "."
    }
  2. Run: composer install

Expected result (*)

  1. Installation passes and all needed packages get installed properly.

Actual result (*)

  1. Composer error during installation connected to composer-plugin-api not existing in version ~1.0 any more. Main problem is with aydin-hassan/magento-core-composer-installer and magento-hackathon/magento-composer-installer requiring non existant package.
    _Problem 1

    • Root composer.json requires aydin-hassan/magento-core-composer-installer 1.5.0 -> satisfiable by aydin-hassan/magento-core-composer-installer[1.5.0].

    • aydin-hassan/magento-core-composer-installer 1.5.0 requires composer-plugin-api ~1.0 -> found composer-plugin-api[2.0.0] but it does not match the constraint.

      Problem 2

    • magento-hackathon/magento-composer-installer[3.1.0, ..., 3.2.3] require composer-plugin-api ^1.0 -> found composer-plugin-api[2.0.0] but it does not match the constraint.

    • magento-hackathon/magento-composer-installer 2.1.3 requires composer-plugin-api ~1.0 -> found composer-plugin-api[2.0.0] but it does not match the constraint.

    • magento-hackathon/magento-composer-installer[2.1.0, ..., 2.1.1] require composer-plugin-api 1.0.0 -> found composer-plugin-api[2.0.0] but it does not match the constraint.

    • openmage/magento-lts v19.4.7 requires magento-hackathon/magento-composer-installer ^3.1 || ^2.1 -> satisfiable by magento-hackathon/magento-composer-installer[2.1.0, 2.1.1, 2.1.3, 3.1.0, ..., 3.2.3].

    • Root composer.json requires openmage/magento-lts 19.4.7 -> satisfiable by openmage/magento-lts[v19.4.7].

      You are using Composer 2, which some of your plugins seem to be incompatible with. Make sure you update your plugins or report a plugin-issue to ask them to support Composer 2._

bug fixed

All 4 comments

This is solved in the latest release of both installers
(tested with https://github.com/Cotya/OpenMage-demo-deployment/blob/9e61a1eb6b88571a8a0309a05d740c04c53573de/src/composer.json#L6 )

as OpenMage has a stricter limit on compatible installer versions (we should be more open here maybe), this will only work from the next OpenMage release on.
Till then you need to add a small workaround by requiring the installer as a different version

"magento-hackathon/magento-composer-installer": "4.0.1 as 3.2.3",

Is this issue now solved since release 20.0.5?
The composer.json includes 4.0.1 as far as I can tell.

"magento-hackathon/magento-composer-installer": "^3.1 || ^2.1 || ^4.0"

Yes, thank you for reminding us to close this Issue :)

In case you (or anyone else) notices any Issues with Composer 2.0, please feel free to inform us

Was this page helpful?
0 / 5 - 0 ratings

Related issues

seansan picture seansan  路  6Comments

colinmollenhour picture colinmollenhour  路  8Comments

diogoceribelli picture diogoceribelli  路  3Comments

emateu picture emateu  路  3Comments

ioweb-gr picture ioweb-gr  路  6Comments