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.85k stars 334 forks source link

Unable to use ev library #844

Closed Kovah closed 1 month ago

Kovah commented 2 months ago

Describe the bug i was trying to use the ev library in a pipeline, but I am unable to install it with the Setup PHP action.

Version

Runners

Operating systems ubuntu-latest

PHP versions 8.3.7

To Reproduce

  - name: Setup PHP
    uses: shivammathur/setup-php@v2
    with:
      php-version: 8.3
      extensions: mbstring, bcmath, redis, swoole, ev, sockets
      coverage: xdebug

Expected behavior EV to be installed.

Screenshots/Logs

==> Setup PHP
✓ PHP Installed PHP 8.3.7

==> Setup Extensions
✓ mbstring Enabled
✓ bcmath Enabled
✓ redis Enabled
✓ swoole Enabled
PHP Warning:  PHP Startup: Unable to load dynamic library '/usr/lib/php/20230831/ev.so' (tried: /usr/lib/php/20230831/ev.so (/usr/lib/php/20230831/ev.so: undefined symbol: socket_ce), /usr/lib/php/20230831//usr/lib/php/20230831/ev.so.so (/usr/lib/php/20230831//usr/lib/php/20230831/ev.so.so: cannot open shared object file: No such file or directory)) in Unknown on line 0
✗ ev Could not install ev on PHP 8.3.7
✓ sockets Enabled

Additional context I guess that it needs the same fix as the event extension as described as a fix in #722

Are you willing to submit a PR?

shivammathur commented 2 months ago

@Kovah Please specify EVENT_LIBS env as libev-dev, then it will install it before installing event extension.

- name: Setup PHP
  uses: shivammathur/setup-php@v2
  with:
    php-version: 8.3
    extensions: mbstring, bcmath, redis, swoole, event, sockets
    coverage: xdebug
  env:
    EVENT_LIBS: libev-dev

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

Kovah commented 2 months ago

Sorry my bad, it's not about the event library, but ev. I corrected the yaml in the original post. Does this fix also apply to ev?

shivammathur commented 2 months ago

@Kovah ok. I have fixed that in https://github.com/shivammathur/setup-php/commit/2a620039e802219ba742439eeb6bd1eadae562fa.

It will be in the next release.

Kovah commented 2 months ago

Awesome! Many thanks!

shivammathur commented 1 month ago

Released https://github.com/shivammathur/setup-php/releases/tag/2.30.5 with the fix