diff options
| author | Hongxu Jia <hongxu.jia@windriver.com> | 2025-11-18 17:28:14 +0800 |
|---|---|---|
| committer | Khem Raj <raj.khem@gmail.com> | 2025-11-18 08:23:47 -0800 |
| commit | 6d835df9206902300b4b4a5010b171452ab3bb6e (patch) | |
| tree | 69e8ab42d27f90e89b518068b15007c8669a80a2 | |
| parent | 986fd73afbd8dcae03c141203eae0c51089c6b08 (diff) | |
| download | meta-openembedded-6d835df9206902300b4b4a5010b171452ab3bb6e.tar.gz | |
php: remove php-phar to support reproducible build
According to [1][2], generate phar.php during cross-compile can't be
done, but upstream test res of $(TEST_PHP_EXECUTABLE) is not suitable
for Yocto.
Explicitly set TEST_PHP_EXECUTABLE_RES = "1" to not generate phar.php
for target recipe
Drop 0005-sapi-cli-config.m4-fix-build-directory.patch which is obsolete
for generating phar.php
After apply this commit
...log.do_compile...
Generating phar.php
Skipping phar.php generating during cross compilation
Generating phar.phar
Skipping phar.phar generating during cross compilation
...log.do_compile...
Then php supports reproducible build
[1] https://github.com/php/php-src/issues/11099
[2] https://github.com/php/php-src/commit/93fa9613e162d1a0e8479ba83c4b6a399846e209
Signed-off-by: Hongxu Jia <hongxu.jia@windriver.com>
Signed-off-by: Khem Raj <raj.khem@gmail.com>
4 files changed, 37 insertions, 40 deletions
diff --git a/meta-oe/conf/layer.conf b/meta-oe/conf/layer.conf index 83b790fa18..1f55f5bee1 100644 --- a/meta-oe/conf/layer.conf +++ b/meta-oe/conf/layer.conf | |||
| @@ -231,7 +231,6 @@ OEQA_REPRODUCIBLE_EXCLUDED_PACKAGES += " \ | |||
| 231 | pcp-src \ | 231 | pcp-src \ |
| 232 | perfetto \ | 232 | perfetto \ |
| 233 | perfetto-dbg \ | 233 | perfetto-dbg \ |
| 234 | php-phar \ | ||
| 235 | pidgin \ | 234 | pidgin \ |
| 236 | pidgin-dbg \ | 235 | pidgin-dbg \ |
| 237 | pim435-staticdev \ | 236 | pim435-staticdev \ |
diff --git a/meta-oe/recipes-devtools/php/php/0005-explicitly-not-generate-phar.php-during-cross-compil.patch b/meta-oe/recipes-devtools/php/php/0005-explicitly-not-generate-phar.php-during-cross-compil.patch new file mode 100644 index 0000000000..469d26e06b --- /dev/null +++ b/meta-oe/recipes-devtools/php/php/0005-explicitly-not-generate-phar.php-during-cross-compil.patch | |||
| @@ -0,0 +1,35 @@ | |||
| 1 | From 41c8c5821fc74efea8b086927a17aa3bc7aef6bb Mon Sep 17 00:00:00 2001 | ||
| 2 | From: Hongxu Jia <hongxu.jia@windriver.com> | ||
| 3 | Date: Tue, 18 Nov 2025 16:25:28 +0800 | ||
| 4 | Subject: [PATCH] explicitly not generate phar.php during cross-compile | ||
| 5 | |||
| 6 | According to [1][2], Generating phar.php during cross-compile | ||
| 7 | can't be done, explicitly set TEST_PHP_EXECUTABLE_RES = 1 | ||
| 8 | for target recipe to not generate phar.php for cross-compile | ||
| 9 | |||
| 10 | [1] https://github.com/php/php-src/issues/11099 | ||
| 11 | [2] https://github.com/php/php-src/commit/93fa9613e162d1a0e8479ba83c4b6a399846e209 | ||
| 12 | |||
| 13 | Upstream-Status: Inappropriate [OE specific] | ||
| 14 | |||
| 15 | Signed-off-by: Hongxu Jia <hongxu.jia@windriver.com> | ||
| 16 | --- | ||
| 17 | ext/phar/Makefile.frag | 2 +- | ||
| 18 | 1 file changed, 1 insertion(+), 1 deletion(-) | ||
| 19 | |||
| 20 | diff --git a/ext/phar/Makefile.frag b/ext/phar/Makefile.frag | ||
| 21 | index 09d577d7..2f85847c 100644 | ||
| 22 | --- a/ext/phar/Makefile.frag | ||
| 23 | +++ b/ext/phar/Makefile.frag | ||
| 24 | @@ -19,7 +19,7 @@ $(builddir)/phar/phar.inc: $(srcdir)/phar/phar.inc | ||
| 25 | -@test -f $(builddir)/phar/phar.inc || cp $(srcdir)/phar/phar.inc $(builddir)/phar/phar.inc | ||
| 26 | |||
| 27 | TEST_PHP_EXECUTABLE = $(shell $(PHP_EXECUTABLE) -v 2>&1) | ||
| 28 | -TEST_PHP_EXECUTABLE_RES = $(shell echo "$(TEST_PHP_EXECUTABLE)" | grep -c 'Exec format error') | ||
| 29 | +TEST_PHP_EXECUTABLE_RES = "1" | ||
| 30 | |||
| 31 | $(builddir)/phar.php: $(srcdir)/build_precommand.php $(srcdir)/phar/*.inc $(srcdir)/phar/*.php $(SAPI_CLI_PATH) | ||
| 32 | -@(echo "Generating phar.php"; \ | ||
| 33 | -- | ||
| 34 | 2.34.1 | ||
| 35 | |||
diff --git a/meta-oe/recipes-devtools/php/php/0005-sapi-cli-config.m4-fix-build-directory.patch b/meta-oe/recipes-devtools/php/php/0005-sapi-cli-config.m4-fix-build-directory.patch deleted file mode 100644 index e551f19a48..0000000000 --- a/meta-oe/recipes-devtools/php/php/0005-sapi-cli-config.m4-fix-build-directory.patch +++ /dev/null | |||
| @@ -1,35 +0,0 @@ | |||
| 1 | From 581751f8b612c381a4a7914a33bfc4130853d305 Mon Sep 17 00:00:00 2001 | ||
| 2 | From: Claude Bing <cbing@cybernetics.com> | ||
| 3 | Date: Tue, 9 Nov 2021 13:08:06 -0500 | ||
| 4 | Subject: [PATCH 5/5] sapi/cli/config.m4: fix build directory | ||
| 5 | |||
| 6 | Upstream-Status: Inappropriate | ||
| 7 | |||
| 8 | update patch to version 7.4.4 | ||
| 9 | Signed-off-by: Changqing Li <changqing.li@windriver.com> | ||
| 10 | |||
| 11 | update patch to version 8.0.12 | ||
| 12 | Signed-off-by: Claude Bing <cbing@cybernetics.com> | ||
| 13 | |||
| 14 | update patch for version 8.4.4 | ||
| 15 | Signed-off-by: Chen Qi <Qi.Chen@windriver.com> | ||
| 16 | --- | ||
| 17 | sapi/cli/config.m4 | 2 +- | ||
| 18 | 1 file changed, 1 insertion(+), 1 deletion(-) | ||
| 19 | |||
| 20 | diff --git a/sapi/cli/config.m4 b/sapi/cli/config.m4 | ||
| 21 | index 76c2d64e8..0c7436fd9 100644 | ||
| 22 | --- a/sapi/cli/config.m4 | ||
| 23 | +++ b/sapi/cli/config.m4 | ||
| 24 | @@ -50,7 +50,7 @@ if test "$PHP_CLI" != "no"; then | ||
| 25 | ]) | ||
| 26 | |||
| 27 | dnl Set executable for tests. | ||
| 28 | - PHP_EXECUTABLE="\$(top_builddir)/\$(SAPI_CLI_PATH)" | ||
| 29 | + PHP_EXECUTABLE="${PHP_NATIVE_DIR}/php" | ||
| 30 | |||
| 31 | PHP_SUBST([PHP_EXECUTABLE]) | ||
| 32 | PHP_SUBST([SAPI_CLI_PATH]) | ||
| 33 | -- | ||
| 34 | 2.25.1 | ||
| 35 | |||
diff --git a/meta-oe/recipes-devtools/php/php_8.4.14.bb b/meta-oe/recipes-devtools/php/php_8.4.14.bb index ecec5ae04d..086e7114fb 100644 --- a/meta-oe/recipes-devtools/php/php_8.4.14.bb +++ b/meta-oe/recipes-devtools/php/php_8.4.14.bb | |||
| @@ -20,7 +20,7 @@ SRC_URI = "http://php.net/distributions/php-${PV}.tar.bz2 \ | |||
| 20 | SRC_URI:append:class-target = " \ | 20 | SRC_URI:append:class-target = " \ |
| 21 | file://0003-iconv-fix-detection.patch \ | 21 | file://0003-iconv-fix-detection.patch \ |
| 22 | file://0004-pear-fix-Makefile.frag-for-Yocto.patch \ | 22 | file://0004-pear-fix-Makefile.frag-for-Yocto.patch \ |
| 23 | file://0005-sapi-cli-config.m4-fix-build-directory.patch \ | 23 | file://0005-explicitly-not-generate-phar.php-during-cross-compil.patch \ |
| 24 | file://php-fpm.conf \ | 24 | file://php-fpm.conf \ |
| 25 | file://php-fpm-apache.conf \ | 25 | file://php-fpm-apache.conf \ |
| 26 | file://70_mod_php${PHP_MAJOR_VERSION}.conf \ | 26 | file://70_mod_php${PHP_MAJOR_VERSION}.conf \ |
| @@ -230,11 +230,10 @@ php_sysroot_preprocess () { | |||
| 230 | 230 | ||
| 231 | MODPHP_PACKAGE = "${@bb.utils.contains('PACKAGECONFIG', 'apache2', '${PN}-modphp', '', d)}" | 231 | MODPHP_PACKAGE = "${@bb.utils.contains('PACKAGECONFIG', 'apache2', '${PN}-modphp', '', d)}" |
| 232 | 232 | ||
| 233 | PACKAGES = "${PN}-dbg ${PN}-cli ${PN}-phpdbg ${PN}-cgi ${PN}-fpm ${PN}-fpm-apache2 ${PN}-pear ${PN}-phar ${MODPHP_PACKAGE} ${PN}-dev ${PN}-staticdev ${PN}-doc ${PN}-opcache ${PN}" | 233 | PACKAGES = "${PN}-dbg ${PN}-cli ${PN}-phpdbg ${PN}-cgi ${PN}-fpm ${PN}-fpm-apache2 ${PN}-pear ${MODPHP_PACKAGE} ${PN}-dev ${PN}-staticdev ${PN}-doc ${PN}-opcache ${PN}" |
| 234 | 234 | ||
| 235 | RDEPENDS:${PN} += "libgcc" | 235 | RDEPENDS:${PN} += "libgcc" |
| 236 | RDEPENDS:${PN}-pear = "${PN}" | 236 | RDEPENDS:${PN}-pear = "${PN}" |
| 237 | RDEPENDS:${PN}-phar = "${PN}-cli" | ||
| 238 | RDEPENDS:${PN}-cli = "${PN}" | 237 | RDEPENDS:${PN}-cli = "${PN}" |
| 239 | RDEPENDS:${PN}-modphp = "${PN} apache2" | 238 | RDEPENDS:${PN}-modphp = "${PN} apache2" |
| 240 | RDEPENDS:${PN}-opcache = "${PN}" | 239 | RDEPENDS:${PN}-opcache = "${PN}" |
| @@ -254,7 +253,6 @@ FILES:${PN}-dbg =+ "${bindir}/.debug \ | |||
| 254 | FILES:${PN}-doc += "${PHP_LIBDIR}/php/doc" | 253 | FILES:${PN}-doc += "${PHP_LIBDIR}/php/doc" |
| 255 | FILES:${PN}-cli = "${bindir}/php" | 254 | FILES:${PN}-cli = "${bindir}/php" |
| 256 | FILES:${PN}-phpdbg = "${bindir}/phpdbg" | 255 | FILES:${PN}-phpdbg = "${bindir}/phpdbg" |
| 257 | FILES:${PN}-phar = "${bindir}/phar*" | ||
| 258 | FILES:${PN}-cgi = "${bindir}/php-cgi" | 256 | FILES:${PN}-cgi = "${bindir}/php-cgi" |
| 259 | FILES:${PN}-fpm = "${sbindir}/php-fpm ${sysconfdir}/php-fpm.conf ${datadir}/fpm ${sysconfdir}/init.d/php-fpm ${sysconfdir}/php-fpm.d/www.conf.default" | 257 | FILES:${PN}-fpm = "${sbindir}/php-fpm ${sysconfdir}/php-fpm.conf ${datadir}/fpm ${sysconfdir}/init.d/php-fpm ${sysconfdir}/php-fpm.d/www.conf.default" |
| 260 | FILES:${PN}-fpm-apache2 = "${sysconfdir}/apache2/conf.d/php-fpm.conf" | 258 | FILES:${PN}-fpm-apache2 = "${sysconfdir}/apache2/conf.d/php-fpm.conf" |
