diff options
author | Remi Collet <remi@remirepo.net> | 2025-09-04 11:18:58 +0200 |
---|---|---|
committer | Remi Collet <remi@php.net> | 2025-09-04 11:18:58 +0200 |
commit | 0990d28c462351f48fb734240c923a8badd79490 (patch) | |
tree | 508e273facccde060be37982193c4267f743d950 | |
parent | 2c3c897ecfe1c4a6657446bbc48bffcbcb580aff (diff) |
more patch for test suite with PHP 8.5.0beta2 from
https://github.com/TysonAndre/pecl-teds/pull/205
-rw-r--r-- | php-pecl-teds.spec | 54 | ||||
-rw-r--r-- | teds-php84.patch | 264 | ||||
-rw-r--r-- | teds-php85.patch | 51 |
3 files changed, 339 insertions, 30 deletions
diff --git a/php-pecl-teds.spec b/php-pecl-teds.spec index 362be77..1e1b691 100644 --- a/php-pecl-teds.spec +++ b/php-pecl-teds.spec @@ -1,8 +1,8 @@ # remirepo spec file for php-pecl-teds # -# Copyright (c) 2021-2023 Remi Collet -# License: CC-BY-SA-4.0 -# http://creativecommons.org/licenses/by-sa/4.0/ +# SPDX-FileCopyrightText: Copyright 2021-2025 Remi Collet +# SPDX-License-Identifier: CECILL-2.1 +# http://www.cecill.info/licences/Licence_CeCILL_V2-en.txt # # Please, preserve the changelog entries # @@ -23,13 +23,15 @@ Summary: Tentative Extra Data Structures Name: %{?scl_prefix}php-pecl-%{pecl_name} Version: %{upstream_version}%{?upstream_prever:~%{upstream_prever}} -Release: 2%{?dist}%{!?scl:%{!?nophptag:%(%{__php} -r 'echo ".".PHP_MAJOR_VERSION.".".PHP_MINOR_VERSION;')}} +Release: 4%{?dist}%{!?scl:%{!?nophptag:%(%{__php} -r 'echo ".".PHP_MAJOR_VERSION.".".PHP_MINOR_VERSION;')}} License: BSD-3-Clause URL: https://pecl.php.net/package/%{pecl_name} Source0: https://pecl.php.net/get/%{sources}.tgz Patch0: %{pecl_name}-php83.patch +Patch1: %{pecl_name}-php84.patch +Patch2: %{pecl_name}-php85.patch BuildRequires: make BuildRequires: %{?dtsprefix}gcc @@ -57,11 +59,13 @@ Package built for PHP %(%{__php} -r 'echo PHP_MAJOR_VERSION.".".PHP_MINOR_VERSIO # Don't install/register tests sed -e 's/role="test"/role="src"/' \ - %{?_licensedir:-e '/COPYING/s/role="doc"/role="src"/' } \ + -e '/COPYING/s/role="doc"/role="src"/' \ -i package.xml cd %{sources} %patch -P0 -p1 -b.pr204 +%patch -P1 -p1 -b.pr205 +%patch -P2 -p1 -b.pr205 # Check version as upstream often forget to update this extver=$(sed -n '/define PHP_TEDS_VERSION/{s/.* "//;s/".*$//;p}' php_teds.h) @@ -94,15 +98,16 @@ peclconf() { cd %{sources} %{__phpize} +sed -e 's/INSTALL_ROOT/DESTDIR/' -i build/Makefile.global cd ../NTS peclconf %{__phpconfig} -make %{?_smp_mflags} +%make_build %if %{with_zts} cd ../ZTS peclconf %{__ztsphpconfig} -make %{?_smp_mflags} +%make_build %endif @@ -110,7 +115,7 @@ make %{?_smp_mflags} %{?dtsenable} # Install the NTS stuff -make -C NTS install INSTALL_ROOT=%{buildroot} +%make_install -C NTS install -D -m 644 %{ini_name} %{buildroot}%{php_inidir}/%{ini_name} # Install XML package description @@ -118,7 +123,7 @@ install -D -m 644 package.xml %{buildroot}%{pecl_xmldir}/%{name}.xml # Install the ZTS stuff %if %{with_zts} -make -C ZTS install INSTALL_ROOT=%{buildroot} +%make_install -C ZTS install -D -m 644 %{ini_name} %{buildroot}%{php_ztsinidir}/%{ini_name} %endif @@ -150,28 +155,8 @@ TEST_PHP_ARGS="-n -d extension=%{buildroot}%{php_extdir}/%{pecl_name}.so" \ %endif -%if 0%{?fedora} < 24 && 0%{?rhel} < 8 -# when pear installed alone, after us -%triggerin -- %{?scl_prefix}php-pear -if [ -x %{__pecl} ] ; then - %{pecl_install} %{pecl_xmldir}/%{name}.xml >/dev/null || : -fi - -# posttrans as pear can be installed after us -%posttrans -if [ -x %{__pecl} ] ; then - %{pecl_install} %{pecl_xmldir}/%{name}.xml >/dev/null || : -fi - -%postun -if [ $1 -eq 0 -a -x %{__pecl} ] ; then - %{pecl_uninstall} %{pecl_name} >/dev/null || : -fi -%endif - - %files -%{?_licensedir:%license %{sources}/COPYING} +%license %{sources}/COPYING %doc %{pecl_docdir}/%{pecl_name} %{pecl_xmldir}/%{name}.xml @@ -185,6 +170,15 @@ fi %changelog +* Thu Sep 4 2025 Remi Collet <remi@remirepo.net> - 1.3.0-4 +- re-license spec file to CECILL-2.1 +- more patch for test suite with PHP 8.5.0beta2 from + https://github.com/TysonAndre/pecl-teds/pull/205 + +* Tue Oct 1 2024 Remi Collet <remi@remirepo.net> - 1.3.0-3 +- add patch for test suite with PHP 8.4 from + https://github.com/TysonAndre/pecl-teds/pull/205 + * Mon Sep 4 2023 Remi Collet <remi@remirepo.net> - 1.3.0-2 - build out of sources tree - add patch for test suite with PHP 8.3 from diff --git a/teds-php84.patch b/teds-php84.patch new file mode 100644 index 0000000..773590b --- /dev/null +++ b/teds-php84.patch @@ -0,0 +1,264 @@ +From e608bd4ffc07a32ef381cd69fa401ed051e8ae3b Mon Sep 17 00:00:00 2001 +From: Remi Collet <remi@remirepo.net> +Date: Tue, 1 Oct 2024 15:15:18 +0200 +Subject: [PATCH 1/2] Fix headers for change in 8.4 + +--- + teds.h | 2 ++ + teds_cachediterable.c | 2 -- + teds_immutableiterable.c | 2 -- + teds_mutableiterable.c | 2 -- + teds_stricthashmap.c | 2 -- + teds_stricthashset.c | 3 +-- + teds_strictheap.c | 3 +-- + teds_strictsortedvectormap.c | 2 -- + teds_strictsortedvectorset.c | 2 -- + teds_stricttreemap.c | 2 -- + teds_stricttreeset.c | 3 +-- + 11 files changed, 5 insertions(+), 20 deletions(-) + +diff --git a/teds.h b/teds.h +index 5164fa7..80df012 100644 +--- a/teds.h ++++ b/teds.h +@@ -2,7 +2,9 @@ + #define TEDS_H + + #include "zend_API.h" ++#if PHP_VERSION_ID < 80400 + #include "ext/spl/spl_engine.h" ++#endif + #include "teds_bswap.h" + + #define TEDS_MINIT_IGNORE_UNUSED() do { (void) type; (void) module_number; } while (0) +diff --git a/teds_cachediterable.c b/teds_cachediterable.c +index 7a6aa51..1970712 100644 +--- a/teds_cachediterable.c ++++ b/teds_cachediterable.c +@@ -25,8 +25,6 @@ + #include "teds_cachediterable.h" + #include "teds_exceptions.h" + #include "teds_immutableiterable.h" +-// #include "ext/spl/spl_functions.h" +-#include "ext/spl/spl_engine.h" + #include "ext/spl/spl_exceptions.h" + #include "ext/spl/spl_iterators.h" + #include "ext/json/php_json.h" +diff --git a/teds_immutableiterable.c b/teds_immutableiterable.c +index 54fb123..c28a9a5 100644 +--- a/teds_immutableiterable.c ++++ b/teds_immutableiterable.c +@@ -24,8 +24,6 @@ + #include "teds_immutableiterable_arginfo.h" + #include "teds_immutableiterable.h" + #include "teds_exceptions.h" +-// #include "ext/spl/spl_functions.h" +-#include "ext/spl/spl_engine.h" + #include "ext/spl/spl_exceptions.h" + #include "ext/spl/spl_iterators.h" + #include "ext/json/php_json.h" +diff --git a/teds_mutableiterable.c b/teds_mutableiterable.c +index 2a890c1..17894cb 100644 +--- a/teds_mutableiterable.c ++++ b/teds_mutableiterable.c +@@ -22,8 +22,6 @@ + #include "teds_mutableiterable_arginfo.h" + #include "teds_mutableiterable.h" + #include "teds_immutableiterable.h" +-// #include "ext/spl/spl_functions.h" +-#include "ext/spl/spl_engine.h" + #include "ext/spl/spl_exceptions.h" + #include "ext/spl/spl_iterators.h" + #include "ext/json/php_json.h" +diff --git a/teds_stricthashmap.c b/teds_stricthashmap.c +index 7570ebc..af3e078 100644 +--- a/teds_stricthashmap.c ++++ b/teds_stricthashmap.c +@@ -26,8 +26,6 @@ + #include "teds_interfaces.h" + #include "teds_exceptions.h" + #include "teds.h" +-// #include "ext/spl/spl_functions.h" +-#include "ext/spl/spl_engine.h" + #include "ext/spl/spl_exceptions.h" + #include "ext/spl/spl_iterators.h" + #include "ext/json/php_json.h" +diff --git a/teds_stricthashset.c b/teds_stricthashset.c +index 4ff33ea..b706f01 100644 +--- a/teds_stricthashset.c ++++ b/teds_stricthashset.c +@@ -33,11 +33,10 @@ + #include "teds_util.h" + #include "teds_interfaces.h" + #include "teds.h" +-// #include "ext/spl/spl_functions.h" +-#include "ext/spl/spl_engine.h" + #include "ext/spl/spl_exceptions.h" + #include "ext/spl/spl_iterators.h" + #include "ext/json/php_json.h" ++#include "Zend/zend_interfaces.h" + + #include <stdbool.h> + +diff --git a/teds_strictheap.c b/teds_strictheap.c +index 38456fa..dfc1265 100644 +--- a/teds_strictheap.c ++++ b/teds_strictheap.c +@@ -24,11 +24,10 @@ + #include "teds_util.h" + #include "teds.h" + #include "teds_interfaces.h" +-// #include "ext/spl/spl_functions.h" +-#include "ext/spl/spl_engine.h" + #include "ext/spl/spl_exceptions.h" + #include "ext/spl/spl_iterators.h" + #include "ext/json/php_json.h" ++#include "Zend/zend_interfaces.h" + + #include <stdbool.h> + +diff --git a/teds_strictsortedvectormap.c b/teds_strictsortedvectormap.c +index 5b0a443..1b6f8a6 100644 +--- a/teds_strictsortedvectormap.c ++++ b/teds_strictsortedvectormap.c +@@ -26,8 +26,6 @@ + #include "teds_exceptions.h" + #include "teds_mutableiterable.h" + #include "teds.h" +-// #include "ext/spl/spl_functions.h" +-#include "ext/spl/spl_engine.h" + #include "ext/spl/spl_exceptions.h" + #include "ext/spl/spl_iterators.h" + #include "ext/json/php_json.h" +diff --git a/teds_strictsortedvectorset.c b/teds_strictsortedvectorset.c +index 348a58f..4db20f0 100644 +--- a/teds_strictsortedvectorset.c ++++ b/teds_strictsortedvectorset.c +@@ -27,8 +27,6 @@ + #include "teds_exceptions.h" + #include "teds_vector.h" + #include "teds.h" +-// #include "ext/spl/spl_functions.h" +-#include "ext/spl/spl_engine.h" + #include "ext/spl/spl_exceptions.h" + #include "ext/spl/spl_iterators.h" + #include "ext/json/php_json.h" +diff --git a/teds_stricttreemap.c b/teds_stricttreemap.c +index 89efe4f..c51afa5 100644 +--- a/teds_stricttreemap.c ++++ b/teds_stricttreemap.c +@@ -24,8 +24,6 @@ + #include "teds_interfaces.h" + #include "teds_exceptions.h" + #include "teds.h" +-// #include "ext/spl/spl_functions.h" +-#include "ext/spl/spl_engine.h" + #include "ext/spl/spl_exceptions.h" + #include "ext/spl/spl_iterators.h" + #include "ext/json/php_json.h" +diff --git a/teds_stricttreeset.c b/teds_stricttreeset.c +index 748c478..0829404 100644 +--- a/teds_stricttreeset.c ++++ b/teds_stricttreeset.c +@@ -23,11 +23,10 @@ + #include "teds_util.h" + #include "teds_interfaces.h" + #include "teds.h" +-// #include "ext/spl/spl_functions.h" +-#include "ext/spl/spl_engine.h" + #include "ext/spl/spl_exceptions.h" + #include "ext/spl/spl_iterators.h" + #include "ext/json/php_json.h" ++#include "Zend/zend_interfaces.h" + + #include <stdbool.h> + + +From c27d117239c9e389d7f3116c524306bfd410667a Mon Sep 17 00:00:00 2001 +From: Remi Collet <remi@remirepo.net> +Date: Tue, 1 Oct 2024 15:15:57 +0200 +Subject: [PATCH 2/2] Fix test expectation for PHP 8.4 + +--- + tests/iterable/any_array.phpt | 2 +- + tests/iterable/fold_traversable.phpt | 6 +++--- + tests/iterable/none_array.phpt | 2 +- + tests/misc/strict_hash.phpt | 8 ++++---- + 4 files changed, 9 insertions(+), 9 deletions(-) + +diff --git a/tests/iterable/any_array.phpt b/tests/iterable/any_array.phpt +index 09e28aa..ebee711 100644 +--- a/tests/iterable/any_array.phpt ++++ b/tests/iterable/any_array.phpt +@@ -72,7 +72,7 @@ bool(true) + int(2) + + *** Testing second argument to predicate *** +-Caught ArgumentCountError: Too few arguments to function {closure}(), 1 passed and exactly 2 expected ++Caught ArgumentCountError: Too few arguments to function {closur%s}(), 1 passed and exactly 2 expected + + *** Testing edge cases *** + bool(false) +diff --git a/tests/iterable/fold_traversable.phpt b/tests/iterable/fold_traversable.phpt +index 5b013b1..1ce0d4a 100644 +--- a/tests/iterable/fold_traversable.phpt ++++ b/tests/iterable/fold_traversable.phpt +@@ -46,9 +46,9 @@ string(10) "helloworld" + string(12) "HELLO WORLD!" + string(12) "HELLO WORLD!" + +-Warning: {closure}(): Argument #1 ($carry) must be passed by reference, value given in %s on line 12 ++Warning: {closur%s}(): Argument #1 ($carry) must be passed by reference, value given in %s on line 12 + +-Warning: {closure}(): Argument #1 ($carry) must be passed by reference, value given in %s on line 12 ++Warning: {closur%s}(): Argument #1 ($carry) must be passed by reference, value given in %s on line 12 + +-Warning: {closure}(): Argument #1 ($carry) must be passed by reference, value given in %s on line 12 ++Warning: {closur%s}(): Argument #1 ($carry) must be passed by reference, value given in %s on line 12 + string(12) "HELLO WORLD!" +diff --git a/tests/iterable/none_array.phpt b/tests/iterable/none_array.phpt +index 5e69706..ad49054 100644 +--- a/tests/iterable/none_array.phpt ++++ b/tests/iterable/none_array.phpt +@@ -72,7 +72,7 @@ bool(false) + int(2) + + *** Testing second argument to predicate *** +-Caught ArgumentCountError: Too few arguments to function {closure}(), 1 passed and exactly 2 expected ++Caught ArgumentCountError: Too few arguments to function {closur%s}(), 1 passed and exactly 2 expected + + *** Testing edge cases *** + bool(true) +diff --git a/tests/misc/strict_hash.phpt b/tests/misc/strict_hash.phpt +index 8202f82..8ab86ef 100644 +--- a/tests/misc/strict_hash.phpt ++++ b/tests/misc/strict_hash.phpt +@@ -64,7 +64,7 @@ foreach ($values as $value) { + $all[$hash] = $value; + } + ?> +---EXPECT-- ++--EXPECTF-- + NULL + => 0x06742e765a0a0214 + bool(false) +@@ -153,10 +153,10 @@ object(stdClass)#1 (0) { + object(stdClass)#2 (0) { + } + => 0xb8d3134c0b865909 +-object(Closure)#3 (0) { ++object(Closure)#3 (%d) {%A + } + => 0x91bcd0ffe3de8667 +-object(Closure)#4 (0) { ++object(Closure)#4 (%d) {%A + } + => 0x6aa58db3bc37b4c5 + resource(1) of type (stream) +@@ -170,4 +170,4 @@ float(NAN) + float(NAN) + => 0x6a289d03903422a8 (Already saw) + float(NAN) +-=> 0x6a289d03903422a8 (Already saw) +\ No newline at end of file ++=> 0x6a289d03903422a8 (Already saw) diff --git a/teds-php85.patch b/teds-php85.patch new file mode 100644 index 0000000..dea1e8e --- /dev/null +++ b/teds-php85.patch @@ -0,0 +1,51 @@ +From b49ba663707bfc6d84ab2ffca1dbfdb31ef2de2d Mon Sep 17 00:00:00 2001 +From: Remi Collet <remi@remirepo.net> +Date: Thu, 4 Sep 2025 11:13:02 +0200 +Subject: [PATCH] Fix Deprecated: Increment on non-numeric string is deprecated + (8.5) + +--- + tests/StrictTreeMap/rebalance_insert.phpt | 4 ++-- + tests/StrictTreeSet/rebalance_add.phpt | 6 +++--- + 2 files changed, 5 insertions(+), 5 deletions(-) + +diff --git a/tests/StrictTreeMap/rebalance_insert.phpt b/tests/StrictTreeMap/rebalance_insert.phpt +index 3b94abf..e9acb17 100644 +--- a/tests/StrictTreeMap/rebalance_insert.phpt ++++ b/tests/StrictTreeMap/rebalance_insert.phpt +@@ -3,8 +3,8 @@ Teds\StrictTreeMap rebalances + --FILE-- + <?php + $it = new Teds\StrictTreeMap(); +-for ($i = 'aa'; $i < 'ak'; $i++) { +- $it[$i] = true; ++for ($i = 0; $i < 10; $i++) { ++ $it['a' . chr(ord('a')+$i)] = true; + } + echo json_encode($it->debugGetTreeRepresentation(), JSON_PRETTY_PRINT), "\n"; + var_dump($it); +diff --git a/tests/StrictTreeSet/rebalance_add.phpt b/tests/StrictTreeSet/rebalance_add.phpt +index e661a6a..cf612e0 100644 +--- a/tests/StrictTreeSet/rebalance_add.phpt ++++ b/tests/StrictTreeSet/rebalance_add.phpt +@@ -3,8 +3,8 @@ Teds\StrictTreeSet rebalances + --FILE-- + <?php + $it = new Teds\StrictTreeSet(); +-for ($i = 'aa'; $i < 'ak'; $i++) { +- $it->add($i); ++for ($i = 0; $i < 10; $i++) { ++ $it->add('a' . chr(ord('a')+$i)); + } + echo json_encode($it->debugGetTreeRepresentation(), JSON_PRETTY_PRINT), "\n"; + var_dump($it); +@@ -82,4 +82,4 @@ object(Teds\StrictTreeSet)#1 (10) { + string(2) "ai" + [9]=> + string(2) "aj" +-} +\ No newline at end of file ++} +-- +2.51.0 + |