shivammathur / setup-php

GitHub action to set up PHP with extensions, php.ini configuration, coverage drivers, and various tools.

Home Page:https://setup-php.com

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

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

nebkam opened this issue · comments

Describe the bug

Version

  • I have checked releases, and the bug exists in the latest patch version of v1 or v2.
  • v2
  • v1

Runners

  • GitHub Hosted
  • Self Hosted

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?

@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

Confirmed that it works on my setup as well.

Thank you for a prompt response!