lando / platformsh

The Official Platform.sh Lando Plugin
https://docs.lando.dev/platformsh
GNU General Public License v3.0
6 stars 4 forks source link

Cannot build PHP 7.4 service on Apple Silicon #136

Closed jasonevines closed 2 years ago

jasonevines commented 2 years ago

Whereas the PHP 8 service appears to build fine, the PHP 7.4 service is generating a segmentation fault error on my Macbook Pro M1 Max.

Here's the output when starting with the -vvv flag:

Building application app (runtime type: php:7.4) Installing php dependencies with 'composer': composer/composer Loading composer repositories with package information Warning from https://repo.packagist.org: Support for Composer 1 is deprecated and some packages will not be available. You should upgrade to Composer 2. See https://blog.packagist.com/deprecating-composer-1-support/ Updating dependencies (including require-dev)

mmap() failed: [12] Cannot allocate memory Segmentation fault

[RuntimeException]
The command failed with the exit code 139: composer install --no-progress --prefer-dist --optimize-autoloader --no-interaction

app-name 21:09:31 DEBUG ==> process pid14 finished with exit code 1 app-name 21:09:31 ERROR ==> message=, stack=Error at /snapshot/cli/lib/shell.js From previous event: at Shell.sh (/snapshot/cli/lib/shell.js) at Object.dc (/snapshot/cli/lib/bootstrap.js) at compose (/snapshot/cli/lib/bootstrap.js) From previous event: at /snapshot/cli/lib/router.js at processImmediate (internal/timers.js:464:21) From previous event: at Object.run (/snapshot/cli/lib/router.js) at run (/snapshot/cli/lib/engine.js) at /snapshot/cli/lib/router.js From previous event: at Object.eventWrapper (/snapshot/cli/lib/router.js) at Engine.engineCmd (/snapshot/cli/lib/engine.js) at Engine.run (/snapshot/cli/lib/engine.js) at Object.runBuild (/snapshot/cli/plugins/lando-services/lib/utils.js) at AsyncEvents. (/snapshot/cli/plugins/lando-services/app.js) at AsyncEvents.handle (/snapshot/cli/lib/events.js) at /snapshot/cli/lib/events.js From previous event: at AsyncEvents.emit (/snapshot/cli/lib/events.js) at /snapshot/cli/lib/app.js From previous event: at App.start (/snapshot/cli/lib/app.js) at Object.run (/snapshot/cli/plugins/lando-core/tasks/start.js) at /snapshot/cli/lib/cli.js at processImmediate (internal/timers.js:464:21) From previous event: at /snapshot/cli/lib/cli.js From previous event: at Object.handler (/snapshot/cli/lib/cli.js) at Object.runCommand (/snapshot/cli/node_modules/yargs/lib/command.js:238:44) at Object.parseArgs [as _parseArgs] (/snapshot/cli/node_modules/yargs/yargs.js:1063:30) at Function.get [as argv] (/snapshot/cli/node_modules/yargs/yargs.js:1004:21) at Cli.init (/snapshot/cli/lib/cli.js) at Cli.run (/snapshot/cli/lib/cli.js) From previous event: at /snapshot/cli/bin/lando.js From previous event: at Object. (/snapshot/cli/bin/lando.js) at Module._compile (pkg/prelude/bootstrap.js:1751:22) at Object.Module._extensions..js (internal/modules/cjs/loader.js:1114:10) at Module.load (internal/modules/cjs/loader.js:950:32) at Function.Module._load (internal/modules/cjs/loader.js:790:14) at Function.runMain (pkg/prelude/bootstrap.js:1804:12) at internal/main/run_main_module.js:17:47, stackCleaned=true app-name 21:09:31 DEBUG ==> message=, stack=Error at /snapshot/cli/lib/shell.js From previous event: at Shell.sh (/snapshot/cli/lib/shell.js) at Object.dc (/snapshot/cli/lib/bootstrap.js) at compose (/snapshot/cli/lib/bootstrap.js) From previous event: at /snapshot/cli/lib/router.js at processImmediate (internal/timers.js:464:21) From previous event: at Object.run (/snapshot/cli/lib/router.js) at run (/snapshot/cli/lib/engine.js) at /snapshot/cli/lib/router.js From previous event: at Object.eventWrapper (/snapshot/cli/lib/router.js) at Engine.engineCmd (/snapshot/cli/lib/engine.js) at Engine.run (/snapshot/cli/lib/engine.js) at Object.runBuild (/snapshot/cli/plugins/lando-services/lib/utils.js) at AsyncEvents. (/snapshot/cli/plugins/lando-services/app.js) at AsyncEvents.handle (/snapshot/cli/lib/events.js) at /snapshot/cli/lib/events.js From previous event: at AsyncEvents.emit (/snapshot/cli/lib/events.js) at /snapshot/cli/lib/app.js From previous event: at App.start (/snapshot/cli/lib/app.js) at Object.run (/snapshot/cli/plugins/lando-core/tasks/start.js) at /snapshot/cli/lib/cli.js at processImmediate (internal/timers.js:464:21) From previous event: at /snapshot/cli/lib/cli.js From previous event: at Object.handler (/snapshot/cli/lib/cli.js) at Object.runCommand (/snapshot/cli/node_modules/yargs/lib/command.js:238:44) at Object.parseArgs [as _parseArgs] (/snapshot/cli/node_modules/yargs/yargs.js:1063:30) at Function.get [as argv] (/snapshot/cli/node_modules/yargs/yargs.js:1004:21) at Cli.init (/snapshot/cli/lib/cli.js) at Cli.run (/snapshot/cli/lib/cli.js) From previous event: at /snapshot/cli/bin/lando.js From previous event: at Object. (/snapshot/cli/bin/lando.js) at Module._compile (pkg/prelude/bootstrap.js:1751:22) at Object.Module._extensions..js (internal/modules/cjs/loader.js:1114:10) at Module.load (internal/modules/cjs/loader.js:950:32) at Function.Module._load (internal/modules/cjs/loader.js:790:14) at Function.runMain (pkg/prelude/bootstrap.js:1804:12) at internal/main/run_main_module.js:17:47, stackCleaned=true app-name 21:09:31 VERBOSE ==> reporting error action to report=true, url=https://metrics.lando.dev, report=true, url=https://metrics.lando.dev, report=true, url=https://metrics.lando.dev

reynoldsalec commented 2 years ago

@jasonevines just want to confirm this is happening using the Platform.sh recipe?

If that is the case, I'm guessing that if we can get Platform to provide arm64 versions of the images that might solve it. You could also try running Lando with a 4.x version of Docker Desktop and see if that fixes it (I know that's not recommended by Lando CLI, but I've heard it works and saw some instances where Docker 4.x solved mmap errors for other people).

jasonevines commented 2 years ago

Yes, it's happening with the Platform.sh recipe.

I'll try Docker 4.x and report back.

jasonevines commented 2 years ago

The problem no longer occurs after upgrading to Docker 4.x.

reynoldsalec commented 2 years ago

Thanks @jasonevines; I'm going to close this issue out since this appears to be an upstream issue.

Note that we are planning to up Lando's Docker for Mac version "requirements" in the future, possibly even in Lando 3.x, but it is probable that the ultimate solution will be Lando 4.x's installation scheme, which will be more flexible.

For anyone finding this until Lando 4.x, you might be best off upgrading to Docker for Mac 4.x and ignoring the version warnings.