Skip to content

Install failure with some versions of Composer 2 #2

Open
@superterran

Description

@superterran

We have a deployment image that installs composer2 from https://getcomposer.org/composer.phar before installation. The version that's currently installed is...

$ composer -v
   ______
  / ____/___  ____ ___  ____  ____  ________  _____
 / /   / __ \/ __ `__ \/ __ \/ __ \/ ___/ _ \/ ___/
/ /___/ /_/ / / / / / / /_/ / /_/ (__  )  __/ /
\____/\____/_/ /_/ /_/ .___/\____/____/\___/_/
                    /_/
Composer version 2.1-dev (2.1-dev+d7154c2a72101b40c0f93daeea9b81dd484129c3) 2021-11-02 13:39:04

When I try to install Magento 2.4.3 from composer, the installation fails when I get to this dependency version verifier package with the following error:

$ composer install
...
  - Installing composer/ca-bundle (1.3.1): Extracting archive
  - Installing composer/composer (1.10.23): Extracting archive
  - Installing colinmollenhour/credis (1.11.1): Extracting archive
  - Installing colinmollenhour/php-redis-session-abstract (v1.4.4): Extracting archive
  - Installing magento/framework (103.0.3-p1): Extracting archive
  - Installing squizlabs/php_codesniffer (3.5.8): Extracting archive
  - Installing dealerdirect/phpcodesniffer-composer-installer (v0.7.1): Extracting archive
  - Installing magento/composer-dependency-version-audit-plugin (0.1.1): Extracting archive

                                 
  [Exception]                    
  Unrecognized Composer Version  
                                 

install [--prefer-source] [--prefer-dist] [--prefer-install PREFER-INSTALL] [--dry-run] [--dev] [--no-suggest] [--no-dev] [--no-autoloader] [--no-scripts] [--no-progress] [--no-install] [-v|vv|vvv|--verbose] [-o|--optimize-autoloader] [-a|--classmap-authoritative] [--apcu-autoloader] [--apcu-autoloader-prefix APCU-AUTOLOADER-PREFIX] [--ignore-platform-req IGNORE-PLATFORM-REQ] [--ignore-platform-reqs] [--] [<packages>]...

I believe the issue is that the version parsing this module is performing isn't taking into account the -dev suffix in the version, and errors out as it cannot identify this composer version. Replacing composer with this version https://getcomposer.org/download/2.1.12/composer.phar which reports as Composer version 2.1.12 2021-11-09 16:02:04 allows me to complete the installation. I believe the logic here needs to match even with these version suffixes.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions