Bug 295867 - archivers/php-zstd, brotli updates to 0.16.0 and 0.19.0
Summary: archivers/php-zstd, brotli updates to 0.16.0 and 0.19.0
Status: Closed FIXED
Alias: None
Product: Ports & Packages
Classification: Unclassified
Component: Individual Port(s) (show other bugs)
Version: Latest
Hardware: Any Any
: --- Affects Some People
Assignee: Vladimir Druzenko
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2026-06-05 06:34 UTC by Paavo-Einari Kaipila
Modified: 2026-06-13 03:24 UTC (History)
1 user (show)

See Also:
pkaipila: maintainer-feedback+


Attachments
0001-archivers-php-zstd-update-0.15.2-0.16.0.patch (1.38 KB, patch)
2026-06-05 06:34 UTC, Paavo-Einari Kaipila
no flags Details | Diff
0001-archivers-php-brotli-update-0.18.2-0.19.0-enable-APC.patch (1.82 KB, patch)
2026-06-05 06:35 UTC, Paavo-Einari Kaipila
no flags Details | Diff
0001-archivers-php-zstd-update-0.15.2-0.16.0.patch (1.95 KB, patch)
2026-06-06 22:15 UTC, Paavo-Einari Kaipila
no flags Details | Diff
0001-archivers-php-brotli-update-0.18.2-0.19.0-enable-APC.patch (2.10 KB, patch)
2026-06-06 22:15 UTC, Paavo-Einari Kaipila
no flags Details | Diff
0001-archivers-php-lz4-don-t-grab-apc_serializer.h-if-it-.patch (1.15 KB, patch)
2026-06-06 22:16 UTC, Paavo-Einari Kaipila
no flags Details | Diff
0001-archivers-php-zstd-update-0.15.2-0.16.0.patch (2.06 KB, patch)
2026-06-07 01:37 UTC, Paavo-Einari Kaipila
no flags Details | Diff
0002-archivers-php-brotli-update-0.18.2-0.19.0-enable-APC.patch (2.94 KB, patch)
2026-06-07 01:37 UTC, Paavo-Einari Kaipila
no flags Details | Diff
0003-archivers-php-lz4-always-build-with-APCu-support-it.patch (1.27 KB, patch)
2026-06-07 01:38 UTC, Paavo-Einari Kaipila
no flags Details | Diff
0001-archivers-php-zstd-update-0.15.2-0.16.0.patch (3.37 KB, patch)
2026-06-08 11:27 UTC, Paavo-Einari Kaipila
no flags Details | Diff
0002-archivers-php-brotli-update-0.18.2-0.19.0.patch (4.89 KB, patch)
2026-06-08 11:27 UTC, Paavo-Einari Kaipila
no flags Details | Diff
0003-archivers-php-lz4-patch-config.m4-to-always-honor-AP.patch (2.59 KB, patch)
2026-06-08 11:28 UTC, Paavo-Einari Kaipila
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Paavo-Einari Kaipila 2026-06-05 06:34:58 UTC
Created attachment 271505 [details]
0001-archivers-php-zstd-update-0.15.2-0.16.0.patch

https://github.com/kjdev/php-ext-zstd/releases/tag/0.16.0
https://github.com/kjdev/php-ext-brotli/releases/tag/0.19.0
Comment 1 Paavo-Einari Kaipila 2026-06-05 06:35:38 UTC
Created attachment 271506 [details]
0001-archivers-php-brotli-update-0.18.2-0.19.0-enable-APC.patch
Comment 2 Vladimir Druzenko freebsd_committer freebsd_triage 2026-06-06 13:00:41 UTC
Prevent silent grab of ${LOCALBASE}/include/php/ext/apcu/apc_serializer.h if devel/pecl-APCu@${PHP_FLAVOR} installed, but option APCU disabled:

archivers/php-zstd/files/patch-config.m4:
--- config.m4.orig      2026-06-05 04:23:54 UTC
+++ config.m4
@@ -104,6 +104,11 @@ fi
   ])
 fi

+
+PHP_ARG_ENABLE(apcu, whether to enable APCu support,
+[  --enable-apcu           Enable APCu support], no, no)
+
+if test "$PHP_APCU" != "no"; then
 dnl APCu
 AC_MSG_CHECKING([for APCu includes])
 if test -f "$phpincludedir/ext/apcu/apc_serializer.h"; then
@@ -112,6 +117,7 @@ else
   AC_DEFINE(HAVE_APCU_SUPPORT, 1, [Whether to enable APCu support])
 else
   AC_MSG_RESULT([not found])
+fi
 fi

 dnl coverage

archivers/php-brotli/files/patch-config.m4:
--- config.m4.orig      2026-06-05 04:27:29 UTC
+++ config.m4
@@ -132,6 +132,10 @@ if test "$PHP_BROTLI" != "no"; then
     PHP_ADD_BUILD_DIR($ext_builddir/brotli/c/enc)
   fi

+  PHP_ARG_ENABLE(apcu, whether to enable APCu support,
+  [  --enable-apcu           Enable APCu support], no, no)
+
+  if test "$PHP_APCU" != "no"; then
   AC_MSG_CHECKING([for APCu includes])
   if test -f "$phpincludedir/ext/apcu/apc_serializer.h"; then
     apc_inc_path="$phpincludedir"
@@ -139,5 +143,6 @@ if test "$PHP_BROTLI" != "no"; then
     AC_DEFINE(HAVE_APCU_SUPPORT, 1, [Whether to enable APCu support])
   else
     AC_MSG_RESULT([not found])
+  fi
   fi
 fi

Also in Makefiles:
+APCU_CONFIGURE_ENABLE=  apcu
Comment 3 Paavo-Einari Kaipila 2026-06-06 13:33:52 UTC
How about?

.include <bsd.port.pre.mk>
post-patch:
.if !${PORT_OPTIONS:MAPCU}
        @${REINPLACE_CMD} -e 's|apc_serializer|doesnotexist|' ${WRKSRC}/config.m4
.endif
.include <bsd.port.post.mk>


No need for a patch file to keep updated.

Same thing applies to php-lz4 btw...
Comment 4 Vladimir Druzenko freebsd_committer freebsd_triage 2026-06-06 20:01:59 UTC
(In reply to Paavo-Einari Kaipila from comment #3)
So you "broke" file search:
> if test -f "$phpincludedir/ext/apcu/apc_serializer.h"; then
Heh. Nice hack. :-D
But my patch is upstreamuble.
Comment 5 Paavo-Einari Kaipila 2026-06-06 22:14:35 UTC
Upstreaming it could break other people's build pipelines as it would change existing behaviour from "build with APCu if it happens to be there" to "build with APCu is requested". I will, however make upstream aware of this, since I am actually already a contributor in these and planning to contribute more in a near future.
Comment 6 Paavo-Einari Kaipila 2026-06-06 22:15:12 UTC
Created attachment 271562 [details]
0001-archivers-php-zstd-update-0.15.2-0.16.0.patch
Comment 7 Paavo-Einari Kaipila 2026-06-06 22:15:40 UTC
Created attachment 271563 [details]
0001-archivers-php-brotli-update-0.18.2-0.19.0-enable-APC.patch
Comment 8 Paavo-Einari Kaipila 2026-06-06 22:16:04 UTC
Created attachment 271564 [details]
0001-archivers-php-lz4-don-t-grab-apc_serializer.h-if-it-.patch
Comment 9 Vladimir Druzenko freebsd_committer freebsd_triage 2026-06-06 23:30:18 UTC
(In reply to Paavo-Einari Kaipila from comment #5)
We just need to make this option enabled by default. For example, reverse it.
Comment 10 Vladimir Druzenko freebsd_committer freebsd_triage 2026-06-06 23:48:22 UTC
--- config.m4.orig      2026-06-05 04:23:54 UTC
+++ config.m4
@@ -104,6 +104,11 @@ fi
   ])
 fi

+
+PHP_ARG_ENABLE(apcu, whether to enable APCu support,
+[  --enable-apcu           Enable APCu support], yes, no)
+
+if test "$PHP_APCU" != "no"; then
 dnl APCu
 AC_MSG_CHECKING([for APCu includes])
 if test -f "$phpincludedir/ext/apcu/apc_serializer.h"; then
@@ -112,6 +117,7 @@ else
   AC_DEFINE(HAVE_APCU_SUPPORT, 1, [Whether to enable APCu support])
 else
   AC_MSG_RESULT([not found])
+fi
 fi

 dnl coverage
Comment 11 Paavo-Einari Kaipila 2026-06-07 00:05:51 UTC
(In reply to Vladimir Druzenko from comment #9)

But that would still break other people's existing setups. Having it off by default could lead to a situation, where someone will accidentally loose APCu support if they don't notice the change. And having it on should then cause a configure fail if the header isn't there, another headache for others with existing build pipelines.
Comment 12 Paavo-Einari Kaipila 2026-06-07 01:37:04 UTC
Created attachment 271573 [details]
0001-archivers-php-zstd-update-0.15.2-0.16.0.patch
Comment 13 Paavo-Einari Kaipila 2026-06-07 01:37:33 UTC
Created attachment 271574 [details]
0002-archivers-php-brotli-update-0.18.2-0.19.0-enable-APC.patch
Comment 14 Paavo-Einari Kaipila 2026-06-07 01:38:19 UTC
Created attachment 271575 [details]
0003-archivers-php-lz4-always-build-with-APCu-support-it.patch
Comment 15 Paavo-Einari Kaipila 2026-06-07 01:40:12 UTC
There, problem solved. No need for patches or backwards-breaking upstream changes.
Comment 16 Paavo-Einari Kaipila 2026-06-08 09:14:46 UTC
I actually came up with an upstreamable version of your patch.

https://github.com/kjdev/php-ext-zstd/pull/99

New set of patches coming later today for all three of these.
Comment 17 Paavo-Einari Kaipila 2026-06-08 11:27:08 UTC
Created attachment 271614 [details]
0001-archivers-php-zstd-update-0.15.2-0.16.0.patch
Comment 18 Paavo-Einari Kaipila 2026-06-08 11:27:39 UTC
Created attachment 271615 [details]
0002-archivers-php-brotli-update-0.18.2-0.19.0.patch
Comment 19 Paavo-Einari Kaipila 2026-06-08 11:28:16 UTC
Created attachment 271616 [details]
0003-archivers-php-lz4-patch-config.m4-to-always-honor-AP.patch
Comment 20 commit-hook freebsd_committer freebsd_triage 2026-06-08 19:32:25 UTC
A commit in branch main references this bug:

URL: https://cgit.FreeBSD.org/ports/commit/?id=91b1d1c5359af6cf62953344d24b4f5ac1ac411e

commit 91b1d1c5359af6cf62953344d24b4f5ac1ac411e
Author:     Paavo-Einari Kaipila <pkaipila@gmail.com>
AuthorDate: 2026-06-08 19:30:33 +0000
Commit:     Vladimir Druzenko <vvd@FreeBSD.org>
CommitDate: 2026-06-08 19:31:48 +0000

    archivers/php-lz4: Patch config.m4 to always honor APCU setting

    PR:             295867
    Sponsored by:   UNIS Labs
    Co-authored-by: Vladimir Druzenko <vvd@FreeBSD.org>

 archivers/php-lz4/Makefile                    |  2 ++
 archivers/php-lz4/files/patch-config.m4 (new) | 38 +++++++++++++++++++++++++++
 2 files changed, 40 insertions(+)
Comment 21 commit-hook freebsd_committer freebsd_triage 2026-06-08 19:32:26 UTC
A commit in branch main references this bug:

URL: https://cgit.FreeBSD.org/ports/commit/?id=9f79d999cc78f4ad5eba8c5cd534a3c85ea0ecf2

commit 9f79d999cc78f4ad5eba8c5cd534a3c85ea0ecf2
Author:     Paavo-Einari Kaipila <pkaipila@gmail.com>
AuthorDate: 2026-06-08 19:27:48 +0000
Commit:     Vladimir Druzenko <vvd@FreeBSD.org>
CommitDate: 2026-06-08 19:31:47 +0000

    archivers/php-brotli: Update 0.18.2 => 0.19.0

    Changelog:
    https://github.com/kjdev/php-ext-brotli/releases/tag/0.19.0

    Commit log:
    https://github.com/kjdev/php-ext-brotli/compare/0.18.2...0.19.0

    Enable APCu cache compression and patch config.m4 to always honor
    APCU setting.

    PR:             295867
    Sponsored by:   UNIS Labs
    Co-authored-by: Vladimir Druzenko <vvd@FreeBSD.org>

 archivers/php-brotli/Makefile                    | 11 +++++--
 archivers/php-brotli/distinfo                    |  6 ++--
 archivers/php-brotli/files/patch-config.m4 (new) | 37 ++++++++++++++++++++++++
 archivers/php-brotli/pkg-descr                   | 14 +++++----
 4 files changed, 57 insertions(+), 11 deletions(-)
Comment 22 commit-hook freebsd_committer freebsd_triage 2026-06-08 19:32:27 UTC
A commit in branch main references this bug:

URL: https://cgit.FreeBSD.org/ports/commit/?id=e5a35b56c2236596c728276135e5d07ee8449b10

commit e5a35b56c2236596c728276135e5d07ee8449b10
Author:     Paavo-Einari Kaipila <pkaipila@gmail.com>
AuthorDate: 2026-06-08 19:29:23 +0000
Commit:     Vladimir Druzenko <vvd@FreeBSD.org>
CommitDate: 2026-06-08 19:31:48 +0000

    archivers/php-zstd: Update 0.15.2 => 0.16.0

    Changelog:
    https://github.com/kjdev/php-ext-zstd/releases/tag/0.16.0

    Commit log:
    https://github.com/kjdev/php-ext-zstd/compare/0.15.2...0.16.0

    Patch config.m4 to always honor APCU setting.

    PR:             295867
    Sponsored by:   UNIS Labs
    Co-authored-by: Vladimir Druzenko <vvd@FreeBSD.org>

 archivers/php-zstd/Makefile                    |  4 +--
 archivers/php-zstd/distinfo                    |  6 ++--
 archivers/php-zstd/files/patch-config.m4 (new) | 38 ++++++++++++++++++++++++++
 3 files changed, 43 insertions(+), 5 deletions(-)
Comment 23 Vladimir Druzenko freebsd_committer freebsd_triage 2026-06-08 19:33:27 UTC
Thanks.
Comment 24 Paavo-Einari Kaipila 2026-06-13 03:24:43 UTC
thanks again