blackfireio / lando-plugin

Lando plugin to use Blackfire
4 stars 3 forks source link

Issue installing on PHP7.4 with the Platform recipe #2

Closed thomasdiluccio closed 2 years ago

thomasdiluccio commented 3 years ago

This project is based on a Platform's environment initialized from the Laravel template.

Running lando rebuild on this configuration will fail with the error:

Installing Blackfire Probe for PHP 2021-09-29 12:43:43 URL:https://packages.blackfire.io/binaries/blackfire-php/1.67.0/blackfire-php-linux_amd64-php-74-zts.tar.gz [143136/143136] -> "74-zts" [1] Activating the Blackfire Probe for PHP. /helpers/install-blackfire-probe.sh: line 19: /etc/php/7.4-zts/cli/conf.d/blackfire.ini: No such file or directory ERROR ==> /helpers/install-blackfire-probe.sh: line 19: /etc/php/7.4-zts/cli/conf.d/blackfire.ini: No such file or directory

Using PHP8 and adding blackfire to the runtime extensions in the .platform.app.yml file seems to fix the problem.

.lando.yml

name: lando-unit-tests
recipe: platformsh
config:
  id: ****
services:
  blackfire:
    type: blackfire
    app_service: app
    server_id: ***
    server_token: ***
    client_id: ***
    client_token: ***

.platform.app.yml

# This file describes an application. You can have multiple applications
# in the same project.

# The name of this app. Must be unique within a project.
name: app

# The type of the application to build.
type: php:7:4

dependencies:
    php:
        composer/composer: '^2'

runtime:
    extensions:
        - redis

build:
    flavor: composer

# The hooks that will be performed when the package is deployed.
hooks:
    build: |
        set -e
    deploy: |
        set -e
        php artisan migrate --force

# The relationships of the application with services or other applications.
# The left-hand side is the name of the relationship as it will be exposed
# to the application in the PLATFORM_RELATIONSHIPS variable. The right-hand
# side is in the form `<service name>:<endpoint name>`.
relationships:
    database: "db:mysql"
    rediscache: "cache:redis"
    redissession: "cache:redis"

# The size of the persistent disk of the application (in MB).
disk: 2048

# The mounts that will be performed when the package is deployed.
mounts:
  "storage/app/public":
      source: local
      source_path: "public"
  "storage/framework/views":
      source: local
      source_path: "views"
  "storage/framework/sessions":
      source: local
      source_path: "sessions"
  "storage/framework/cache":
      source: local
      source_path: "cache"
  "storage/logs":
      source: local
      source_path: "logs"
  "bootstrap/cache":
      source: local
      source_path: "cache"
  "/.config":
      source: local
      source_path: "config"

# The configuration of app when it is exposed to the web.
web:
    locations:
        "/":
            root: "public"
            index:
                - index.php
            allow: true
            passthru: "/index.php"
        "/storage":
            root: "storage/app/public"
            scripts: false

crons:
    # Run Laravel's scheduler every 5 minutes, which is often as crons can run.
    scheduler:
        spec: '*/5 * * * *'
        cmd: 'php artisan schedule:run'
    # Run Laravel's queue worker task every 9 minutes
    queue:
        spec: '*/9 * * * *'
        # Allow the worker to run for up to 5 minutes. That prevents
        # a long-running queue from blocking a deploy for more than 5
        # minutes.
        cmd: 'php artisan queue:work --max-time=300'

# If you have an especially large queue, you may be better off using a worker.
# If so, comment out the `queue` cron entry and uncomment this instead. Note that
# Doing so requires a Medium plan or larger.
#workers:
#    queue:
#        size: S
#        commands:
#            # To minimize leakage, the queue worker will stop every hour
#            # and get restarted automatically.
#            start: |
#                php artisan queue:work --max-time=3600
chadwcarlson commented 3 years ago

Drupal 8 on PHP 7.4

Creating platformshdrupal8_app_1 ... done
Installing Blackfire Probe for PHP
2021-09-29 20:06:29 URL:https://packages.blackfire.io/binaries/blackfire-php/1.67.0/blackfire-php-linux_amd64-php-74.tar.gz [132344/132344] -> "74" [1]
PHP Warning:  PHP Startup: Unable to load dynamic library 'blackfire.so' (tried: /usr/lib/php/20190902-zts/blackfire.so (/usr/lib/php/20190902-zts/blackfire.so: undefined symbol: compiler_globals), /usr/lib/php/20190902-zts/blackfire.so.so (/usr/lib/php/20190902-zts/blackfire.so.so: cannot open shared object file: No such file or directory)) in Unknown on line 0
Activating the Blackfire Probe for PHP.
PHP Warning:  PHP Startup: Unable to load dynamic library 'blackfire.so' (tried: /usr/lib/php/20190902-zts/blackfire.so (/usr/lib/php/20190902-zts/blackfire.so: undefined symbol: compiler_globals), /usr/lib/php/20190902-zts/blackfire.so.so (/usr/lib/php/20190902-zts/blackfire.so.so: cannot open shared object file: No such file or directory)) in Unknown on line 0
/helpers/install-blackfire-probe.sh: line 16: /etc/php/7.4-zts/cli/conf.d/blackfire.ini: No such file or directory
ERROR ==> /helpers/install-blackfire-probe.sh: line 16: /etc/php/7.4-zts/cli/conf.d/blackfire.ini: No such file or directory 

Blackfire extension already included:

type: 'php:7.4'

runtime:
    # Enable the redis extension so Drupal can communicate with the Redis cache.
    extensions:
        - redis
        - blackfire
        - opcache
lolautruche commented 3 years ago

The first warning is expected, as the platformsh recipe doesn't install the blackfire extension but it expects it to be present. This is probably an issue to be posted on Lando. Regarding the 2nd one, it looks like a bug in the plugin. I will have a look 👀