Summary: | dev-lang/php-8.3.6 cross-compilation fails configure phase with "Cannot use external libcrypt as some algo are missing" | ||
---|---|---|---|
Product: | Gentoo Linux | Reporter: | raffaele <mentadent47> |
Component: | Current packages | Assignee: | PHP Bugs <php-bugs> |
Status: | RESOLVED FIXED | ||
Severity: | normal | CC: | cross, de.techno, mentadent47, mjo |
Priority: | Normal | ||
Version: | unspecified | ||
Hardware: | AMD64 | ||
OS: | Linux | ||
Whiteboard: | |||
Package list: | Runtime testing required: | --- | |
Attachments: |
output og emerge -pqv dev-lang/php
build log, on Host Build log on arm64, incomplete but shows the successful configure phase The Host's /usr/aarch64-unknown-linux-gnu/etc/portage/make.conf config.log (/usr/aarch64-unknown-linux-gnu/tmp/portage/dev-lang/php-8.3.6/work/sapis-build/cli/config.log) build log for 8.3.7-r1 |
Description
raffaele
2024-05-13 18:52:36 UTC
Created attachment 892883 [details]
output og emerge -pqv dev-lang/php
Created attachment 892884 [details]
build log, on Host
Created attachment 892885 [details]
Build log on arm64, incomplete but shows the successful configure phase
Created attachment 892886 [details]
The Host's /usr/aarch64-unknown-linux-gnu/etc/portage/make.conf
Could we have config.log too please? Created attachment 892925 [details]
config.log (/usr/aarch64-unknown-linux-gnu/tmp/portage/dev-lang/php-8.3.6/work/sapis-build/cli/config.log)
These tests are doing e.g., AC_CACHE_CHECK(for extended DES crypt, ac_cv_crypt_ext_des,[ AC_RUN_IFELSE([AC_LANG_SOURCE([[ ... ]]) ],[ ac_cv_crypt_ext_des=yes ],[ ac_cv_crypt_ext_des=no ],[ ac_cv_crypt_ext_des=no ]) ]) where the last case is saying "no support" while cross-compiling. This leads to an error when --with-external-libcrypt is passed to ./configure. I'm not sure how many people are doing that, so we may simply be the first to hit the issue. What does cross@ think is the best solution? 0. Is there a better way to detect crypt() methods without running programs? 1. Report upstream, and ask for the default to be "yes" when cross-compiling. 2. In Gentoo, set those cache vars to "yes" in the ebuild when cross-compiling. 3. In Gentoo, fall back to the bundled libcrypt when cross-compiling. Or are there other options I've overlooked? (In reply to Michael Orlitzky from comment #7) > > What does cross@ think is the best solution? > > 0. Is there a better way to detect crypt() methods without running programs? > 1. Report upstream, and ask for the default to be "yes" when cross-compiling. > 2. In Gentoo, set those cache vars to "yes" in the ebuild when > cross-compiling. > 3. In Gentoo, fall back to the bundled libcrypt when cross-compiling. > Just to let me proceed with my project I tried option 3. and commented out --with-external-libcrypt from the ebuild and the build succeeds. (In reply to Michael Orlitzky from comment #7) config.site is also an option. A couple ways to utilize that: 5. Add entries to /usr/share/crossdev/include/site via sys-devel/crossdev. 6. Install a new drop-in in /usr/share/config.site.d via the packages that provide libcrypt (sys-libs/libxcrypt, sys-libs/glibc, sys-libs/musl). Actually, option 6 is tricky because configure doesn't look for config.site in SYSROOT, and Gentoo's sys-apps/config-site isn't SYSROOT-aware either. If we fix the latter issue, it could be a slick solution though. The situation worsens with 8.3.7-r1, removing --with-external-libcrypt build succeeds but install phase fails: * Installing php.ini for cli into /etc/php/cli-php8.3 * * Adding opcache to /etc/php/cli-php8.3/ext * Installing SAPI: fpm * Installing php.ini for fpm into /etc/php/fpm-php8.3 * * Adding opcache to /etc/php/fpm-php8.3/ext * Installing FPM config files php-fpm.conf and www.conf * Installing SAPI: apache2 * Installing php.ini for apache2 into /etc/php/apache2-php8.3 * * Adding opcache to /etc/php/apache2-php8.3/ext sed: can't read /usr/aarch64-unknown-linux-gnu/tmp/portage/dev-lang/php-8.3.7-r1/image/usr/lib64/php8.3/bin/php-config: No such file or directory Build log attached Created attachment 895382 [details]
build log for 8.3.7-r1
Removing --with-external-crypt the build completes but fails during the install phase
This is the line that's failing now: # set php-config variable correctly (bug #278439) sed -e "s:^\(php_sapis=\)\".*\"$:\1\"${sapi_list}\":" -i \ "${ED}/usr/$(get_libdir)/php${SLOT}/bin/php-config" || die It fails with, sed: can't read /usr/aarch64-unknown-linux-gnu/tmp/portage/dev-lang/php-8.3.7- r1/image/usr/lib64/php8.3/bin/php-config: No such file or directory This likely has to do with the removal of eautoconf (from autotools.eclass) in 8.3.7-r1. But I'm not sure if it's hopelessly broken without the eautoreconf, or if the path just needs to be tweaked, or if we should be sed'ing this file BEFORE installing it, or something else. (As for the original issue: upstream is working on adding cache variables for any checks that might need to be overridden during a cross-compile. When they show up in a released version, I'll be able to add them all to the ebuild, hopefully fixing this and any other ./configure issues.) The bug has been referenced in the following commit(s): https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=0771e0a34345350b76153a1d4826dbec82e0dbea commit 0771e0a34345350b76153a1d4826dbec82e0dbea Author: Michael Orlitzky <mjo@gentoo.org> AuthorDate: 2024-07-09 19:16:23 +0000 Commit: Michael Orlitzky <mjo@gentoo.org> CommitDate: 2024-07-10 14:07:08 +0000 dev-lang/php: add 8.3.9, drop 8.3.8 Various improvements on top of the version bump: * The system copy of media-libs/gd is now used. * Autoconf cache variables are overridden to allow cross-compiles with external libraries. * New USE=opcache-jit flag to control the use of a JIT within the opcache extension. Closes: https://bugs.gentoo.org/857597 Closes: https://bugs.gentoo.org/906585 Bug: https://bugs.gentoo.org/931884 Signed-off-by: Michael Orlitzky <mjo@gentoo.org> dev-lang/php/Manifest | 2 +- dev-lang/php/files/php-8.3.9-gd-cachevars.patch | 68 ++ .../files/php-8.3.9-optional-png-testfixen.patch | 1277 ++++++++++++++++++++ dev-lang/php/metadata.xml | 3 + .../php/{php-8.3.8.ebuild => php-8.3.9.ebuild} | 89 +- 5 files changed, 1406 insertions(+), 33 deletions(-) I think this should be working in 8.3.9, because I had to bring back the eautoreconf whose removal broke something else in Comment 11. Both libcrypt and libgd are using external libraries now, but both should have the autoconf cache variables overridden to allow cross-compilation. In the next version 8.3.10, the eautoreconf will probably be removed again and whatever happened in Comment 11 will come back, but one problem at a time... I'm closing this because I'm confident that cross-compiles, if they still fail, will fail for some other reason. Confirmed with dev-lang/php-8.2.24::gentoo (In reply to dE from comment #17) > Confirmed with dev-lang/php-8.2.24::gentoo It's only fixed in 8.3.x. Upstream is not so great about applying build system fixes to older branches, especially if they don't apply cleanly. |