Script 'mail_helper' called by obssrc Hello community, here is the log from the commit of package php-APCu for openSUSE:Factory checked in at 2026-12-05 19:10:07 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Comparing /work/SRC/openSUSE:Factory/php-APCu (Old) and /work/SRC/openSUSE:Factory/.php-APCu.new.1340718 (New) ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "php-APCu" Sat Dec 5 19:10:07 2026 rev:11 rq:1403063 version:5.1.28 Changes: -------- --- /work/SRC/openSUSE:Factory/php-APCu/php-APCu.changes 2025-12-22 22:51:28.254539262 +0100 +++ /work/SRC/openSUSE:Factory/.php-APCu.new.1340718/php-APCu.changes 2026-12-05 19:11:50.497807849 +0100 @@ -1,0 +2,8 @@ +Mon Nov 30 18:56:13 UTC 2026 - Arjen de Korte <[email protected]> + +- Fix build with PHP 8.6 + + APCu-fix-build-with-PHP-8.6-1.patch + + APCu-fix-build-with-PHP-8.6-2.patch + + APCu-fix-build-with-PHP-8.6-3.patch + +------------------------------------------------------------------- New: ---- APCu-fix-build-with-PHP-8.6-1.patch APCu-fix-build-with-PHP-8.6-2.patch APCu-fix-build-with-PHP-8.6-3.patch ----------(New B)---------- New:- Fix build with PHP 8.6 + APCu-fix-build-with-PHP-8.6-1.patch + APCu-fix-build-with-PHP-8.6-2.patch New: + APCu-fix-build-with-PHP-8.6-1.patch + APCu-fix-build-with-PHP-8.6-2.patch + APCu-fix-build-with-PHP-8.6-3.patch New: + APCu-fix-build-with-PHP-8.6-2.patch + APCu-fix-build-with-PHP-8.6-3.patch ----------(New E)---------- ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Other differences: ------------------ ++++++ php-APCu.spec ++++++ --- /var/tmp/diff_new_pack.GM1aUt/_old 2026-12-05 19:11:51.715859215 +0100 +++ /var/tmp/diff_new_pack.GM1aUt/_new 2026-12-05 19:11:51.721859468 +0100 @@ -1,7 +1,7 @@ # # spec file for package php-APCu # -# Copyright (c) 2025 SUSE LLC and contributors +# Copyright (c) 2026 SUSE LLC and contributors # # All modifications and additions to the file contributed by third parties # remain the property of their copyright owners, unless otherwise agreed @@ -41,6 +41,12 @@ Source: https://pecl.php.net/get/%{pkg_sname}-%{version}.tgz Source1: apcu.ini Source2: php-%{pkg_name}-rpmlintrc +# PATCH-FIX-UPSTREAM - fix build against PHP 8.6 (EMPTY_SWITCH_DEFAULT_CASE removed) +Patch1: APCu-fix-build-with-PHP-8.6-1.patch +# PATCH-FIX-UPSTREAM - replace XtOffsetOf() with offsetof() for PHP 8.6 +Patch2: APCu-fix-build-with-PHP-8.6-2.patch +# PATCH-FIX-UPSTREAM - simplify console output helpers to macros over php_error_docref +Patch3: APCu-fix-build-with-PHP-8.6-3.patch BuildRequires: %{php_name}-devel >= 7.0 Requires: php(api) = %{php_core_api} Requires: php(zend-abi) = %{php_zend_api} @@ -53,7 +59,7 @@ caching in future versions of PHP. %prep -%setup -q -n %{pkg_sname}-%{version} +%autosetup -p1 -n %{pkg_sname}-%{version} %build export CFLAGS="%{optflags} -fvisibility=hidden" ++++++ APCu-fix-build-with-PHP-8.6-1.patch ++++++ >From d29e907791502af89a7996930f8dce5fd8efe4a1 Mon Sep 17 00:00:00 2001 From: Andy Postnikov <[email protected]> Date: Fri, 10 Apr 2026 02:28:52 +0200 Subject: [PATCH] Fix build against PHP 8.6 (EMPTY_SWITCH_DEFAULT_CASE removed) Replace EMPTY_SWITCH_DEFAULT_CASE() with ZEND_UNREACHABLE() in apc_persist.c and add a fallback definition for PHP < 8.0 in apc.h, matching php-src debug/release behavior. Co-Authored-By: Claude Opus 4.6 <[email protected]> --- apc.h | 10 +++++++ apc_persist.c | 6 ++-- 2 files changed, 14 insertions(+), 2 deletions(-) diff --git a/apc.h b/apc.h index 6e725d04..8bbe3971 100644 --- a/apc.h +++ b/apc.h @@ -67,6 +67,16 @@ #include "php.h" #include "main/php_streams.h" +/* ZEND_UNREACHABLE() was added in PHP 8.0. Provide fallback for PHP 7.x. + * Remove this block when APCu drops support for PHP < 8.0. */ +#if PHP_VERSION_ID < 80000 +# if ZEND_DEBUG +# define ZEND_UNREACHABLE() do {ZEND_ASSERT(0); ZEND_ASSUME(0);} while (0) +# else +# define ZEND_UNREACHABLE() ZEND_ASSUME(0) +# endif +#endif + /* console display functions */ PHP_APCU_API void apc_error(const char *format, ...) ZEND_ATTRIBUTE_FORMAT(printf, 1, 2); PHP_APCU_API void apc_warning(const char *format, ...) ZEND_ATTRIBUTE_FORMAT(printf, 1, 2); diff --git a/apc_persist.c b/apc_persist.c index e322b8d2..531695f3 100644 --- a/apc_persist.c +++ b/apc_persist.c @@ -244,7 +244,8 @@ static zend_bool apc_persist_calc_zval(apc_persist_context_t *ctxt, const zval * case IS_RESOURCE: apc_warning("Cannot store resources in apcu cache"); return 0; - EMPTY_SWITCH_DEFAULT_CASE() + default: + ZEND_UNREACHABLE(); } } @@ -450,7 +451,8 @@ static void apc_persist_copy_zval_impl(apc_persist_context_t *ctxt, zval *zv) { if (!ptr) ptr = apc_persist_copy_ref(ctxt, Z_REF_P(zv)); ZVAL_REF(zv, ptr); return; - EMPTY_SWITCH_DEFAULT_CASE() + default: + ZEND_UNREACHABLE(); } } ++++++ APCu-fix-build-with-PHP-8.6-2.patch ++++++ >From 95f9ab828f95c6ca5877e584ead109189d0cec61 Mon Sep 17 00:00:00 2001 From: Andy Postnikov <[email protected]> Date: Thu, 30 Apr 2026 20:43:38 +0200 Subject: [PATCH] Replace XtOffsetOf() with offsetof() for PHP 8.6 PHP 8.6 removed XtOffsetOf(), which was an alias for the standard C offsetof() macro. Replace all usages in apc_cache.h and apc_iterator with offsetof() directly. Ref: https://github.com/php/php-src/commit/7114314c5a96c362b95663f7e7c9184586721f58 --- apc_cache.h | 2 +- apc_iterator.c | 2 +- apc_iterator.h | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/apc_cache.h b/apc_cache.h index 36e81123..1db9b29c 100644 --- a/apc_cache.h +++ b/apc_cache.h @@ -295,7 +295,7 @@ static inline void apc_cache_runlock(apc_cache_t *cache) { } /* APC_ENTRY_SIZE takes into account the trailing key-string + terminating 0-byte */ -#define APC_ENTRY_SIZE(key_len) (ZEND_MM_ALIGNED_SIZE(XtOffsetOf(apc_cache_entry_t, key.val) + key_len + 1)) +#define APC_ENTRY_SIZE(key_len) (ZEND_MM_ALIGNED_SIZE(offsetof(apc_cache_entry_t, key.val) + key_len + 1)) /* ENTRYAT and ENTRYOF are used to convert between offsets and pointers to cache entries. * Both expect the presence of cache->header that points to the cache header in the diff --git a/apc_iterator.c b/apc_iterator.c index 535a9df7..cb7edc3b 100644 --- a/apc_iterator.c +++ b/apc_iterator.c @@ -548,7 +548,7 @@ int apc_iterator_init(int module_number) { apc_iterator_object_handlers.clone_obj = NULL; apc_iterator_object_handlers.free_obj = apc_iterator_free; - apc_iterator_object_handlers.offset = XtOffsetOf(apc_iterator_t, obj); + apc_iterator_object_handlers.offset = offsetof(apc_iterator_t, obj); return SUCCESS; } diff --git a/apc_iterator.h b/apc_iterator.h index d38a5a35..362dcb43 100644 --- a/apc_iterator.h +++ b/apc_iterator.h @@ -69,7 +69,7 @@ typedef struct _apc_iterator_t { zend_object obj; } apc_iterator_t; -#define apc_iterator_fetch_from(o) ((apc_iterator_t*)((char*)o - XtOffsetOf(apc_iterator_t, obj))) +#define apc_iterator_fetch_from(o) ((apc_iterator_t*)((char*)o - offsetof(apc_iterator_t, obj))) #define apc_iterator_fetch(z) apc_iterator_fetch_from(Z_OBJ_P(z)) typedef struct _apc_iterator_item_t { ++++++ APCu-fix-build-with-PHP-8.6-3.patch ++++++ >From 90899684be91c4f750512c2f840f487286ecb807 Mon Sep 17 00:00:00 2001 From: Andy Postnikov <[email protected]> Date: Sat, 25 Jul 2026 20:10:30 +0200 Subject: [PATCH] Simplify console output helpers to macros over php_error_docref Replace the APC_PRINT_FUNCTION macro that generated four exported apc_error/apc_warning/apc_notice/apc_debug functions with thin variadic macros in apc.h that forward directly to php_error_docref(), and drop the generator block from apc.c entirely. This also fixes the build against PHP 8.6-dev: php/php-src@0a12b3e8268 removed the params argument from php_verror(), which the old APC_PRINT_FUNCTION body called. Forwarding to php_error_docref() instead sidesteps php_verror() altogether and works on all supported versions. Co-Authored-By: Claude Opus 4.8 (1M context) <[email protected]> --- apc.c | 21 --------------------- apc.h | 14 ++++++++++---- 2 files changed, 10 insertions(+), 25 deletions(-) diff --git a/apc.c b/apc.c index e2d039ca..c6f4f16f 100644 --- a/apc.c +++ b/apc.c @@ -34,27 +34,6 @@ #include "apc_globals.h" #include "php.h" -/* console display functions */ -#define APC_PRINT_FUNCTION(name, verbosity) \ - void apc_##name(const char *format, ...) \ - { \ - va_list args; \ - \ - va_start(args, format); \ - php_verror(NULL, "", verbosity, format, args); \ - va_end(args); \ - } - -APC_PRINT_FUNCTION(error, E_ERROR) -APC_PRINT_FUNCTION(warning, E_WARNING) -APC_PRINT_FUNCTION(notice, E_NOTICE) - -#ifdef APC_DEBUG -APC_PRINT_FUNCTION(debug, E_NOTICE) -#else -void apc_debug(const char *format, ...) {} -#endif - HashTable* apc_flip_hash(HashTable *hash) { zval data, *entry; HashTable *new_hash; diff --git a/apc.h b/apc.h index 8bbe3971..cd9fa585 100644 --- a/apc.h +++ b/apc.h @@ -78,10 +78,16 @@ #endif /* console display functions */ -PHP_APCU_API void apc_error(const char *format, ...) ZEND_ATTRIBUTE_FORMAT(printf, 1, 2); -PHP_APCU_API void apc_warning(const char *format, ...) ZEND_ATTRIBUTE_FORMAT(printf, 1, 2); -PHP_APCU_API void apc_notice(const char *format, ...) ZEND_ATTRIBUTE_FORMAT(printf, 1, 2); -PHP_APCU_API void apc_debug(const char *format, ...) ZEND_ATTRIBUTE_FORMAT(printf, 1, 2); +#define apc_error(...) php_error_docref(NULL, E_ERROR, __VA_ARGS__) +#define apc_warning(...) php_error_docref(NULL, E_WARNING, __VA_ARGS__) +#define apc_notice(...) php_error_docref(NULL, E_NOTICE, __VA_ARGS__) + +#ifdef APC_DEBUG +# define apc_debug(...) php_error_docref(NULL, E_NOTICE, __VA_ARGS__) +#else +/* if (0) keeps compile-time format checking at zero runtime cost */ +# define apc_debug(...) do { if (0) php_error_docref(NULL, E_NOTICE, __VA_ARGS__); } while (0) +#endif /* apc_flip_hash flips keys and values for faster searching */ PHP_APCU_API HashTable* apc_flip_hash(HashTable *hash);
