Skip to content

php8: the PHP8 compilation options are only saved if PHP8 is also built#28288

Merged
mhei merged 2 commits intoopenwrt:masterfrom
TDT-AG:pr/20260108-php8
Jan 11, 2026
Merged

php8: the PHP8 compilation options are only saved if PHP8 is also built#28288
mhei merged 2 commits intoopenwrt:masterfrom
TDT-AG:pr/20260108-php8

Conversation

@feckert
Copy link
Member

@feckert feckert commented Jan 8, 2026

📦 Package Details

Maintainer: @neheb @danielfdickinson

Description:
Even if PHP8 has not been selected for building, the default PHP compile option is stored in '.config'.

# CONFIG_PACKAGE_php8 is not set
CONFIG_PHP8_LIBXML=y
CONFIG_PHP8_DOM=y
CONFIG_PHP8_GETTEXT=y
CONFIG_PHP8_INTL=y
# CONFIG_PHP8_FULLICUDATA is not set
# end of PHP8

That's not what I would expect. Therefore, a dependency is added that checks whether the php8 package has also been selected for building. With this change, the PHP8 compile options are only saved if they have also been selected for building. Additional, the whole thing was also moved to a 'Config.in' file to improve clarity.

This change requires the zabbix-server-frontend to be adjusted as well. Otherwise, I get the following output when calling make menuconf.

tmp/.config-package.in:33478:error: recursive dependency detected!
tmp/.config-package.in:33478:   symbol PACKAGE_php8 is selected by PACKAGE_zabbix-server-frontend
tmp/.config-package.in:1681:    symbol PACKAGE_zabbix-server-frontend depends on PHP8_DOM
tmp/.config-package.in:33502:   symbol PHP8_DOM depends on PACKAGE_php8
For a resolution refer to Documentation/kbuild/kconfig-language.rst

The zabbix-server-frotend can now only be selected if PACKAGE_php8 is enabled for building.


🧪 Run Testing Details

  • OpenWrt Version: no
  • OpenWrt Target/Subtarget: no
  • OpenWrt Device: no

✅ Formalities

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

@feckert feckert force-pushed the pr/20260108-php8 branch 2 times, most recently from 2d876bc to a2db341 Compare January 8, 2026 09:07
The php8 Makefile is already quite large. To improve readability, move
config section to a separate 'Config.in' file. To ensure that the PHP8
option is only saved in '.config' if PHP8 has been selected for building. A
depends on 'PACKAGE_php8' is added to the configuration option in the
'Config.in' file.

Signed-off-by: Florian Eckert <fe@dev.tdt.de>
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR addresses an issue where PHP8 compilation options were being saved to .config even when PHP8 itself was not selected for building. The fix introduces a dependency constraint to ensure PHP8 configuration options are only displayed when the php8 package is selected.

Key changes:

  • Moved PHP8 configuration options from inline Makefile definition to a separate Config.in file
  • Added depends on PACKAGE_php8 constraint to the configuration menu
  • Updated zabbix-server-frontend dependency to prevent recursive dependency issues

Reviewed changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated 1 comment.

File Description
lang/php8/Makefile Bumped PKG_RELEASE and replaced inline config with source reference to Config.in
lang/php8/Config.in New file containing PHP8 configuration options with PACKAGE_php8 dependency constraint
admin/zabbix/Makefile Bumped PKG_RELEASE and changed php8 dependency syntax to resolve recursive dependency

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Only show zabbix-server-frontend if the build dependency 'PACKEGE_php8' is
fulfilled. This means that 'zabbix-server-frotend' can only be selected if
PHP has also been enabled for building.

This change is needed to fix the following recursive dependency warning.

error: recursive dependency detected!
   symbol PACKAGE_php8 is selected by PACKAGE_zabbix-server-frontend
   symbol PACKAGE_zabbix-server-frontend depends on PHP8_DOM
   symbol PHP8_DOM depends on PACKAGE_php8
For a resolution refer to Documentation/kbuild/kconfig-language.rst

Signed-off-by: Florian Eckert <fe@dev.tdt.de>
@danielfdickinson
Copy link
Contributor

@feckert Thank you for this. LGTM on the Zabbix update.

Note that PHP8 maintainer is @mhei not neheb.

I had forgotten about the Kconfig menu/endmenu construct. That will be useful.

@feckert
Copy link
Member Author

feckert commented Jan 9, 2026

Note that PHP8 maintainer is @mhei not neheb.

Ups you are right.

@feckert feckert requested a review from mhei January 9, 2026 08:09
@mhei
Copy link
Member

mhei commented Jan 10, 2026

I also was not aware (anymore) that we can add a depends to a menu, thanks @feckert .
Although I'm not really a fan of pushing the configuration options into "countless" sub-levels, it improves readability and also aligns with other config parts, eg. Perl and Golang, so this is fine with me.
Since this PR conflicts a little bit with #28234 but @danielfdickinson signaled that the changes for zabbix are ok, I will merge this one here as is.
I'll comment on the other PR as well soon.

@mhei mhei merged commit dec74a7 into openwrt:master Jan 11, 2026
11 of 12 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants