Closed convenient closed 8 years ago
is it a pure install without existing vendor/ ? does this also happen with 2.1.2?
I see CoreInstaller
in the stacktrace, do you make use of it?
Hey.
This problem arose on an internal community module which used your installer to install a copy of Magento on travis to run a series of integration tests against. This magento instance is composer installed into tests/magento/magentomodule
. We didn't test 2.1.2 cause it looked like there was no such thing?
We've fixed the suite for now by locking it to 2.1.1.
https://github.com/Cotya/magento-composer-installer/releases/tag/2.1.2
I've had to trim this out a bit as it's closed source. But you can see the basis of it.
├── app
│ ├── code
│ │ └── community
│ └── etc
│ └── modules
├── .travis.yml
├── composer.json
├── phpunit.xml.dist
└── tests
├── SomeTest.php
└── magento
└── magentomodule
Again, this has been trimmed down because it is closed source. The module itself requires a separate internal installer to be installed into other projects. The require-dev dependency on your installer is so that we can install a copy of magento to the tests/magento/magentomodulefolder.
{
"name": "convenient/modulename",
"type": "closedsource-magento",
"require": {
"closedsource/magento-installer": "1.*",
},
"repositories": [
{
"type": "composer",
"url": "http://packages.firegento.com"
}
],
"require-dev": {
"magento-hackathon/magento-composer-installer": "2.1.3",
"magento/core": "1.9.1.0",
"phpunit/phpunit": "^4.8"
},
"extra": {
"magento-root-dir": "./tests/magento/modulename"
}
}
language: php
php:
- 5.3
env:
- MAGE_INSTALL_PATH="./tests/magento/magentomodule"
before_install:
- XDEBUG_CONF=~/.phpenv/versions/$(phpenv version-name)/etc/conf.d/xdebug.ini
- mv "$XDEBUG_CONF" "$XDEBUG_CONF".bak
install:
# Composer install
- composer self-update
- composer install --no-interaction --prefer-dist
# Install magento 1.9.1.0
- wget https://raw.githubusercontent.com/netz98/n98-magerun/master/n98-magerun.phar
- chmod +x n98-magerun.phar
- ./n98-magerun.phar install --root-dir=. --noDownload --useDefaultConfigParams=yes --dbHost="localhost" --dbUser="root" --dbPass="" --dbName="convenient_magentomodule_tests" --baseUrl="http://example.com/" --installationFolder="${MAGE_INSTALL_PATH}"
# Prepare 1.9.1.0 Sample Data
- wget https://raw.githubusercontent.com/Vinai/compressed-magento-sample-data/1.9.1.0/compressed-no-mp3-magento-sample-data-1.9.1.0.tgz
- tar -zxvf compressed-no-mp3-magento-sample-data-1.9.1.0.tgz
- rsync -av magento-sample-data-1.9.1.0/ ${MAGE_INSTALL_PATH}
- mysql -uroot convenient_magentomodule_tests < ${MAGE_INSTALL_PATH}/magento_sample_data_for_1.9.1.0.sql
# Install module, for Phpunit we only need the app directory
- rsync -av app/ ${MAGE_INSTALL_PATH}/app
- ./n98-magerun.phar --root-dir=${MAGE_INSTALL_PATH} cache:flush
- ./n98-magerun.phar --root-dir=${MAGE_INSTALL_PATH} sys:setup:run
before_script: mv "$XDEBUG_CONF".bak "$XDEBUG_CONF"
script:
- vendor/bin/phpunit
cache:
directories: $HOME/.composer/cache
my fault, there is no version 2.1.2
, but good to hear going back to 2.1.1
helped.
And Thank you for all the detailed information. Maybe @AydinHassan or someone else is able to solve this somewhere in the future.
2.1.1 is not working because of composer-plugin-api dependence
Got this distilled even further! The following is all that is required to break it with an infinite loop, or a segfault with 11.
{
"repositories": [
{
"type": "composer",
"url": "https://packages.firegento.com"
}
],
"require-dev": {
"magento-hackathon/magento-composer-installer": "2.1.3",
"magento/core": "1.9.1.0"
},
"extra": {
"magento-deploystrategy": "copy",
"magento-root-dir": "./"
}
}
@convenient maybe you should update to a newer version of the installer, 2.1.3
is very old.
Does the 3.x series still do that thing where it tries to chop up the app/Mage.php
? I really didn't like that.
https://github.com/Cotya/magento-composer-installer/issues/3
@AydinHassan
@convenient yes but you can disable it with "with-bootstrap-patch": false
in composer.json
extra.
Thanks @AydinHassan that makes me a lot more comfortable with V3.
Reading the manual I see you've forked off to do some work specifically for installing core magento here: https://github.com/AydinHassan/magento-core-composer-installer
Using that, seems to work 👍
@convenient np, thats a separate project from scratch and yeah it works, we use it on many production sites and has over 30,000 installs 😄
Didn't even realise it wasn't a fork ;) Just needed something that would install core magento so I could spin up travis containers for testing in haha.
The loop is definitely infinite, I boosted the max nesting level to 2000 and then we started getting out of memory errors like:
PHP Fatal error: Allowed memory size of 1073741824 bytes exhausted (tried to allocate 523800 bytes)