Skip to content

php8: fix missing dependency with gettext#28075

Merged
mhei merged 3 commits intoopenwrt:masterfrom
danielfdickinson:fix-php8-missing-dep-on-libstdcpp
Dec 15, 2025
Merged

php8: fix missing dependency with gettext#28075
mhei merged 3 commits intoopenwrt:masterfrom
danielfdickinson:fix-php8-missing-dep-on-libstdcpp

Conversation

@danielfdickinson
Copy link
Contributor

@danielfdickinson danielfdickinson commented Dec 13, 2025

📦 Package Details

Maintainer: @mhei

Description:

Some binaries gain a dependency on libstdcpp when mod-gettext is included
in the build, however this was not explicitly declared, so packaging
fails with (e.g.):

Package php8-cgi is missing dependencies for the following libraries:
libstdc++.so.6

EDIT for revised PR:

Updated commits (per #28078) fix this by:

  • Make use of --with-gettext depend on a configure flag (enabled by
    default, since that matches current full build behaviour)
  • Make sub-packages which require --with-gettext depend on the
    configure flag

This means that e.g. php-cgi would not have gettext support if the
configure flag was disabled, and e.g. php-mod-gettext and php-mod-intl
would not be selectable.

Similarly for LIBXML:

PHP8_LIBXML and PHP8_DOM are are enabled by default and packages
which depend on libxml2 and --enable-dom=shared are not shown (and
the related configure args are disabled) if the config options are
not enabled.


🧪 Run Testing Details

Self-built snapshot of master as of Dec 13 (main repo commit: 24b8db118b) as packages are out of date for aarch64_cortex-a76.

  • OpenWrt Version: r32307-24b8db118b
  • OpenWrt Target/Subtarget: bcm27xx/bcm2712
  • OpenWrt Device: raspberrypi,5-model-b
  • Board Profile: rpi-5
  1. Built SDK and ImageBuilder
  2. In the SDK built php8, Zabbix, and dependencies and packages for image
  3. Used ImageBuilder to create squashfs images ('factory' and 'sysupgrade')
  4. Created an image with the packages built above
  5. Observed Zabbix frontend operates correctly (it depends on php8-cgi and apache-mod-php8
    which depend on php8-mod-gettext).

✅ Formalities

  • I have reviewed the CONTRIBUTING.md file for detailed contributing guidelines.

If your PR contains a patch:

  • It can be applied using git am
  • It has been refreshed to avoid offsets, fuzzes, etc., using
    make package/<your-package>/refresh V=s
  • It is structured in a way that it is potentially upstreamable
    (e.g., subject line, commit description, etc.)
    We must try to upstream patches to reduce maintenance burden.

@danielfdickinson danielfdickinson changed the title php8: add missing dependency for gettext binaries php8: add missing dependency with gettext in build Dec 13, 2025
@danielfdickinson danielfdickinson changed the title php8: add missing dependency with gettext in build php8: add missing dependency with gettext Dec 13, 2025
@danielfdickinson
Copy link
Contributor Author

I have corrected the PR description and am working on testing @GeorgeSapkin's suggestion and fixing the commit message.

@danielfdickinson danielfdickinson force-pushed the fix-php8-missing-dep-on-libstdcpp branch from 4cf0f71 to 6ab377b Compare December 13, 2025 23:32
@mhei
Copy link
Member

mhei commented Dec 14, 2025

I cannot reproduce with a full build, but will retry with SDK as you described.

@danielfdickinson
Copy link
Contributor Author

@mhei Thank you for looking at this. It occurs to me this can only occur when building a subset of php8 modules as if one builds php-mod-intl the bug cannot trigger. Here is a config snippet where the issue does occur without this change:

#
# PHP8
#
CONFIG_PACKAGE_php8=m
CONFIG_PHP8_LIBXML=y
CONFIG_PHP8_SYSTEMTZDATA=y
CONFIG_PACKAGE_php8-cgi=m
# CONFIG_PACKAGE_php8-cli is not set
CONFIG_PACKAGE_php8-fastcgi=m
CONFIG_PACKAGE_php8-fpm=m
CONFIG_PACKAGE_php8-mod-bcmath=m
# CONFIG_PACKAGE_php8-mod-calendar is not set
CONFIG_PACKAGE_php8-mod-ctype=m
# CONFIG_PACKAGE_php8-mod-curl is not set
CONFIG_PACKAGE_php8-mod-dom=m
# CONFIG_PACKAGE_php8-mod-exif is not set
# CONFIG_PACKAGE_php8-mod-fileinfo is not set
CONFIG_PACKAGE_php8-mod-filter=m
# CONFIG_PACKAGE_php8-mod-ftp is not set
CONFIG_PACKAGE_php8-mod-gd=m
CONFIG_PACKAGE_php8-mod-gettext=m
# CONFIG_PACKAGE_php8-mod-gmp is not set
# CONFIG_PACKAGE_php8-mod-iconv is not set
# CONFIG_PACKAGE_php8-mod-intl is not set
# CONFIG_PACKAGE_php8-mod-ldap is not set
CONFIG_PACKAGE_php8-mod-mbstring=m
# CONFIG_PACKAGE_php8-mod-mysqli is not set
# CONFIG_PACKAGE_php8-mod-mysqlnd is not set
# CONFIG_PACKAGE_php8-mod-opcache is not set
CONFIG_PACKAGE_php8-mod-openssl=m
# CONFIG_PACKAGE_php8-mod-pcntl is not set
# CONFIG_PACKAGE_php8-mod-pdo is not set
# CONFIG_PACKAGE_php8-mod-pdo-mysql is not set
# CONFIG_PACKAGE_php8-mod-pdo-pgsql is not set
# CONFIG_PACKAGE_php8-mod-pdo-sqlite is not set
CONFIG_PACKAGE_php8-mod-pgsql=m
# CONFIG_PACKAGE_php8-mod-phar is not set
CONFIG_PACKAGE_php8-mod-session=m
# CONFIG_PACKAGE_php8-mod-shmop is not set
# CONFIG_PACKAGE_php8-mod-simplexml is not set
# CONFIG_PACKAGE_php8-mod-snmp is not set
# CONFIG_PACKAGE_php8-mod-soap is not set
CONFIG_PACKAGE_php8-mod-sockets=m
# CONFIG_PACKAGE_php8-mod-sodium is not set
# CONFIG_PACKAGE_php8-mod-sqlite3 is not set
# CONFIG_PACKAGE_php8-mod-sysvmsg is not set
# CONFIG_PACKAGE_php8-mod-sysvsem is not set
# CONFIG_PACKAGE_php8-mod-sysvshm is not set
# CONFIG_PACKAGE_php8-mod-tokenizer is not set
# CONFIG_PACKAGE_php8-mod-xml is not set
# CONFIG_PACKAGE_php8-mod-xmlreader is not set
# CONFIG_PACKAGE_php8-mod-xmlwriter is not set
# CONFIG_PACKAGE_php8-mod-zip is not set
# CONFIG_PACKAGE_php8-pecl-dio is not set
# CONFIG_PACKAGE_php8-pecl-http is not set
# CONFIG_PACKAGE_php8-pecl-imagick is not set
# CONFIG_PACKAGE_php8-pecl-krb5 is not set
# CONFIG_PACKAGE_php8-pecl-raphf is not set
# CONFIG_PACKAGE_php8-pecl-redis is not set
# CONFIG_PACKAGE_php8-pecl-xdebug is not set
# end of PHP8

@danielfdickinson
Copy link
Contributor Author

danielfdickinson commented Dec 14, 2025

This looks like a policy issue regarding how CONFIGURE_VARS are modified in a global way depending on specific module selection. Therefore opening an issue to properly discuss.

Fixes: php8: global package dependency changes based on module
selection

Fixes: openwrt#28078

As described in openwrt#28078 and openwrt#28075,

Some binaries gain a dependency on libstdcpp when mod-gettext is included
in the build, however this was not explicitly declared, so packaging
fails with (e.g.):

Package php8-cgi is missing dependencies for the following libraries:
libstdc++.so.6

In contrast to openwrt#28075, this commit takes the approach:

* Make use of --with-gettext depend on a configure flag (enabled by
  default, since that matches current full build behaviour)
* Make sub-packages which require --with-gettext depend on the
  configure flag

This means that e.g. php-cgi would not have gettext support if the
configure flag was disabled, and e.g. php-mod-gettext and php-mod-intl
would not be selectable.

Signed-off-by: Daniel F. Dickinson <dfdpublic@wildtechgarden.ca>
As with gettext modules described in openwrt#28078 and openwrt#28075, xml and dom
related module selection affects the dependencies of other packages.

Therefore, we invert the dependency logic:

PHP8_LIBXML and PHP8_DOM are are enabled by default and packages
which depend on libxml2 and --enable-dom=shared are not shown (and
the related configure args are disabled) if the config options are
not enabled.

Signed-off-by: Daniel F. Dickinson <dfdpublic@wildtechgarden.ca>
@danielfdickinson danielfdickinson force-pushed the fix-php8-missing-dep-on-libstdcpp branch from 6ab377b to 69b8764 Compare December 15, 2025 01:31
@danielfdickinson danielfdickinson changed the title php8: add missing dependency with gettext php8: fix missing dependency with gettext Dec 15, 2025
Bump PKG_RELEASE for previous two commits

Signed-off-by: Daniel F. Dickinson <dfdpublic@wildtechgarden.ca>
@danielfdickinson danielfdickinson force-pushed the fix-php8-missing-dep-on-libstdcpp branch from 69b8764 to a8984ce Compare December 15, 2025 01:41
@mhei mhei merged commit aa1acc0 into openwrt:master Dec 15, 2025
11 of 12 checks passed
mhei pushed a commit that referenced this pull request Dec 15, 2025
Fixes: php8: global package dependency changes based on module
selection

Fixes: #28078

As described in #28078 and #28075,

Some binaries gain a dependency on libstdcpp when mod-gettext is included
in the build, however this was not explicitly declared, so packaging
fails with (e.g.):

Package php8-cgi is missing dependencies for the following libraries:
libstdc++.so.6

In contrast to #28075, this commit takes the approach:

* Make use of --with-gettext depend on a configure flag (enabled by
  default, since that matches current full build behaviour)
* Make sub-packages which require --with-gettext depend on the
  configure flag

This means that e.g. php-cgi would not have gettext support if the
configure flag was disabled, and e.g. php-mod-gettext and php-mod-intl
would not be selectable.

Signed-off-by: Daniel F. Dickinson <dfdpublic@wildtechgarden.ca>
mhei pushed a commit that referenced this pull request Dec 15, 2025
As with gettext modules described in #28078 and #28075, xml and dom
related module selection affects the dependencies of other packages.

Therefore, we invert the dependency logic:

PHP8_LIBXML and PHP8_DOM are are enabled by default and packages
which depend on libxml2 and --enable-dom=shared are not shown (and
the related configure args are disabled) if the config options are
not enabled.

Signed-off-by: Daniel F. Dickinson <dfdpublic@wildtechgarden.ca>
@danielfdickinson danielfdickinson deleted the fix-php8-missing-dep-on-libstdcpp branch December 15, 2025 07:42
mhei pushed a commit to mhei/packages that referenced this pull request Dec 23, 2025
Fixes: php8: global package dependency changes based on module
selection

Fixes: openwrt#28078

As described in openwrt#28078 and openwrt#28075,

Some binaries gain a dependency on libstdcpp when mod-gettext is included
in the build, however this was not explicitly declared, so packaging
fails with (e.g.):

Package php8-cgi is missing dependencies for the following libraries:
libstdc++.so.6

In contrast to openwrt#28075, this commit takes the approach:

* Make use of --with-gettext depend on a configure flag (enabled by
  default, since that matches current full build behaviour)
* Make sub-packages which require --with-gettext depend on the
  configure flag

This means that e.g. php-cgi would not have gettext support if the
configure flag was disabled, and e.g. php-mod-gettext and php-mod-intl
would not be selectable.

Signed-off-by: Daniel F. Dickinson <dfdpublic@wildtechgarden.ca>
(cherry picked from commit 6d6233b)
mhei pushed a commit to mhei/packages that referenced this pull request Dec 23, 2025
As with gettext modules described in openwrt#28078 and openwrt#28075, xml and dom
related module selection affects the dependencies of other packages.

Therefore, we invert the dependency logic:

PHP8_LIBXML and PHP8_DOM are are enabled by default and packages
which depend on libxml2 and --enable-dom=shared are not shown (and
the related configure args are disabled) if the config options are
not enabled.

Signed-off-by: Daniel F. Dickinson <dfdpublic@wildtechgarden.ca>
(cherry picked from commit f9591b8)
mhei pushed a commit that referenced this pull request Dec 24, 2025
Fixes: php8: global package dependency changes based on module
selection

Fixes: #28078

As described in #28078 and #28075,

Some binaries gain a dependency on libstdcpp when mod-gettext is included
in the build, however this was not explicitly declared, so packaging
fails with (e.g.):

Package php8-cgi is missing dependencies for the following libraries:
libstdc++.so.6

In contrast to #28075, this commit takes the approach:

* Make use of --with-gettext depend on a configure flag (enabled by
  default, since that matches current full build behaviour)
* Make sub-packages which require --with-gettext depend on the
  configure flag

This means that e.g. php-cgi would not have gettext support if the
configure flag was disabled, and e.g. php-mod-gettext and php-mod-intl
would not be selectable.

Signed-off-by: Daniel F. Dickinson <dfdpublic@wildtechgarden.ca>
(cherry picked from commit 6d6233b)
mhei pushed a commit that referenced this pull request Dec 24, 2025
As with gettext modules described in #28078 and #28075, xml and dom
related module selection affects the dependencies of other packages.

Therefore, we invert the dependency logic:

PHP8_LIBXML and PHP8_DOM are are enabled by default and packages
which depend on libxml2 and --enable-dom=shared are not shown (and
the related configure args are disabled) if the config options are
not enabled.

Signed-off-by: Daniel F. Dickinson <dfdpublic@wildtechgarden.ca>
(cherry picked from commit f9591b8)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants