Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Always install additional extension libs when given #575

Closed
ruudk opened this issue Mar 9, 2022 · 8 comments
Closed

Always install additional extension libs when given #575

ruudk opened this issue Mar 9, 2022 · 8 comments
Assignees
Labels
enhancement

Comments

@ruudk
Copy link

@ruudk ruudk commented Mar 9, 2022

I see that setup-php can automatically install additional libs.

But it appears that this is only picked up when building from source.

Right now, I'm trying to install https://pecl.php.net/package-info.php?package=memcached&version=3.2.0RC2 from PECL and that fails because it needs libmemcached-dev.

I provided this:

            -   name: Setup PHP
                uses: shivammathur/setup-php@verbose
                with:
                    php-version: '8.1'
                    coverage: none
                    extensions: memcached-3.2.0RC2
                env:
                    fail-fast: true
                    MEMCACHED_LIBS: zlib1g-dev libmemcached-dev

It would be great if the same trick works for PECL packages as well.

I solved it by running sudo apt-get install -y libmemcached-dev before this step.

@ruudk ruudk added the enhancement label Mar 9, 2022
@shivammathur
Copy link
Owner

@shivammathur shivammathur commented Mar 9, 2022

Added support in e9884d0
Will be in the next release.

Test workflow: https://github.com/shivammathur/test-setup-php/actions/runs/1960085437/workflow

@shivammathur shivammathur added the awaiting-release label Mar 9, 2022
@ruudk
Copy link
Author

@ruudk ruudk commented Mar 21, 2022

@shivammathur Thank you so much! Any ETA for that release?

@shivammathur
Copy link
Owner

@shivammathur shivammathur commented Mar 21, 2022

@ruudk I was very busy last week. Will try to do it tomorrow.

@shivammathur
Copy link
Owner

@shivammathur shivammathur commented Mar 22, 2022

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

@ruudk
Copy link
Author

@ruudk ruudk commented Mar 22, 2022

I just tested it and it works great:

            -   name: Setup PHP
                uses: shivammathur/setup-php@verbose
                with:
                    php-version: '8.1'
                    coverage: none
                    extensions: memcached-3.2.0RC2
                env:
                    fail-fast: true
                    MEMCACHED_LIBS: zlib1g-dev libmemcached-dev
# ✓ memcached-3.2.0RC2 Installed and enabled with libraries libmemcached-dev zlib1g-dev

but when I do the same for rdkafka it does not:

            -   name: Setup PHP
                uses: shivammathur/setup-php@verbose
                with:
                    php-version: '8.1'
                    coverage: none
                    extensions: rdkafka
                env:
                    fail-fast: true
                    RDKAFKA_LIBS: librdkafka-dev

# ✗ rdkafka Could not install rdkafka on PHP 8.1.3

Could it be that the *_LIBS are skipped when no version is specified?

@ruudk
Copy link
Author

@ruudk ruudk commented Mar 22, 2022

For rdkafka (even the pecl version), you always need to install librdkafka-dev so using it without is impossible.

@shivammathur
Copy link
Owner

@shivammathur shivammathur commented Mar 22, 2022

@ruudk

Patched, it should work now.
For now, the logs in v2 will just say "installed and enabled", in the next release I will try to improve the logs to mention the libraries as well.

@ruudk
Copy link
Author

@ruudk ruudk commented Mar 23, 2022

@shivammathur It works 👏 Thanks 💙

@shivammathur shivammathur removed the awaiting-release label Jun 17, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement
Projects
None yet
Development

No branches or pull requests

2 participants