Skip to content

Composer silently fails to install if a build_as_root command fails #211

@defunctl

Description

@defunctl

If any build_as_root command fails, composer silently does not get installed in the container.

Example:

name: testsite
recipe: wordpress

config:
  php: '8.2'
  via: apache
  database: mysql
  webroot: .
  composer_version: 2
  xdebug: false

services:
  appserver:
    xdebug: false
    build_as_root:
      - exit 1
$ lando rebuild -y --debug

The only hint something went wrong are these debug lines, which doesn't really tell us what happened/which command failed.

  local process pid11 running /home/xxxx/.lando/bin/docker-compose-v2.31.0 exec appserver /helpers/exec-multiliner.sh ZXhpdCAx cstdio=inherit, silent=false, mode=spawn, detached=false +2ms
  local process pid11 finished with exit code 1  +35ms
  local ERROR   +1ms

Even if something goes wrong, that should not prevent composer from being installed:

$ lando composer --version
OCI runtime exec failed: exec failed: unable to start container process: exec: "composer": executable file not found in $PATH

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions