composer-patches icon indicating copy to clipboard operation
composer-patches copied to clipboard

Can't install with Composer 2.2

Open zuernBernhard opened this issue 3 years ago • 6 comments

Hi,

Composer 2.2 was released 3 hours ago. I have a cloud Deployment whre composer is installed via CURL in a Docker file during the build process. And on the last rebuilds composer install failed out of a sudden reproducable.



200/200 [============================] 100%
--
957 | - Installing cweagans/composer-patches (1.7.1): Extracting archive
958 | For additional security you should declare the allow-plugins config with a list of packages names that are allowed to run code. See https://getcomposer.org/allow-plugins
959 | You have until July 2022 to add the setting. Composer will then switch the default behavior to disallow all plugins.
960 | Plugin initialization failed (require(vendor/autoload.php): failed to open stream: No such file or directory), uninstalling plugin
961 | - Removing cweagans/composer-patches (1.7.1)
962 | Install of cweagans/composer-patches failed
963 |  
964 |  
965 | [ErrorException]
966 | require(vendor/autoload.php): failed to open stream: No such file or directory
967 |  
968 |  
969 | install [--prefer-source] [--prefer-dist] [--prefer-install PREFER-INSTALL] [--dry-run] [--dev] [--no-suggest] [--no-dev] [--no-autoloader] [--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>]...
970 |  
971 | The command '/bin/sh -c composer install --prefer-dist' returned a non-zero code: 1


Once downgraded to the last version by using :

RUN curl -sS https://getcomposer.org/installer | php -- --install-dir=/usr/bin -- --filename=composer --version=2.1.14

Instead of

RUN curl -sS https://getcomposer.org/installer | php -- --install-dir=/usr/bin -- --filename=composer 

it is working again.

zuernBernhard avatar Dec 22 '21 13:12 zuernBernhard

958 | For additional security you should declare the allow-plugins config with a list of packages names that are allowed to run code. See https://getcomposer.org/allow-plugins

Did you try this? Did it fix your build?

cweagans avatar Dec 22 '21 18:12 cweagans

Yes I have it in the config section of composer json. No it did not work. Had to use composer 2.1

zuernBernhard avatar Dec 22 '21 18:12 zuernBernhard

Can you please post your complete composer.json somewhere? If you don't want it to be public, you can email it to me. [email protected]

cweagans avatar Dec 22 '21 18:12 cweagans

I have the same issue. Composer install broken with composer v2.2. Works fine with composer v2.1.

StuartCreed avatar Dec 23 '21 15:12 StuartCreed

387-composer_json_and_lock.zip

Here are composers.json and composer.lock where it failed for me.

zuernBernhard avatar Dec 23 '21 23:12 zuernBernhard

I can confirm the issue as well with composer-patches 1.7.1 and Composer 2.2.4

balazswmann avatar Jan 12 '22 09:01 balazswmann

This appears to be fixed now.

cweagans avatar Feb 07 '23 21:02 cweagans