shivammathur / setup-php

GitHub action to set up PHP with extensions, php.ini configuration, coverage drivers, and various tools.
https://setup-php.com
MIT License
2.89k stars 337 forks source link

Install doesn't respect the `amqp` extension version constraint #791

Closed nebkam closed 9 months ago

nebkam commented 9 months ago

Describe the bug

Version

Runners

Operating systems

ubuntu-latest

PHP versions

7.4

To Reproduce

Added a specific version of amqp extension:

extensions: apcu, gd, imagick, intl, mongodb-1.14.0, mysqli, pdo, pdo_mysql, zip, amqp-1.11.0

It installs the wrong version (amqp-2.1.1)

Expected behavior

To install the specific version of the PHP extension (amqp-1.11.0) or fail.

Screenshots/Logs

Screenshot from 2023-11-28 08-25-09

Additional context

Are you willing to submit a PR?

shivammathur commented 9 months ago

@nebkam Installing amqp from pecl requires librabbitmq. You can specify the package for that in the AMQP_LIBS env and it will install correctly.

- name: Setup PHP with extensions
  uses: shivammathur/setup-php@verbose
  with:
    php-version: 8.1
    extensions: amqp-1.11.0
  env:
    AMQP_LIBS: librabbitmq-dev

Ref: https://github.com/shivammathur/setup-php/wiki/Add-extension-from-PECL-with-libraries-and-custom-configuration

nebkam commented 9 months ago

Confirmed that it works on my setup as well.

Thank you for a prompt response!