APY / APYDataGridBundle

Symfony Datagrid Bundle
MIT License
492 stars 344 forks source link

Travis builds are failing due to composer memory limit #1050

Closed npotier closed 4 years ago

npotier commented 4 years ago

Hello,

Travis CI fails because there is a memory limit during composer install or update commands.

As this article suggests : https://lorenzo.mile.si/travis-ci-and-composer-out-of-memory/739/

it could be simply fixed by adding the following code to .travis.yml :

before_install:
  - echo "memory_limit=2G" >> ~/.phpenv/versions/$(phpenv version-name)/etc/conf.d/travis.ini

I'm not an expert on Travis and I don't know how this kind on change can be tested.

What do you think about it ?

DonCallisto commented 4 years ago

You sure the builds are memory-related? Could you please provide some evidence of this?

npotier commented 4 years ago

Hello @DonCallisto

If you have a look at this link:

The message is explicit:

PHP Fatal error:  Allowed memory size of 1610612736 bytes exhausted (tried to allocate 32 bytes) in phar:///home/travis/.phpenv/versions/5.6.40/bin/composer/src/Composer/DependencyResolver/Pool.php on line 339
Fatal error: Allowed memory size of 1610612736 bytes exhausted (tried to allocate 32 bytes) in phar:///home/travis/.phpenv/versions/5.6.40/bin/composer/src/Composer/DependencyResolver/Pool.php on line 339
Check https://getcomposer.org/doc/articles/troubleshooting.md#memory-limit-errors for more info on how to handle out of memory errors.
DonCallisto commented 4 years ago

Could you try to rerun the build? When those kind of errors arise, I always retry again in order to see if the issue is real and not only "temporary"

npotier commented 4 years ago

I've tried, and the build fails again for the same reason. I understand that this fail is random but I think it can be boring to have to relaunch travis everytime it occurs.

Maybe the fix I propose will reduce the number of fail ?

DonCallisto commented 4 years ago

If the problem is only related to composer, we can run composer as follows

travis_retry php -d memory_limit=-1 composer update ${COMPOSER_FLAGS} --no-interaction

or something like this (didn't checked if syntax is good; you should try)

npotier commented 4 years ago

@DonCallisto you are right. I'me made a PR on this

romainguerrero commented 4 years ago

Fixed with the #1052