Source: wikidiff2
Version: 1.14.2-1
Severity: important
Tags: ftbfs patch upstream
Control: block 1149581 by -1
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA512
Hi,
wikidiff2 fails to build with PHP 8.6, which is in experimental and
becomes the default in unstable with the php8.6 transition (#1149581):
src/php_wikidiff2.cpp: In function 'wikidiff2::Wikidiff2::Config
wikidiff2_get_config(int)':
src/php_wikidiff2.cpp:112:34: error: 'INI_FLT' was not declared in this scope
src/php_wikidiff2.cpp:114:32: error: 'INI_INT' was not declared in this scope
PHP 8.6 removed the INI_STR(), INI_INT(), INI_FLT() and INI_BOOL() macros
and added zend_ini_{bool|long|double|str|string}_literal() in their place
(see UPGRADING.INTERNALS). src/php_wikidiff2.cpp uses the old ones in
seven places, lines 112 to 118.
The attached patch calls zend_ini_long_literal() and
zend_ini_double_literal(), and defines the two as INI_INT() and INI_FLT()
when the PHP headers do not have them, so the extension builds with
PHP 8.5 and older exactly as before.
I did not find a fix upstream: master (6b7288a) still uses INI_INT() and
INI_FLT() and Gerrit has no change for it. The patch applies to master
too; it has not been sent upstream yet.
With the patch, in an sbuild chroot with php8.6 8.6.0-3 and php-defaults
108~exp2 from experimental, the package builds, all 30 tests pass, and
the autopkgtest passes with php8.6-cli. The patched extension also builds
and passes its tests with PHP 8.2 to 8.5.
- -- System Information:
Debian Release: 13.8
APT prefers stable-updates
APT policy: (500, 'stable-updates'), (500, 'stable-security'), (500,
'stable-debug'), (500, 'proposed-updates'), (500, 'stable')
Architecture: amd64 (x86_64)
Foreign Architectures: i386
Kernel: Linux 6.12.117+deb13-amd64 (SMP w/12 CPU threads; PREEMPT)
Locale: LANG=en_IE.UTF-8, LC_CTYPE=en_IE.UTF-8 (charmap=UTF-8),
LANGUAGE=en_IE:en
Shell: /bin/sh linked to /usr/bin/dash
Init: systemd (via /run/systemd/system)
-----BEGIN PGP SIGNATURE-----
iQKTBAEBCgB9FiEEw2Gx4wKVQ+vGJel9g3Kkd++uWcIFAmsKoI5fFIAAAAAALgAo
aXNzdWVyLWZwckBub3RhdGlvbnMub3BlbnBncC5maWZ0aGhvcnNlbWFuLm5ldEMz
NjFCMUUzMDI5NTQzRUJDNjI1RTk3RDgzNzJBNDc3RUZBRTU5QzIACgkQg3Kkd++u
WcJoAw//RTTX2EzorBV6OoPtGk3sTdpoZWAmdZebHWXDl/sN6vGzg8ZfsJmocJmS
kVSi/KQtY5jGjuN1B2s9YIajdiSKysDD7lEMzgZ/5VxLAQle6VCaPec0lGQBG0NQ
5zBWX8CjAiEfBFtfUEB28VTD849Zy2qop5FPVzappe2EVwK13NUiGB8Hvm870ItC
33wXv6cHNVbqqGfDp4TuyWJVBv4Ezc4KgeIUSqEqx4RrhurNzFko1CLjwxAiB/P7
iTWq4lnjCUZEXyxejbYnt88Oy3KaUyNPOU+QT1MV3GrK/IWpjFThXGZr3HJgEEwZ
pxhVmPQHOxEAkAdkb9+0sgImMZwa7k1IvB0UvxIB3w7T72lXdxWZqMvayv3LtKBD
lc65vVKpFPXY01G7gc9EmvTf2F4LS2fWJ+H/C+qtfQCGIkEOhBbQKwv8+9cLhcG1
Pelj7JNEUmgFwW43bFaChelyzj1ojt8gkM/myIVnOhYBM1cC71g9EXGfLrezIith
2aj/ISXrb9RwXN1QutQidL/k2ZtWLOFs6mvK49zyHbmlRA/Sr9aPR9qN++AYdz62
VAzWI3zLc7p9dvAl7ViEXJbYweVvrgW+GLPxqfF83V/R+tPIp1cUHTVmSFYEUmnF
/sb5xwlLvo90sJSOOeOv5IVEM4wN4JUtI3dDib/dHJQk5hQdeZY=
=750w
-----END PGP SIGNATURE-----
Description: Replace INI_INT() and INI_FLT(), removed in PHP 8.6
PHP 8.6 removed the INI_STR(), INI_INT(), INI_FLT() and INI_BOOL() macros
and added zend_ini_{bool,long,double,str,string}_literal() instead (see
UPGRADING.INTERNALS), so the build fails with:
.
src/php_wikidiff2.cpp:112:34: error: 'INI_FLT' was not declared in this scope
src/php_wikidiff2.cpp:114:32: error: 'INI_INT' was not declared in this scope
.
Use zend_ini_long_literal() and zend_ini_double_literal(), and define them
in terms of the old macros when the PHP headers do not provide them
(PHP < 8.6), so that the extension still builds with PHP 8.2 to 8.5.
Author: Ondřej Surý <[email protected]>
Forwarded: no
Last-Update: 2026-11-28
---
This patch header follows DEP-3: http://dep.debian.net/deps/dep3/
--- a/src/php_wikidiff2.cpp
+++ b/src/php_wikidiff2.cpp
@@ -24,6 +24,15 @@
# error "PHP version 8.2 or later is required."
#endif
+/* PHP 8.6 removed INI_INT() and INI_FLT() in favour of
+ * zend_ini_long_literal() and zend_ini_double_literal() */
+#ifndef zend_ini_long_literal
+# define zend_ini_long_literal(name) INI_INT(name)
+#endif
+#ifndef zend_ini_double_literal
+# define zend_ini_double_literal(name) INI_FLT(name)
+#endif
+
#define COMPAT_RETURN_STRINGL(s, l) { RETURN_STRINGL(s, l); return; }
using wikidiff2::Wikidiff2;
@@ -109,13 +118,13 @@
{
Wikidiff2::Config config;
config.numContextLines = numContextLines;
- config.changeThreshold = INI_FLT("wikidiff2.change_threshold");
- config.movedLineThreshold = INI_FLT("wikidiff2.moved_line_threshold");
- config.maxMovedLines =
INI_INT("wikidiff2.moved_paragraph_detection_cutoff");
- config.maxWordLevelDiffComplexity =
INI_INT("wikidiff2.max_word_level_diff_complexity");
- config.maxSplitSize = INI_INT("wikidiff2.max_split_size");
- config.initialSplitThreshold =
INI_FLT("wikidiff2.initial_split_threshold");
- config.finalSplitThreshold = INI_FLT("wikidiff2.final_split_threshold");
+ config.changeThreshold =
zend_ini_double_literal("wikidiff2.change_threshold");
+ config.movedLineThreshold =
zend_ini_double_literal("wikidiff2.moved_line_threshold");
+ config.maxMovedLines =
zend_ini_long_literal("wikidiff2.moved_paragraph_detection_cutoff");
+ config.maxWordLevelDiffComplexity =
zend_ini_long_literal("wikidiff2.max_word_level_diff_complexity");
+ config.maxSplitSize = zend_ini_long_literal("wikidiff2.max_split_size");
+ config.initialSplitThreshold =
zend_ini_double_literal("wikidiff2.initial_split_threshold");
+ config.finalSplitThreshold =
zend_ini_double_literal("wikidiff2.final_split_threshold");
return config;
}