From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from lists.gentoo.org (pigeon.gentoo.org [208.92.234.80]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits)) (No client certificate requested) by finch.gentoo.org (Postfix) with ESMTPS id 6BB04158086 for ; Tue, 23 Nov 2021 15:18:53 +0000 (UTC) Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id 97441E0877; Tue, 23 Nov 2021 15:18:52 +0000 (UTC) Received: from smtp.gentoo.org (woodpecker.gentoo.org [140.211.166.183]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits)) (No client certificate requested) by pigeon.gentoo.org (Postfix) with ESMTPS id 6C0BFE0877 for ; Tue, 23 Nov 2021 15:18:52 +0000 (UTC) Received: from oystercatcher.gentoo.org (unknown [IPv6:2a01:4f8:202:4333:225:90ff:fed9:fc84]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits)) (No client certificate requested) by smtp.gentoo.org (Postfix) with ESMTPS id 4C9E6342F96 for ; Tue, 23 Nov 2021 15:18:51 +0000 (UTC) Received: from localhost.localdomain (localhost [IPv6:::1]) by oystercatcher.gentoo.org (Postfix) with ESMTP id 0620E1BD for ; Tue, 23 Nov 2021 15:18:50 +0000 (UTC) From: "Brian Evans" To: gentoo-commits@lists.gentoo.org Content-Transfer-Encoding: 8bit Content-type: text/plain; charset=UTF-8 Reply-To: gentoo-dev@lists.gentoo.org, "Brian Evans" Message-ID: <1637680727.fdbb79a442691183e3a57ef06c0dc0f430ecea3a.grknight@gentoo> Subject: [gentoo-commits] repo/gentoo:master commit in: dev-php/pecl-memcache/, dev-php/pecl-memcache/files/ X-VCS-Repository: repo/gentoo X-VCS-Files: dev-php/pecl-memcache/files/8.0-patches-20211123.patch dev-php/pecl-memcache/pecl-memcache-4.0.5.2-r1.ebuild dev-php/pecl-memcache/pecl-memcache-8.0-r1.ebuild X-VCS-Directories: dev-php/pecl-memcache/files/ dev-php/pecl-memcache/ X-VCS-Committer: grknight X-VCS-Committer-Name: Brian Evans X-VCS-Revision: fdbb79a442691183e3a57ef06c0dc0f430ecea3a X-VCS-Branch: master Date: Tue, 23 Nov 2021 15:18:50 +0000 (UTC) Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: List-Id: Gentoo Linux mail X-BeenThere: gentoo-commits@lists.gentoo.org X-Auto-Response-Suppress: DR, RN, NRN, OOF, AutoReply X-Archives-Salt: b20c1a37-aec8-4c68-adfb-665fa4734387 X-Archives-Hash: 36fd1953ace07e69777813e8057243b5 commit: fdbb79a442691183e3a57ef06c0dc0f430ecea3a Author: Brian Evans gentoo org> AuthorDate: Tue Nov 23 14:52:40 2021 +0000 Commit: Brian Evans gentoo org> CommitDate: Tue Nov 23 15:18:47 2021 +0000 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=fdbb79a4 dev-php/pecl-memcache: Revbump to support PHP 8.1 Signed-off-by: Brian Evans gentoo.org> .../pecl-memcache/files/8.0-patches-20211123.patch | 204 +++++++++++++++++++++ .../pecl-memcache/pecl-memcache-4.0.5.2-r1.ebuild | 3 +- ...0.5.2-r1.ebuild => pecl-memcache-8.0-r1.ebuild} | 21 ++- 3 files changed, 219 insertions(+), 9 deletions(-) diff --git a/dev-php/pecl-memcache/files/8.0-patches-20211123.patch b/dev-php/pecl-memcache/files/8.0-patches-20211123.patch new file mode 100644 index 000000000000..9005ac5feef3 --- /dev/null +++ b/dev-php/pecl-memcache/files/8.0-patches-20211123.patch @@ -0,0 +1,204 @@ +diff --git a/Dockerfile b/Dockerfile +index a52759e..506c28a 100644 +--- a/Dockerfile ++++ b/Dockerfile +@@ -1,10 +1,13 @@ + ARG PHP_IMAGE=php:8.0 + FROM $PHP_IMAGE + ++RUN docker-php-ext-configure pcntl --enable-pcntl \ ++ && docker-php-ext-install -j$(nproc) pcntl ++ + RUN apt-get update && apt-get install -y \ + git \ + zlib1g-dev \ +- memcached ; ++ memcached ; + + COPY docker/host.conf /etc/host.conf + +diff --git a/README b/README +index b36fa46..07f8f89 100644 +--- a/README ++++ b/README +@@ -3,7 +3,7 @@ This is an official repository for pecl-memcache plugin since 2019. + This repository contains modified pecl-memcache plugin ported to PHP8, + which was originally developed for the need of hosting company in Slovakia (Websupport.sk). + +-The latest release is 8.0 (released: 2020-12-06) with support for PHP 8.0. ++The latest release is 8.0 (released: 2020-12-06) with support for PHP 8.0 and unofficial support for PHP 7.3 and 7.4 + + Please use version 4.0.5.1 (released: 2020-12-19) for PHP 7.x from branch NON_BLOCKING_IO_php7. + +diff --git a/Vagrantfile b/Vagrantfile +new file mode 100644 +index 0000000..8665890 +--- /dev/null ++++ b/Vagrantfile +@@ -0,0 +1,17 @@ ++# -*- mode: ruby -*- ++# vi: set ft=ruby : ++ ++VAGRANTFILE_API_VERSION = '2' ++ ++Vagrant.configure(VAGRANTFILE_API_VERSION) do |config| ++ config.vm.box = 'ubuntu/bionic64' ++ ++ config.vm.provider :virtualbox do |vb| ++ vb.name = 'ext-memcache-dev' ++ vb.memory = 1024 ++ vb.cpus = 2 ++ end ++ ++ config.vm.provision 'docker' ++ ++end +diff --git a/src/memcache.c b/src/memcache.c +index 7c3a660..2cb675b 100644 +--- a/src/memcache.c ++++ b/src/memcache.c +@@ -924,7 +924,7 @@ static void php_mmc_store(INTERNAL_FUNCTION_PARAMETERS, int op) /* {{{ */ + continue; + } + +- /* begin sending requests immediatly */ ++ /* begin sending requests immediately */ + mmc_pool_select(pool); + } ZEND_HASH_FOREACH_END(); + } +@@ -1089,7 +1089,7 @@ static void php_mmc_numeric(INTERNAL_FUNCTION_PARAMETERS, int deleted, int inver + continue; + } + +- /* begin sending requests immediatly */ ++ /* begin sending requests immediately */ + mmc_pool_select(pool); + } ZEND_HASH_FOREACH_END(); + +@@ -1319,8 +1319,9 @@ static void php_mmc_connect(INTERNAL_FUNCTION_PARAMETERS, zend_bool persistent) + size_t host_len; + zend_long tcp_port = MEMCACHE_G(default_port); + double timeout = MMC_DEFAULT_TIMEOUT; ++ zend_bool null_port; + +- if (zend_parse_parameters(ZEND_NUM_ARGS(), "s|ld", &host, &host_len, &tcp_port, &timeout) == FAILURE) { ++ if (zend_parse_parameters(ZEND_NUM_ARGS(), "s|l!d", &host, &host_len, &tcp_port, &null_port, &timeout) == FAILURE) { + return; + } + +@@ -2492,7 +2493,7 @@ PHP_FUNCTION(memcache_flush) + pool->protocol->flush(request, delay); + + if (mmc_pool_schedule(pool, pool->servers[i], request) == MMC_OK) { +- /* begin sending requests immediatly */ ++ /* begin sending requests immediately */ + mmc_pool_select(pool); + } + } +diff --git a/src/memcache_pool.c b/src/memcache_pool.c +index 733a0c5..e52389d 100644 +--- a/src/memcache_pool.c ++++ b/src/memcache_pool.c +@@ -1303,7 +1303,7 @@ int mmc_pool_schedule_get( + pool->protocol->end_get(mmc->buildreq); + mmc_pool_schedule(pool, mmc, mmc->buildreq); + +- /* begin sending requests immediatly */ ++ /* begin sending requests immediately */ + mmc_pool_select(pool); + + mmc->buildreq = mmc_pool_request_get( +diff --git a/src/memcache_session.c b/src/memcache_session.c +index e4a80de..d3aab24 100644 +--- a/src/memcache_session.c ++++ b/src/memcache_session.c +@@ -319,7 +319,7 @@ PS_READ_FUNC(memcache) + ZVAL_NULL(&addresult); + + /* third request fetches the data, data is only valid if either of the lock requests succeeded */ +- ZVAL_EMPTY_STRING(&dataresult); ++ ZVAL_NULL(&dataresult); + + /* create requests */ + if (php_mmc_session_read_request(pool, &zkey, lockparam, &addresult, dataparam, &lockrequest, &addrequest, &datarequest) != MMC_OK) { +diff --git a/tests/redundancy_test.phpt b/tests/redundancy_test.phpt +new file mode 100644 +index 0000000..fb5ab84 +--- /dev/null ++++ b/tests/redundancy_test.phpt +@@ -0,0 +1,75 @@ ++--TEST-- ++redundancy test ++--SKIPIF-- ++ ++--FILE-- ++flush(); ++ ++$pid = pcntl_fork(); ++if (!$pid) { ++ // In child process ++ session_id($sid); ++ session_start(); ++ if (!isset($_SESSION['counter'])) ++ $_SESSION['counter'] = 0; ++ $_SESSION['counter'] += 1; ++ session_write_close(); ++ ++ exit(0); ++} ++pcntl_waitpid($pid, $status); ++ ++$memcache2->flush(); ++ ++$pid = pcntl_fork(); ++if (!$pid) { ++ // In child process ++ session_id($sid); ++ session_start(); ++ if (!isset($_SESSION['counter'])) ++ $_SESSION['counter'] = 0; ++ $_SESSION['counter'] += 1; ++ session_write_close(); ++ ++ exit(0); ++} ++pcntl_waitpid($pid, $status); ++ ++ ++session_id($sid); ++session_start(); ++var_dump($_SESSION); ++ ++?> ++--EXPECT-- ++array(1) { ++ ["counter"]=> ++ int(3) ++} diff --git a/dev-php/pecl-memcache/pecl-memcache-4.0.5.2-r1.ebuild b/dev-php/pecl-memcache/pecl-memcache-4.0.5.2-r1.ebuild index 10134a07db4d..240a4d9d5754 100644 --- a/dev-php/pecl-memcache/pecl-memcache-4.0.5.2-r1.ebuild +++ b/dev-php/pecl-memcache/pecl-memcache-4.0.5.2-r1.ebuild @@ -9,7 +9,7 @@ PHP_EXT_NEEDED_USE="session(-)?" DOCS=( README example.php ) HTML_DOCS=( memcache.php ) -USE_PHP="php7-3 php7-4 php8-0" +USE_PHP="php7-3 php7-4 php8-0 php8-1" inherit php-ext-pecl-r3 @@ -25,6 +25,7 @@ IUSE="+session" DEPEND="php_targets_php7-3? ( sys-libs/zlib ) php_targets_php7-4? ( sys-libs/zlib )" RDEPEND="${DEPEND} php_targets_php8-0? ( dev-php/pecl-memcache:8[php_targets_php8-0(-)?] ) + php_targets_php8-1? ( dev-php/pecl-memcache:8[php_targets_php8-1(-)?] ) " # The test suite requires memcached to be running. diff --git a/dev-php/pecl-memcache/pecl-memcache-4.0.5.2-r1.ebuild b/dev-php/pecl-memcache/pecl-memcache-8.0-r1.ebuild similarity index 72% copy from dev-php/pecl-memcache/pecl-memcache-4.0.5.2-r1.ebuild copy to dev-php/pecl-memcache/pecl-memcache-8.0-r1.ebuild index 10134a07db4d..ec0fa315424c 100644 --- a/dev-php/pecl-memcache/pecl-memcache-4.0.5.2-r1.ebuild +++ b/dev-php/pecl-memcache/pecl-memcache-8.0-r1.ebuild @@ -9,29 +9,34 @@ PHP_EXT_NEEDED_USE="session(-)?" DOCS=( README example.php ) HTML_DOCS=( memcache.php ) -USE_PHP="php7-3 php7-4 php8-0" +USE_PHP="php7-3 php7-4 php8-0 php8-1" inherit php-ext-pecl-r3 -USE_PHP="php7-3 php7-4" +USE_PHP="php8-0 php8-1" KEYWORDS="~amd64 ~hppa ~ppc64 ~x86" DESCRIPTION="PHP extension for using memcached" LICENSE="PHP-3" -SLOT="7" +SLOT="8" IUSE="+session" -DEPEND="php_targets_php7-3? ( sys-libs/zlib ) php_targets_php7-4? ( sys-libs/zlib )" +DEPEND=" + php_targets_php8-0? ( sys-libs/zlib ) + php_targets_php8-1? ( sys-libs/zlib ) +" RDEPEND="${DEPEND} - php_targets_php8-0? ( dev-php/pecl-memcache:8[php_targets_php8-0(-)?] ) + php_targets_php7-3? ( dev-php/pecl-memcache:7[php_targets_php7-3(-)?] ) + php_targets_php7-4? ( dev-php/pecl-memcache:7[php_targets_php7-4(-)?] ) " # The test suite requires memcached to be running. RESTRICT='test' +PATCHES=( "${FILESDIR}/8.0-patches-20211123.patch" ) src_prepare() { - if use php_targets_php7-3 || use php_targets_php7-4 ; then + if use php_targets_php8-0 || use php_targets_php8-1 ; then php-ext-source-r3_src_prepare else default @@ -39,14 +44,14 @@ src_prepare() { } src_configure() { - if use php_targets_php7-3 || use php_targets_php7-4 ; then + if use php_targets_php8-0 || use php_targets_php8-1 ; then local PHP_EXT_ECONF_ARGS=( --enable-memcache --with-zlib-dir="${EPREFIX}/usr" $(use_enable session memcache-session) ) php-ext-source-r3_src_configure fi } src_install() { - if use php_targets_php7-3 || use php_targets_php7-4 ; then + if use php_targets_php8-0 || use php_targets_php8-1 ; then php-ext-pecl-r3_src_install php-ext-source-r3_addtoinifiles "memcache.allow_failover" "true"