From 2968e8a2440cf5ef1bafb4abefbab7c1be2513be Mon Sep 17 00:00:00 2001 From: Remi Collet Date: Wed, 31 Jul 2024 08:20:07 +0200 Subject: Update to 8.4.0alpha3 fix build with libedit reverting a readline fix --- failed.txt | 2 +- php-7.4.0-ldap_r.patch | 19 -------------- php-8.4.0-ldap_r.patch | 19 ++++++++++++++ php-8.4.0-systzdata-v24.patch | 8 +++--- php.spec | 13 +++++++-- upstream.patch | 61 +++++++++++++++++++++++++++++++++++++++++++ 6 files changed, 96 insertions(+), 26 deletions(-) delete mode 100644 php-7.4.0-ldap_r.patch create mode 100644 php-8.4.0-ldap_r.patch create mode 100644 upstream.patch diff --git a/failed.txt b/failed.txt index 9437e9d..fef5d58 100644 --- a/failed.txt +++ b/failed.txt @@ -1,4 +1,4 @@ -===== 8.4.0alpha2 (2024-07-18) +===== 8.4.0alpha3 (2024-08-01) $ grep -ar 'Tests failed' /var/lib/mock/*/build.log diff --git a/php-7.4.0-ldap_r.patch b/php-7.4.0-ldap_r.patch deleted file mode 100644 index 13566b4..0000000 --- a/php-7.4.0-ldap_r.patch +++ /dev/null @@ -1,19 +0,0 @@ - -Use -lldap_r by default. - -diff -up php-7.4.0RC2/ext/ldap/config.m4.ldap_r php-7.4.0RC2/ext/ldap/config.m4 ---- php-7.4.0RC2/ext/ldap/config.m4.ldap_r 2019-09-17 10:21:24.769200812 +0200 -+++ php-7.4.0RC2/ext/ldap/config.m4 2019-09-17 10:21:30.658181771 +0200 -@@ -68,7 +68,11 @@ if test "$PHP_LDAP" != "no"; then - dnl -pc removal is a hack for clang - MACHINE_INCLUDES=$($CC -dumpmachine | $SED 's/-pc//') - -- if test -f $LDAP_LIBDIR/liblber.a || test -f $LDAP_LIBDIR/liblber.$SHLIB_SUFFIX_NAME || test -f $LDAP_LIBDIR/$MACHINE_INCLUDES/liblber.a || test -f $LDAP_LIBDIR/$MACHINE_INCLUDES/liblber.$SHLIB_SUFFIX_NAME; then -+ if test -f $LDAP_LIBDIR/libldap_r.$SHLIB_SUFFIX_NAME; then -+ PHP_ADD_LIBRARY_WITH_PATH(lber, $LDAP_LIBDIR, LDAP_SHARED_LIBADD) -+ PHP_ADD_LIBRARY_WITH_PATH(ldap_r, $LDAP_LIBDIR, LDAP_SHARED_LIBADD) -+ -+ elif test -f $LDAP_LIBDIR/liblber.a || test -f $LDAP_LIBDIR/liblber.$SHLIB_SUFFIX_NAME || test -f $LDAP_LIBDIR/$MACHINE_INCLUDES/liblber.a || test -f $LDAP_LIBDIR/$MACHINE_INCLUDES/liblber.$SHLIB_SUFFIX_NAME; then - PHP_ADD_LIBRARY_WITH_PATH(lber, $LDAP_LIBDIR, LDAP_SHARED_LIBADD) - PHP_ADD_LIBRARY_WITH_PATH(ldap, $LDAP_LIBDIR, LDAP_SHARED_LIBADD) - diff --git a/php-8.4.0-ldap_r.patch b/php-8.4.0-ldap_r.patch new file mode 100644 index 0000000..ea27490 --- /dev/null +++ b/php-8.4.0-ldap_r.patch @@ -0,0 +1,19 @@ + +Use -lldap_r by default. + +diff -up php-7.4.0RC2/ext/ldap/config.m4.ldap_r php-7.4.0RC2/ext/ldap/config.m4 +--- php-7.4.0RC2/ext/ldap/config.m4.ldap_r 2019-09-17 10:21:24.769200812 +0200 ++++ php-7.4.0RC2/ext/ldap/config.m4 2019-09-17 10:21:30.658181771 +0200 +@@ -71,7 +71,11 @@ + dnl -pc removal is a hack for clang + MACHINE_INCLUDES=$($CC -dumpmachine | $SED 's/-pc//') + +- if test -f $LDAP_LIBDIR/liblber.a || test -f $LDAP_LIBDIR/liblber.$SHLIB_SUFFIX_NAME || test -f $LDAP_LIBDIR/$MACHINE_INCLUDES/liblber.a || test -f $LDAP_LIBDIR/$MACHINE_INCLUDES/liblber.$SHLIB_SUFFIX_NAME; then ++ if test -f $LDAP_LIBDIR/libldap_r.$SHLIB_SUFFIX_NAME; then ++ PHP_ADD_LIBRARY_WITH_PATH(lber, [$LDAP_LIBDIR], [LDAP_SHARED_LIBADD]) ++ PHP_ADD_LIBRARY_WITH_PATH(ldap_r, [$LDAP_LIBDIR], [LDAP_SHARED_LIBADD]) ++ ++ elif test -f $LDAP_LIBDIR/liblber.a || test -f $LDAP_LIBDIR/liblber.$SHLIB_SUFFIX_NAME || test -f $LDAP_LIBDIR/$MACHINE_INCLUDES/liblber.a || test -f $LDAP_LIBDIR/$MACHINE_INCLUDES/liblber.$SHLIB_SUFFIX_NAME; then + PHP_ADD_LIBRARY_WITH_PATH([lber], [$LDAP_LIBDIR], [LDAP_SHARED_LIBADD]) + PHP_ADD_LIBRARY_WITH_PATH([ldap], [$LDAP_LIBDIR], [LDAP_SHARED_LIBADD]) + diff --git a/php-8.4.0-systzdata-v24.patch b/php-8.4.0-systzdata-v24.patch index eeeeaad..6176a8b 100644 --- a/php-8.4.0-systzdata-v24.patch +++ b/php-8.4.0-systzdata-v24.patch @@ -39,9 +39,9 @@ r1: initial revision diff -up ./ext/date/config0.m4.systzdata ./ext/date/config0.m4 --- ./ext/date/config0.m4.systzdata 2024-07-03 16:21:20.240786848 +0200 +++ ./ext/date/config0.m4 2024-07-03 16:25:14.838995464 +0200 -@@ -4,6 +4,18 @@ AC_CHECK_HEADERS([io.h]) - dnl Check for strtoll, atoll - AC_CHECK_FUNCS([strtoll atoll]) +@@ -8,6 +8,18 @@ + [PHP_DATE_CFLAGS="$PHP_DATE_CFLAGS -Wno-implicit-fallthrough"],, + [-Werror]) +PHP_ARG_WITH(system-tzdata, for use of system timezone data, + [AS_HELP_STRING([--with-system-tzdata[=DIR]],[to specify use of system timezone data])], no, no) @@ -55,7 +55,7 @@ diff -up ./ext/date/config0.m4.systzdata ./ext/date/config0.m4 + fi +fi + - PHP_DATE_CFLAGS="-Wno-implicit-fallthrough -I@ext_builddir@/lib -DZEND_ENABLE_STATIC_TSRMLS_CACHE=1 -DHAVE_TIMELIB_CONFIG_H=1" + PHP_DATE_CFLAGS="$PHP_DATE_CFLAGS -I@ext_builddir@/lib -DZEND_ENABLE_STATIC_TSRMLS_CACHE=1 -DHAVE_TIMELIB_CONFIG_H=1" timelib_sources="lib/astro.c lib/dow.c lib/parse_date.c lib/parse_tz.c lib/parse_posix.c lib/timelib.c lib/tm2unixtime.c lib/unixtime2tm.c lib/parse_iso_intervals.c lib/interval.c" diff -up ./ext/date/lib/parse_tz.c.systzdata ./ext/date/lib/parse_tz.c diff --git a/php.spec b/php.spec index ef0210e..cfe2793 100644 --- a/php.spec +++ b/php.spec @@ -82,7 +82,7 @@ %global gh_owner php %global gh_project php-src %global upver 8.4.0 -%global rcver alpha2 +%global rcver alpha3 # TODO set PHP_EXTRA_VERSION for EOL version Summary: PHP scripting language for creating dynamic web sites @@ -136,7 +136,7 @@ Patch43: php-8.4.0-systzdata-v24.patch # + display PHP version backported from 8.4 Patch44: php-8.4.0-phpize.patch # Use -lldap_r for OpenLDAP -Patch45: php-7.4.0-ldap_r.patch +Patch45: php-8.4.0-ldap_r.patch # Ignore unsupported "threads" option on password_hash Patch46: php-8.0.7-argon2.patch # drop "Configure command" from phpinfo output @@ -149,6 +149,7 @@ Patch48: php-8.3.0-openssl-ec-param.patch # RC Patch # Upstream fixes (100+) +Patch100: upstream.patch # Security fixes (200+) @@ -192,6 +193,9 @@ BuildRequires: libtool BuildRequires: libtool-ltdl-devel %if %{with dtrace} BuildRequires: %{?dtsprefix}systemtap-sdt-devel +%if 0%{?fedora} >= 41 +BuildRequires: %{?dtsprefix}systemtap-sdt-dtrace +%endif %endif %if 0%{?gh_date} BuildRequires: bison @@ -839,6 +843,7 @@ sed -e 's/php-devel/%{?scl_prefix}php-devel/' -i scripts/phpize.in %patch -P48 -p1 -b .ec-param # upstream patches +%patch -P100 -p1 -R # security patches @@ -1633,6 +1638,10 @@ fi %changelog +* Tue Jul 30 2024 Remi Collet - 8.4.0~alpha3-1 +- Update to 8.4.0alpha3 +- fix build with libedit reverting a readline fix + * Wed Jul 17 2024 Remi Collet - 8.4.0~alpha2-1 - Update to 8.4.0alpha2 diff --git a/upstream.patch b/upstream.patch new file mode 100644 index 0000000..a08b628 --- /dev/null +++ b/upstream.patch @@ -0,0 +1,61 @@ +From a7d856d9bf784a93aa690e763b082d92629cfd83 Mon Sep 17 00:00:00 2001 +From: David Carlier +Date: Sat, 27 Jul 2024 09:30:11 +0100 +Subject: [PATCH] ext/readline: fix global readline vars when updating + rl_line_buffer. + +if the new value was larger, rl_line_buffer_length was never updated. +neither was rl_end (on unixes). + +close GH-15120 +--- + NEWS | 4 ++++ + ext/readline/readline.c | 17 +++++++++++++++-- + 2 files changed, 19 insertions(+), 2 deletions(-) + +diff --git a/NEWS b/NEWS +index 147d6ce70f504..f945ee519932f 100644 +--- a/NEWS ++++ b/NEWS +@@ -50,6 +50,10 @@ PHP NEWS + . Fixed bug GH-15094 (php_random_default_engine() is not C++ conforming). + (cmb) + ++- Readline: ++ . Fixed readline_info, rl_line_buffer_length/rl_len globals on update. ++ (David Carlier) ++ + - Standard: + . Fix references in request_parse_body() options array. (nielsdos) + . Add RoundingMode enum. (timwolla, saki) +diff --git a/ext/readline/readline.c b/ext/readline/readline.c +index fc36114745752..eca64f45b1586 100644 +--- a/ext/readline/readline.c ++++ b/ext/readline/readline.c +@@ -183,11 +183,24 @@ PHP_FUNCTION(readline_info) + if (zend_string_equals_literal_ci(what,"line_buffer")) { + oldstr = rl_line_buffer; + if (value) { +- /* XXX if (rl_line_buffer) free(rl_line_buffer); */ + if (!try_convert_to_string(value)) { + RETURN_THROWS(); + } +- rl_line_buffer = strdup(Z_STRVAL_P(value)); ++#ifndef PHP_WIN32 ++ if (strlen(oldstr) < Z_STRLEN_P(value)) { ++ rl_extend_line_buffer(Z_STRLEN_P(value) + 1); ++ } ++ memcpy(rl_line_buffer, Z_STRVAL_P(value), Z_STRLEN_P(value) + 1); ++ rl_end = Z_STRLEN_P(value); ++#else ++ char *tmp = strdup(Z_STRVAL_P(value)); ++ if (tmp) { ++ if (rl_line_buffer) { ++ free(rl_line_buffer); ++ } ++ rl_line_buffer = tmp; ++ } ++#endif + } + RETVAL_STRING(SAFE_STRING(oldstr)); + } else if (zend_string_equals_literal_ci(what, "point")) { -- cgit