diff options
author | Remi Collet <remi@remirepo.net> | 2024-11-21 16:08:47 +0100 |
---|---|---|
committer | Remi Collet <remi@php.net> | 2024-11-21 16:08:47 +0100 |
commit | ee2deb69623ebf1489db3ef6ab493f682aefe2df (patch) | |
tree | cc75b6c6a4c811e5f10fec1dcdd9f58ebd0b2b91 | |
parent | 87a0f33effbe7d8e29dfcced9059d556ba65e242 (diff) |
use 6.0.0-4 to workaround https://github.com/swoole/swoole-src/issues/5531
drop patch merged upstream
fix https://github.com/swoole/swoole-src/issues/5577 build with liburing < 2.6
using patch from https://github.com/swoole/swoole-src/pull/5579
-rw-r--r-- | 5537.patch | 90 | ||||
-rw-r--r-- | 5579.patch | 39 | ||||
-rw-r--r-- | PHPINFO | 4 | ||||
-rw-r--r-- | REFLECTION | 248 | ||||
-rw-r--r-- | php-pecl-swoole6.spec | 22 |
5 files changed, 287 insertions, 116 deletions
diff --git a/5537.patch b/5537.patch deleted file mode 100644 index c787d4d..0000000 --- a/5537.patch +++ /dev/null @@ -1,90 +0,0 @@ -From f2a69dbb6817e29d85aa9a8e8e4aa4a4498aedf8 Mon Sep 17 00:00:00 2001 -From: Remi Collet <remi@remirepo.net> -Date: Tue, 22 Oct 2024 09:35:27 +0200 -Subject: [PATCH 1/3] Fix #5536 remove unneeded include of php_pdo_int.h - ---- - thirdparty/php84/pdo_pgsql/pgsql_sql_parser.c | 1 - - thirdparty/php84/pdo_sqlite/sqlite_sql_parser.c | 1 - - 2 files changed, 2 deletions(-) - -diff --git a/thirdparty/php84/pdo_pgsql/pgsql_sql_parser.c b/thirdparty/php84/pdo_pgsql/pgsql_sql_parser.c -index c030abc318b..d74ff5a7a8f 100644 ---- a/thirdparty/php84/pdo_pgsql/pgsql_sql_parser.c -+++ b/thirdparty/php84/pdo_pgsql/pgsql_sql_parser.c -@@ -21,7 +21,6 @@ - - #include "php.h" - #include "ext/pdo/php_pdo_driver.h" --#include "ext/pdo/php_pdo_int.h" - #include "ext/pdo/pdo_sql_parser.h" - - int pdo_pgsql_scanner(pdo_scanner_t *s) -diff --git a/thirdparty/php84/pdo_sqlite/sqlite_sql_parser.c b/thirdparty/php84/pdo_sqlite/sqlite_sql_parser.c -index 05e702fbd53..442ccb1aff6 100644 ---- a/thirdparty/php84/pdo_sqlite/sqlite_sql_parser.c -+++ b/thirdparty/php84/pdo_sqlite/sqlite_sql_parser.c -@@ -21,7 +21,6 @@ - - #include "php.h" - #include "ext/pdo/php_pdo_driver.h" --#include "ext/pdo/php_pdo_int.h" - #include "ext/pdo/pdo_sql_parser.h" - - int pdo_sqlite_scanner(pdo_scanner_t *s) - -From beed9c31075a27d016a0d262e6d89f002d7dade3 Mon Sep 17 00:00:00 2001 -From: Remi Collet <remi@remirepo.net> -Date: Tue, 22 Oct 2024 10:45:16 +0200 -Subject: [PATCH 3/3] call exit using original function handler - ---- - ext-src/swoole_coroutine.cc | 4 ++-- - ext-src/swoole_runtime.cc | 12 ++++++++++++ - 2 files changed, 14 insertions(+), 2 deletions(-) - -diff --git a/ext-src/swoole_coroutine.cc b/ext-src/swoole_coroutine.cc -index eb7c13abb4e..fc3f456a176 100644 ---- a/ext-src/swoole_coroutine.cc -+++ b/ext-src/swoole_coroutine.cc -@@ -225,7 +225,7 @@ static int coro_exit_handler(zend_execute_data *execute_data) { - } - #else - SW_EXTERN_C_BEGIN --extern ZEND_FUNCTION(exit); -+bool swoole_call_original_handler(const char *name, INTERNAL_FUNCTION_PARAMETERS); - PHP_FUNCTION(swoole_exit) { - zend_long flags = 0; - if (Coroutine::get_current()) { -@@ -251,7 +251,7 @@ PHP_FUNCTION(swoole_exit) { - zend_update_property_long(swoole_exit_exception_ce, SW_Z8_OBJ_P(&ex), ZEND_STRL("flags"), flags); - zend_update_property_long(swoole_exit_exception_ce, SW_Z8_OBJ_P(&ex), ZEND_STRL("status"), status); - } else { -- ZEND_FN(exit)(INTERNAL_FUNCTION_PARAM_PASSTHRU); -+ swoole_call_original_handler("exit", INTERNAL_FUNCTION_PARAM_PASSTHRU); - } - } - SW_EXTERN_C_END -diff --git a/ext-src/swoole_runtime.cc b/ext-src/swoole_runtime.cc -index 13827f9788e..6fbfafdc31f 100644 ---- a/ext-src/swoole_runtime.cc -+++ b/ext-src/swoole_runtime.cc -@@ -1170,6 +1170,18 @@ static bool enable_func(const char *name, size_t l_name) { - return true; - } - -+SW_EXTERN_C_BEGIN -+bool swoole_call_original_handler(const char *name, INTERNAL_FUNCTION_PARAMETERS) { -+ real_func *rf = (real_func *) zend_hash_str_find_ptr(tmp_function_table, name, strlen(name)); -+ if (!rf) { -+ return false; -+ } -+ rf->ori_handler(INTERNAL_FUNCTION_PARAM_PASSTHRU); -+ -+ return true; -+} -+SW_EXTERN_C_END -+ - void PHPCoroutine::disable_unsafe_function() { - for (auto &f : unsafe_functions) { - disable_func(f.c_str(), f.length()); diff --git a/5579.patch b/5579.patch new file mode 100644 index 0000000..83c0a38 --- /dev/null +++ b/5579.patch @@ -0,0 +1,39 @@ +From fab5c53f92612e973072db691176672de237bae0 Mon Sep 17 00:00:00 2001 +From: Remi Collet <remi@remirepo.net> +Date: Thu, 21 Nov 2024 15:21:27 +0100 +Subject: [PATCH] Fix #5577 error in HAVE_IOURING_FUTEX detection + +--- + config.m4 | 12 +++++++++--- + 1 file changed, 9 insertions(+), 3 deletions(-) + +diff --git a/config.m4 b/config.m4 +index 3b12e5fce4..05e7b1f4de 100644 +--- a/config.m4 ++++ b/config.m4 +@@ -960,16 +960,22 @@ EOF + + LINUX_VERSION=`uname -r | cut -d '-' -f 1` + LINUX_MAJOR_VERSION=`echo $LINUX_VERSION | cut -d '.' -f 1` +- LINUX_MINIO_VERSION=`echo $LINUX_VERSION | cut -d '.' -f 2` ++ LINUX_MINOR_VERSION=`echo $LINUX_VERSION | cut -d '.' -f 2` + + _PKG_CONFIG(URING_VERSION, [modversion], [liburing]) + IOURING_MAJOR_VERSION=`echo $pkg_cv_URING_VERSION | cut -d '.' -f 1` + IOURING_MINOR_VERSION=`echo $pkg_cv_URING_VERSION | cut -d '.' -f 2` + +- if test $IOURING_MAJOR_VERSION > 2 || (test $IOURING_MAJOR_VERSION = 2 && test $IOURING_MINOR_VERSION >= 6); then +- if test $LINUX_MAJOR_VERSION > 6 || (test $LINUX_MAJOR_VERSION = 6 && test $LINUX_MAJOR_VERSION >= 7); then ++ AC_MSG_CHECKING([checking for io_uring futex feature]) ++ if test $IOURING_MAJOR_VERSION -gt 2 || (test $IOURING_MAJOR_VERSION -eq 2 && test $IOURING_MINOR_VERSION -ge 6); then ++ if test $LINUX_MAJOR_VERSION -gt 6 || (test $LINUX_MAJOR_VERSION -eq 6 && test $LINUX_MINOR_VERSION -ge 7); then ++ AC_MSG_RESULT(yes) + AC_DEFINE(HAVE_IOURING_FUTEX, 1, [have io_uring futex feature]) ++ else ++ AC_MSG_RESULT([no, Linux $LINUX_VERSION is too old]) + fi ++ else ++ AC_MSG_RESULT([no, liburing $IOURING_MAJOR_VERSION.$IOURING_MINOR_VERSION is too old]) + fi + fi + @@ -3,8 +3,8 @@ swoole Swoole => enabled Author => Swoole Team <team@swoole.com> -Version => 6.0.0 -Built => Oct 22 2024 00:00:00 +Version => 6.0.0RC1 +Built => Nov 21 2024 00:00:00 coroutine => enabled with boost asm context trace_log => enabled epoll => enabled @@ -1,4 +1,4 @@ -Extension [ <persistent> extension #125 swoole version 6.0.0 ] { +Extension [ <persistent> extension #126 swoole version 6.0.0RC1 ] { - Dependencies { Dependency [ json (Required) ] @@ -29,8 +29,8 @@ Extension [ <persistent> extension #125 swoole version 6.0.0 ] { } } - - Constants [397] { - Constant [ string SWOOLE_VERSION ] { 6.0.0 } + - Constants [399] { + Constant [ string SWOOLE_VERSION ] { 6.0.0RC1 } Constant [ int SWOOLE_VERSION_ID ] { 60000 } Constant [ int SWOOLE_MAJOR_VERSION ] { 6 } Constant [ int SWOOLE_MINOR_VERSION ] { 0 } @@ -268,6 +268,7 @@ Extension [ <persistent> extension #125 swoole version 6.0.0 ] { Constant [ int SWOOLE_MUTEX ] { 3 } Constant [ int SWOOLE_RWLOCK ] { 1 } Constant [ int SWOOLE_SPINLOCK ] { 5 } + Constant [ int SWOOLE_COROLOCK ] { 6 } Constant [ int SWOOLE_MSGQUEUE_ORIENT ] { 1 } Constant [ int SWOOLE_MSGQUEUE_BALANCE ] { 2 } Constant [ int SWOOLE_TIMER_MIN_MS ] { 1 } @@ -307,6 +308,7 @@ Extension [ <persistent> extension #125 swoole version 6.0.0 ] { Constant [ int SWOOLE_HOOK_PDO_SQLITE ] { 524288 } Constant [ int SWOOLE_HOOK_ALL ] { 2147481599 } Constant [ int SOCKET_ECANCELED ] { 125 } + Constant [ int TCP_INFO ] { 11 } Constant [ int SWOOLE_HTTP_CLIENT_ESTATUS_CONNECT_FAILED ] { -1 } Constant [ int SWOOLE_HTTP_CLIENT_ESTATUS_REQUEST_TIMEOUT ] { -2 } Constant [ int SWOOLE_HTTP_CLIENT_ESTATUS_SERVER_RESET ] { -3 } @@ -499,20 +501,20 @@ Extension [ <persistent> extension #125 swoole version 6.0.0 ] { Function [ <internal:swoole> function swoole_client_select ] { - Parameters [4] { - Parameter #0 [ <required> array &$read_array ] - Parameter #1 [ <required> array &$write_array ] - Parameter #2 [ <required> array &$error_array ] - Parameter #3 [ <optional> float $timeout = 0.5 ] + Parameter #0 [ <required> ?array &$read ] + Parameter #1 [ <required> ?array &$write ] + Parameter #2 [ <required> ?array &$except ] + Parameter #3 [ <optional> ?float $timeout = 0.5 ] } - Return [ int|false ] } Function [ <internal:swoole> function swoole_select ] { - Parameters [4] { - Parameter #0 [ <required> array &$read_array ] - Parameter #1 [ <required> array &$write_array ] - Parameter #2 [ <required> array &$error_array ] - Parameter #3 [ <optional> float $timeout = 0.5 ] + Parameter #0 [ <required> ?array &$read ] + Parameter #1 [ <required> ?array &$write ] + Parameter #2 [ <required> ?array &$except ] + Parameter #3 [ <optional> ?float $timeout = 0.5 ] } - Return [ int|false ] } @@ -677,7 +679,7 @@ Extension [ <persistent> extension #125 swoole version 6.0.0 ] { Parameter #0 [ <required> string $fn ] Parameter #1 [ <optional> mixed $args = null ] } - - Return [ void ] + - Return [ mixed ] } Function [ <internal:swoole> function swoole_get_objects ] { @@ -1041,7 +1043,7 @@ Extension [ <persistent> extension #125 swoole version 6.0.0 ] { } } - - Classes [50] { + - Classes [51] { Class [ <internal:swoole> class Swoole\Exception extends Exception implements Throwable, Stringable ] { - Constants [0] { @@ -2720,7 +2722,7 @@ Extension [ <persistent> extension #125 swoole version 6.0.0 ] { Method [ <internal:swoole> static public method waitSignal ] { - Parameters [2] { - Parameter #0 [ <required> int $signo ] + Parameter #0 [ <required> array|int $signals ] Parameter #1 [ <optional> float $timeout = -1 ] } - Return [ bool ] @@ -3392,7 +3394,7 @@ Extension [ <persistent> extension #125 swoole version 6.0.0 ] { Method [ <internal:swoole> static public method waitSignal ] { - Parameters [2] { - Parameter #0 [ <required> int $signo ] + Parameter #0 [ <required> array|int $signals ] Parameter #1 [ <optional> float $timeout = -1 ] } - Return [ bool ] @@ -4192,7 +4194,8 @@ Extension [ <persistent> extension #125 swoole version 6.0.0 ] { Method [ <internal:swoole> public method enableSSL ] { - - Parameters [0] { + - Parameters [1] { + Parameter #0 [ <optional> ?callable $onSslReady = null ] } - Return [ bool ] } @@ -4341,6 +4344,217 @@ Extension [ <persistent> extension #125 swoole version 6.0.0 ] { } } + Class [ <internal:swoole> class Swoole\Async\Client extends Swoole\Client ] { + + - Constants [7] { + Constant [ public int MSG_OOB ] { 1 } + Constant [ public int MSG_PEEK ] { 2 } + Constant [ public int MSG_DONTWAIT ] { 64 } + Constant [ public int MSG_WAITALL ] { 256 } + Constant [ public int SHUT_RDWR ] { 2 } + Constant [ public int SHUT_RD ] { 0 } + Constant [ public int SHUT_WR ] { 1 } + } + + - Static properties [0] { + } + + - Static methods [0] { + } + + - Properties [14] { + Property [ public $errCode = 0 ] + Property [ public $sock = -1 ] + Property [ public $reuse = false ] + Property [ public $reuseCount = 0 ] + Property [ public $type = 0 ] + Property [ public $id = NULL ] + Property [ public $setting = NULL ] + Property [ private $onConnect = NULL ] + Property [ private $onError = NULL ] + Property [ private $onReceive = NULL ] + Property [ private $onClose = NULL ] + Property [ private $onBufferFull = NULL ] + Property [ private $onBufferEmpty = NULL ] + Property [ private $onSSLReady = NULL ] + } + + - Methods [22] { + Method [ <internal:swoole, overwrites Swoole\Client, ctor> public method __construct ] { + + - Parameters [1] { + Parameter #0 [ <required> int $type ] + } + } + + Method [ <internal:swoole, overwrites Swoole\Client, prototype Swoole\Client> public method __destruct ] { + + - Parameters [0] { + } + } + + Method [ <internal:swoole, overwrites Swoole\Client, prototype Swoole\Client> public method connect ] { + + - Parameters [4] { + Parameter #0 [ <required> string $host ] + Parameter #1 [ <optional> int $port = 0 ] + Parameter #2 [ <optional> float $timeout = 0.5 ] + Parameter #3 [ <optional> int $sock_flag = 0 ] + } + - Return [ bool ] + } + + Method [ <internal:swoole> public method sleep ] { + + - Parameters [0] { + } + - Return [ bool ] + } + + Method [ <internal:swoole> public method wakeup ] { + + - Parameters [0] { + } + - Return [ bool ] + } + + Method [ <internal:swoole> public method pause ] { + + - Parameters [0] { + } + - Return [ bool ] + } + + Method [ <internal:swoole> public method resume ] { + + - Parameters [0] { + } + - Return [ bool ] + } + + Method [ <internal:swoole, overwrites Swoole\Client, prototype Swoole\Client> public method enableSSL ] { + + - Parameters [1] { + Parameter #0 [ <optional> ?callable $onSslReady = null ] + } + - Return [ bool ] + } + + Method [ <internal:swoole, overwrites Swoole\Client, prototype Swoole\Client> public method isConnected ] { + + - Parameters [0] { + } + - Return [ bool ] + } + + Method [ <internal:swoole, overwrites Swoole\Client, prototype Swoole\Client> public method close ] { + + - Parameters [1] { + Parameter #0 [ <optional> bool $force = false ] + } + - Return [ bool ] + } + + Method [ <internal:swoole> public method on ] { + + - Parameters [2] { + Parameter #0 [ <required> string $host ] + Parameter #1 [ <required> callable $callback ] + } + - Return [ bool ] + } + + Method [ <internal:swoole, inherits Swoole\Client> public method set ] { + + - Parameters [1] { + Parameter #0 [ <required> array $settings ] + } + - Return [ bool ] + } + + Method [ <internal:swoole, inherits Swoole\Client> public method recv ] { + + - Parameters [2] { + Parameter #0 [ <optional> int $size = 65536 ] + Parameter #1 [ <optional> int $flag = 0 ] + } + - Return [ string|false ] + } + + Method [ <internal:swoole, inherits Swoole\Client> public method send ] { + + - Parameters [2] { + Parameter #0 [ <required> string $data ] + Parameter #1 [ <optional> int $flag = 0 ] + } + - Return [ int|false ] + } + + Method [ <internal:swoole, inherits Swoole\Client> public method sendfile ] { + + - Parameters [3] { + Parameter #0 [ <required> string $filename ] + Parameter #1 [ <optional> int $offset = 0 ] + Parameter #2 [ <optional> int $length = 0 ] + } + - Return [ bool ] + } + + Method [ <internal:swoole, inherits Swoole\Client> public method sendto ] { + + - Parameters [3] { + Parameter #0 [ <required> string $ip ] + Parameter #1 [ <required> int $port ] + Parameter #2 [ <required> string $data ] + } + - Return [ bool ] + } + + Method [ <internal:swoole, inherits Swoole\Client> public method shutdown ] { + + - Parameters [1] { + Parameter #0 [ <required> int $how ] + } + - Return [ bool ] + } + + Method [ <internal:swoole, inherits Swoole\Client> public method getPeerCert ] { + + - Parameters [0] { + } + - Return [ string|bool ] + } + + Method [ <internal:swoole, inherits Swoole\Client> public method verifyPeerCert ] { + + - Parameters [0] { + } + - Return [ bool ] + } + + Method [ <internal:swoole, inherits Swoole\Client> public method getsockname ] { + + - Parameters [0] { + } + - Return [ array|false ] + } + + Method [ <internal:swoole, inherits Swoole\Client> public method getpeername ] { + + - Parameters [0] { + } + - Return [ array|false ] + } + + Method [ <internal:swoole, inherits Swoole\Client> public method getSocket ] { + + - Parameters [0] { + } + - Return [ Socket|false ] + } + } + } + Class [ <internal:swoole> class Swoole\Coroutine\Client ] { - Constants [4] { @@ -6837,7 +7051,7 @@ Extension [ <persistent> extension #125 swoole version 6.0.0 ] { Parameter #0 [ <required> string $pattern ] Parameter #1 [ <required> callable $callback ] } - - Return [ void ] + - Return [ bool ] } Method [ <internal:swoole> private method onAccept ] { diff --git a/php-pecl-swoole6.spec b/php-pecl-swoole6.spec index 213730d..c7195ac 100644 --- a/php-pecl-swoole6.spec +++ b/php-pecl-swoole6.spec @@ -46,14 +46,16 @@ %bcond_without nghttpd2 %global upstream_version 6.0.0 -#global upstream_prever RC2 +%global upstream_prever RC1 %global sources %{pecl_name}-%{upstream_version}%{?upstream_prever} %global _configure ../%{sources}/configure Summary: PHP's asynchronous concurrent distributed networking framework Name: %{?scl_prefix}php-pecl-%{pecl_name}6 -Version: %{upstream_version}%{?upstream_prever:~%{upstream_prever}} -Release: 3%{?dist}%{!?scl:%{!?nophptag:%(%{__php} -r 'echo ".".PHP_MAJOR_VERSION.".".PHP_MINOR_VERSION;')}} +# Without prever, See https://github.com/swoole/swoole-src/issues/5531 +#Version: %%{upstream_version}%%{?upstream_prever:~%%{upstream_prever}} +Version: %{upstream_version} +Release: 4%{?dist}%{!?scl:%{!?nophptag:%(%{__php} -r 'echo ".".PHP_MAJOR_VERSION.".".PHP_MINOR_VERSION;')}} # Extension is Apache-2.0 # BSD-3-Clause: Hiredis # MIT: nlohmann/json, nghttp2 @@ -61,7 +63,7 @@ License: Apache-2.0 AND BSD-3-Clause AND MIT URL: https://pecl.php.net/package/%{pecl_name} Source0: https://pecl.php.net/get/%{pecl_name}-%{upstream_version}%{?upstream_prever}.tgz -Patch0: 5537.patch +Patch0: 5579.patch BuildRequires: make BuildRequires: %{?dtsprefix}gcc @@ -73,7 +75,6 @@ BuildRequires: %{?scl_prefix}php-json BuildRequires: %{?scl_prefix}php-sockets BuildRequires: %{?scl_prefix}php-mysqlnd BuildRequires: %{?scl_prefix}php-pdo -BuildRequires: pcre-devel BuildRequires: openssl-devel >= 1.0.2 BuildRequires: zlib-devel %if %{with curl} @@ -93,7 +94,7 @@ BuildRequires: pkgconfig(libpq) BuildRequires: pkgconfig(libnghttp2) %endif %if %{with uring} -BuildRequires: pkgconfig(liburing) +BuildRequires: pkgconfig(liburing) >= 2.5 %endif BuildRequires: pkgconfig(odbc) BuildRequires: pkgconfig(sqlite3) @@ -198,7 +199,7 @@ rm -r thirdparty/nghttp2 cp -p thirdparty/nghttp2/COPYING nghttp2-COPYING %endif -%patch -P0 -p1 -b .pr5537 +%patch -P0 -p1 -b .pr5579 # Sanity check, really often broken extver=$(sed -n '/#define SWOOLE_VERSION /{s/.* "//;s/".*$//;p}' include/swoole_version.h) @@ -368,6 +369,13 @@ cd ../ZTS %changelog +* Thu Nov 21 2024 Remi Collet <remi@remirepo.net> - 6.0.0-4 +- update to 6.0.0RC1 +- use 6.0.0-4 to workaround https://github.com/swoole/swoole-src/issues/5531 +- drop patch merged upstream +- fix https://github.com/swoole/swoole-src/issues/5577 build with liburing < 2.6 + using patch from https://github.com/swoole/swoole-src/pull/5579 + * Tue Oct 22 2024 Remi Collet <remi@remirepo.net> - 6.0.0-3 - add fix for PHP 8.4 from https://github.com/swoole/swoole-src/pull/5537 |