Dirty secret of using composer is that there is an open on-going big bug. There will be instances where doing "composer update -vvv" or "composer require x/y -vvv" will get you exception errors. proc_open fails because of lack of memory.
Google : composer + proc_open(): fork failed
Composer update runs out of memory
https://github.com/composer/composer/issues/1898
Composer maintainers admit that there needs to be a better way and in the meantime up your memory during composer updates and requires. Thus, we need an alternative way of installing "address" module and its libraries without going through composer.
Anyone out there knows how to install "address" module and satisfy the vendor libraries requirements?
Comment | File | Size | Author |
---|---|---|---|
#5 | 2770019-5-address-troubleshooting-composer-fails.patch | 1.08 KB | chriscalip |
Comments
Comment #2
chriscalip CreditAttribution: chriscalip commentedComment #3
chriscalip CreditAttribution: chriscalip commentedFixing the installation problem for d8 address module, ie. composer fails in installing commerceguys libraries, zone and addressing.
The crux of the problem is the architecture of composer is currently having scaling pains. The more packagist.org modules are in play the more
apparent the scale pains.
address/README.MD
Installation
-------------
This module needs to be installed via Composer, which will download the required libraries.
1. Add the Drupal Packagist repository
```sh
composer config repositories.drupal composer https://packagist.drupal-composer.org
```
This allows Composer to find Address and the other Drupal modules.
2. Download Address
This will download the latest release of Address.
Use 8.1.x-dev instead of ~8.1 to get the -dev release instead.
At times this fails during
The long term solution is finally fixing the scaling pains of composer architecture.
The workaround solution is to provide more memory during this composer command execution.
Idea :
Concrete Examples
a.)
b.)
The -vvv is the verbose flag to see what is the specific reason for failure.
The php -d memory_limit=-1 gives composer command execution unlimited resources.
Another workaround is to add directory to /DRUPAL_ROOT/vendor library the necessary libraries and then manually edit composer.lock to declare library availability.
Comment #4
chriscalip CreditAttribution: chriscalip commentedComment #5
chriscalip CreditAttribution: chriscalip commentedComment #6
bojanz CreditAttribution: bojanz at Centarro commentedNo, that doesn't work. You'd also need to edit the vendor/composer/installed.json file, and regenerate the autoloader, at minimum.
composer.lock is not actually used at runtime (outside of composer install).
Keep in mind that most memory limits around local Composer are due to the VM itself, you can set an unlimited memory limit, but that doesn't mean the VM has access to any significant memory. Same how you can set 512M as the Drupal memory limit but have the script only get 60M cause that's how much the system has left.
I agree that we need a good troubleshooting page, but it needs to live on drupal.org (on a dedicated page under the existing Composer docs), that way people can expand it without patching README all the time.
Comment #7
chriscalip CreditAttribution: chriscalip commentedIndeed, I've updated the community documentation page on composer.
Using Composer in a Drupal project
https://www.drupal.org/node/2404989
Right, on the memory issue also seen on how to-do page swaps for memory??.. its on the github issue queue.
Also thanks for the info on how to manually add a vendor library. It's useful to know of an override.i
Comment #8
chriscalip CreditAttribution: chriscalip commented