Closed
Description
Preconditions (*)
- Magento 2.4-develop branch
- PHP installation without the
sockets
extension installed
Steps to reproduce (*)
- Clone the 2.4-develop branch (I'm using commit 90012f2)
- Run
composer install
=> notice it doesn't work:
$ composer install
Loading composer repositories with package information
Installing dependencies (including require-dev) from lock file
Your requirements could not be resolved to an installable set of packages.
Problem 1
- php-amqplib/php-amqplib v2.10.1 requires ext-sockets * -> the requested PHP extension sockets is missing from your system.
- php-amqplib/php-amqplib v2.10.1 requires ext-sockets * -> the requested PHP extension sockets is missing from your system.
- Installation request for php-amqplib/php-amqplib v2.10.1 -> satisfiable by php-amqplib/php-amqplib[v2.10.1].
- Run
composer update php-amqplib/php-amqplib
=> notice now it suddenly works:
$ composer update php-amqplib/php-amqplib
Loading composer repositories with package information
Updating dependencies (including require-dev)
Package operations: 4 installs, 40 updates, 0 removals
- Downgrading php-amqplib/php-amqplib (v2.10.1 => v2.7.3): Loading from cache
...
--
Now use a PHP installation which does have the sockets
extension installed and try again:
- Clone the 2.4-develop branch (I'm using commit 90012f2)
- Run
composer install
=> notice it works
Expected result (*)
- Since the php extension
sockets
at this time is not required for a Magento installation, I would expect that we can install Magento without it installed
Actual result (*)
- Can only install Magento without the
sockets
extension installed when runningcomposer update
, not when runningcomposer install
Discussion
- The big problem is that we now have the following constraint defined:
"php-amqplib/php-amqplib": "~2.7.0||~2.10.0",
in thecomposer.lock
file php-amqplib/php-amqplib
version 2.7 does not needsockets
, version 2.10 does needsockets
php-amqplib/php-amqplib
requires thesockets
extension since version 2.8.1
Solutions
Here are some possible solutions:
- Document that the
sockets
extension is required in the documentation and remove the constraint~2.7.0||
from thecomposer.json
file - If we don't want the
sockets
extension to become required for Magento, we should change the constraint to:~2.7.0
- Make all developers of Magento use the exact same PHP installation (I know this is not realistic), so that when they run
composer update
it doesn't suddenly upgradephp-amqplib/php-amqplib
to a version which might not work on other people's installations
(it was corrected in 3d223517139#diff-1da2c7edc898c70e5a79a9997c98ceccL1392 and then changed again in 9f14f89#diff-1da2c7edc898c70e5a79a9997c98ceccL1393)
Metadata
Metadata
Assignees
Labels
Gate 3 Passed. Manual verification of the issue completed. Issue is confirmedGate 1 Passed. Automatic verification of issue format passedGate 4. Acknowledged. Issue is added to backlog and ready for developmentOnce P0 defects have been fixed, a defect having this priority is the next candidate for fixing.Indicates original Magento version for the Issue report.The issue has been reproduced on latest 2.4-develop branchAffects critical data or functionality and forces users to employ a workaround.Has been reviewed and prioritized during Triage with Product Managers
Type
Projects
Status
Done