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.9k stars 337 forks source link

Specifying `SWOOLE_CONFIGURE_OPTS` does not take effect #740

Closed huangdijia closed 1 year ago

huangdijia commented 1 year ago

Describe the bug

Version

Runners

Operating systems Ubuntu

PHP versions PHP 8.1

To Reproduce

      - name: Setup PHP
        uses: shivammathur/setup-php@v2
        with:
          php-version:8.1
          extensions: redis, pdo, pdo_mysql, bcmath, swoole-5.0.3
          tools: phpize
          coverage: none
          ini-values: swoole.use_shortname=Off
        env:
          SWOOLE_CONFIGURE_OPTS: --enable-openssl --enable-swoole-curl --enable-cares --enable-swoole-pgsql --enable-brotli

Screenshots/Logs


Run shivammathur/setup-php@v2
  with:
    php-version: 8.1
    extensions: redis, pdo, pdo_mysql, bcmath, swoole-5.0.3
    tools: phpize
    coverage: none
    ini-values: swoole.use_shortname=Off
    ini-file: production
  env:
    PHP_CS_FIXER_IGNORE_ENV: 1
    SWOOLE_CONFIGURE_OPTS: --enable-openssl --enable-swoole-curl --enable-cares --enable-swoole-pgsql --enable-brotli
/usr/bin/bash /home/runner/work/_actions/shivammathur/setup-php/v[2](https://github.com/friendsofhyperf/components/actions/runs/5208302373/jobs/9396736711#step:3:2)/src/scripts/run.sh

==> Setup PHP
✓ PHP Updated to PHP 8.1.18

==> Setup Extensions
✓ redis Enabled
✓ pdo Enabled
✓ pdo_mysql Enabled
✓ bcmath Enabled
✓ swoole-[5](https://github.com/friendsofhyperf/components/actions/runs/5208302373/jobs/9396736711#step:3:5).0.1 Installed and enabled

==> Setup Tools
✓ composer Added composer 2.5.[7](https://github.com/friendsofhyperf/components/actions/runs/5208302373/jobs/9396736711#step:3:7)
✓ php-config Added php-config [8](https://github.com/friendsofhyperf/components/actions/runs/5208302373/jobs/9396736711#step:3:8).1.18
shivammathur commented 1 year ago

Please specify the libraries, without them, it fails to compile and fallbacks to use the extension from the ubuntu package.

- name: Setup PHP
  uses: shivammathur/setup-php@verbose
  with:
    php-version: 8.1
    extensions: redis, pdo, pdo_mysql, bcmath, swoole-5.0.3
    tools: phpize
    coverage: none
    ini-values: swoole.use_shortname=Off
  env:
    SWOOLE_LIBS: libc-ares-dev libcurl4-openssl-dev libpq-dev libbrotli-dev
    SWOOLE_CONFIGURE_OPTS: --enable-openssl --enable-swoole-curl --enable-cares --enable-swoole-pgsql --enable-brotli
huangdijia commented 1 year ago

Thanks!

huangdijia commented 1 year ago

https://github.com/friendsofhyperf/components/actions/runs/5208821156/jobs/9397868165

downloading swoole-5.0.3.tgz ...
Starting to download swoole-5.0.3.tgz (2,066,852 bytes)
......................................................................................................................................................................................................................................................................................................................................................................................................................done: 2,066,852 bytes
471 source files, building
running: phpize
Configuring for:
PHP Api Version:         20210902
Zend Module Api No:      20210902
Zend Extension Api No:   420210902
configure.ac:22: warning: $as_echo is obsolete; use AS_ECHO(["message"]) instead
build/php.m4:2111: PHP_CONFIG_NICE is expanded from...
configure.ac:22: the top level
config.m4:334: warning: The macro `AC_PROG_CC_C99' is obsolete.
config.m4:334: You should run autoupdate.
./lib/autoconf/c.m4:1659: AC_PROG_CC_C99 is expanded from...
config.m4:334: the top level
configure.ac:165: warning: The macro `AC_PROG_LIBTOOL' is obsolete.
configure.ac:165: You should run autoupdate.
build/libtool.m4:99: AC_PROG_LIBTOOL is expanded from...
configure.ac:165: the top level
enable sockets supports? [no] : enable mysqlnd support? [no] : building in /tmp/pear/temp/pear-build-rootvB62Qw/swoole-5.0.3
running: /tmp/pear/temp/swoole/configure --with-php-config=/usr/bin/php-config --enable-sockets=no --enable-openssl=yes --enable-mysqlnd=no --enable-swoole-curl=yes --enable-cares=yes --enable-brotli=yes
checking for grep that handles long lines and -e... /usr/bin/grep
checking for egrep... /usr/bin/grep -E
checking for a sed that does not truncate output... /usr/bin/sed
checking for pkg-config... /usr/bin/pkg-config
checking pkg-config is at least version 0.9.0... yes
checking for cc... cc
checking whether the C compiler works... yes
checking for C compiler default output file name... a.out
checking for suffix of executables...
checking whether we are cross compiling... no
env:
    SWOOLE_LIBS: libc-ares-dev libcurl4-openssl-dev libpq-dev libbrotli-dev
    SWOOLE_CONFIGURE_OPTS: --enable-openssl --enable-swoole-curl --enable-cares --enable-swoole-pgsql --enable-brotli

--enable-swoole-pgsql is lost。

shivammathur commented 1 year ago

@huangdijia

swoole does not have support for that parameter in its package.xml, so PECL does not add it. Please ask upstream to add support for it. https://github.com/swoole/swoole-src/blob/master/package.xml#L2411

huangdijia commented 1 year ago

https://github.com/swoole/swoole-src/pull/5081 Fixed