Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 900210 - dev-lang/php-8.2.3 - no configure script found
Summary: dev-lang/php-8.2.3 - no configure script found
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: All Linux
: Normal normal (vote)
Assignee: PHP Bugs
URL:
Whiteboard:
Keywords: PullRequest
Depends on:
Blocks:
 
Reported: 2023-03-07 18:06 UTC by Toralf Förster
Modified: 2023-08-01 15:19 UTC (History)
2 users (show)

See Also:
Package list:
Runtime testing required: ---


Attachments
emerge-info.txt (emerge-info.txt,22.25 KB, text/plain)
2023-03-07 18:06 UTC, Toralf Förster
Details
dev-lang:php-8.2.3:20230307-175214.log (dev-lang:php-8.2.3:20230307-175214.log,32.84 KB, text/plain)
2023-03-07 18:06 UTC, Toralf Förster
Details
emerge-history.txt (emerge-history.txt,99.79 KB, text/plain)
2023-03-07 18:06 UTC, Toralf Förster
Details
environment (environment,117.49 KB, text/plain)
2023-03-07 18:06 UTC, Toralf Förster
Details
etc.clang.tar.bz2 (etc.clang.tar.bz2,833 bytes, application/x-bzip)
2023-03-07 18:06 UTC, Toralf Förster
Details
etc.portage.tar.bz2 (etc.portage.tar.bz2,27.76 KB, application/x-bzip)
2023-03-07 18:06 UTC, Toralf Förster
Details
logs.tar.bz2 (logs.tar.bz2,33.83 KB, application/x-bzip)
2023-03-07 18:06 UTC, Toralf Förster
Details
Build Log (php-8.1.16) (php-8.1.16-build.log,36.80 KB, text/plain)
2023-05-13 07:43 UTC, H. Peter Pfeufer
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Toralf Förster gentoo-dev 2023-03-07 18:06:20 UTC
| the installation process at this point.                            |
+--------------------------------------------------------------------+

Thank you for using PHP.

 * ERROR: dev-lang/php-8.2.3::gentoo failed (configure phase):
 *   no configure script found
 * 
 * Call stack:

  -------------------------------------------------------------------

  This is an unstable amd64 chroot image at a tinderbox (==build bot)
  name: 17.1_desktop_plasma-j5-20230306-130011

  -------------------------------------------------------------------

gcc-config -l:
 [1] x86_64-pc-linux-gnu-13 *
clang/llvm (if any):
clang version 15.0.7
Target: x86_64-pc-linux-gnu
Thread model: posix
InstalledDir: /usr/lib/llvm/15/bin
Configuration file: /etc/clang/clang.cfg
/usr/lib/llvm/15
15.0.7
Python 3.10.10
Available Ruby profiles:
  (none found)
Available Rust versions:
  [1]   rust-1.67.1 *
php cli (if any):
  [1]   php7.4
  [2]   php8.0
  [3]   php8.2 *

  HEAD of ::gentoo
commit 57d726affec161718c6d3c5c01ec85b93744a105
Author: Repository mirror & CI <repomirrorci@gentoo.org>
Date:   Tue Mar 7 17:32:08 2023 +0000

    2023-03-07 17:32:07 UTC

emerge -qpvO dev-lang/php
[ebuild   R   ] dev-lang/php-8.2.3  USE="acl apparmor bzip2 calendar cdb cjk cli coverage embed enchant exif ffi fileinfo filter firebird flatfile gd iconv imap intl iodbc jit nls opcache pdo phar posix readline session simplexml sodium ssl sysvipc tokenizer tokyocabinet unicode xml xmlwriter xslt zlib -apache2 -argon2 -bcmath -berkdb -cgi -ctype -curl -debug -fpm -ftp -gdbm -gmp -inifile -kerberos -ldap -ldap-sasl -libedit -lmdb -mhash -mssql -mysql -mysqli -oci8-instant-client -odbc -pcntl -phpdbg -postgres -qdbm (-selinux) -session-mm -sharedmem -snmp -soap -sockets -spell -sqlite -systemd -test -threads -tidy -truetype -webp -xmlreader -xpm -zip"
Comment 1 Toralf Förster gentoo-dev 2023-03-07 18:06:21 UTC
Created attachment 856660 [details]
emerge-info.txt
Comment 2 Toralf Förster gentoo-dev 2023-03-07 18:06:22 UTC
Created attachment 856662 [details]
dev-lang:php-8.2.3:20230307-175214.log
Comment 3 Toralf Förster gentoo-dev 2023-03-07 18:06:23 UTC
Created attachment 856664 [details]
emerge-history.txt
Comment 4 Toralf Förster gentoo-dev 2023-03-07 18:06:25 UTC
Created attachment 856666 [details]
environment
Comment 5 Toralf Förster gentoo-dev 2023-03-07 18:06:25 UTC
Created attachment 856668 [details]
etc.clang.tar.bz2
Comment 6 Toralf Förster gentoo-dev 2023-03-07 18:06:26 UTC
Created attachment 856670 [details]
etc.portage.tar.bz2
Comment 7 Toralf Förster gentoo-dev 2023-03-07 18:06:28 UTC
Created attachment 856672 [details]
logs.tar.bz2
Comment 8 H. Peter Pfeufer 2023-04-22 11:14:07 UTC
Same for dev-lang/php-8.2.4
Comment 9 Michael Orlitzky gentoo-dev 2023-05-02 23:47:14 UTC
(In reply to H.-Peter Pfeufer from comment #8)
> Same for dev-lang/php-8.2.4

I don't remember if I ever built 8.2.3, but I'm the one who added 8.2.4, and I can't get this failure to happen. If you can reproduce it, can you help debug?

The PHP ebuild first runs eautoreconf once, to generate the autotools files, including the configure script. It then loops through each of the SAPIs  -- "cli" and "embed", in this case. For each SAPI it creates a subdirectory and copies the source files into it. Then within that subdirectory it runs ./configure.

In Toralf's build log, it looks like the loop was able to run ./configure in the "embed" directory (look for --enable-embed --disable-cli), but not in the "cli" directory (look for --disable-embed --enable-cli). Of course, those directories should contain the same thing: they're both populated by

  cp -a "${S}" "${BUILD_DIR}"

where BUILD_DIR is the per-SAPI subdirectory. So I can't explain how one of them gets a ./configure script and the other does not. Nothing in the loop should be messing with $S in between runs.
Comment 10 H. Peter Pfeufer 2023-05-03 09:33:11 UTC
Oh great, now it's working O_o

During yesterday's world update it still failed with this error so I removed the `~amd64` keyword and the package to not be bothered with it every world update and not have the `preserved-rebuild` reminder after every emerge I was running.

Now as I wanted to provide the log for it, it just compiles …


The only difference on my system:

- World update (where it failed)
- Package and keyword removal
- emerge --depclean


Now added the keyword again and it just runs through …
Comment 11 Michael Orlitzky gentoo-dev 2023-05-09 00:24:27 UTC
(In reply to H.-Peter Pfeufer from comment #10)
> Oh great, now it's working O_o
> 

That should be the Gentoo slogan.

I wish I knew what to tell you. I've had the same thing happen a thousand times.

I'll leave this open for a little while longer but probably whatever was wrong is history and was fixed by somebody else.
Comment 12 H. Peter Pfeufer 2023-05-13 07:43:27 UTC
Created attachment 861629 [details]
Build Log (php-8.1.16)

Now I've got this with php-8.1.16 during today's world update …

I know, this issue is for a different version, but might be related. The build log is attached …
Comment 13 Michael Orlitzky gentoo-dev 2023-06-07 01:55:29 UTC
I still haven't been able to reproduce this, so I'm not going to be much help, but I wanted to reply before I forget again.

If/when this happens to you, can you poke around in the build directory to see what went wrong? The PHP ebuild runs "eautoconf --force" once, in src_prepare(), to create the ./configure script. Then in src_configure(), we copy the source files to sapis-build/<sapi-name> for each SAPI (cli, fpm, etc.) that you have enabled. In each of those directories, we run ./configure.

What's confusing is that you were able to run ./configure in one of those SAPI directories but not in another: they should both have been copied from the same place! If one SAPI directory is missing a ./configure script, the other should be too.
Comment 14 Toralf Förster gentoo-dev 2023-06-07 08:30:45 UTC
(In reply to Michael Orlitzky from comment #13)
>If one SAPI directory is missing a ./configure script, the
> other should be too.

Does by any chance parallel build, eg -j4 or -j5 causes it ?
Comment 15 Michael Orlitzky gentoo-dev 2023-06-08 01:01:39 UTC
(In reply to Toralf Förster from comment #14)
> (In reply to Michael Orlitzky from comment #13)
> >If one SAPI directory is missing a ./configure script, the
> > other should be too.
> 
> Does by any chance parallel build, eg -j4 or -j5 causes it ?

I can't really swear that it's not, since obviously my understanding of what should be happening and what are actually happening are quite different.

But, the source-tree copying and SAPI-specific ./configure runs all happen in a "for" loop in src_configure(). Nothing has run in parallel at that point.
Comment 16 Toralf Förster gentoo-dev 2023-06-08 07:53:14 UTC
If it is worth I could add few more code lines to the tinderbox for this case - but I need to know, which files/info you like to collect for this pacakge.
Comment 17 H. Peter Pfeufer 2023-06-08 10:18:13 UTC
Interestingly enough, unmerging and re-emerging the packages seems to fix it. At least in my case.
Comment 18 Michael Orlitzky gentoo-dev 2023-06-09 16:40:09 UTC
(In reply to Toralf Förster from comment #16)
> If it is worth I could add few more code lines to the tinderbox for this
> case - but I need to know, which files/info you like to collect for this
> pacakge.

Thanks for the offer, but I don't even know what to look for. There should be a configure script in each of the SAPI subdirectories. If I could reproduce it, I would probably start by adding echo statements to the ebuild to see where they go missing: are they in the SAPI directories after the cp -a, but missing when we later try to run ./configure? Or, if they're not in the SAPI directories after cp -a, are they still in the source directory after cp -a? Etc. At some point there's at least one working configure script, because it gets run. And then at a later point, it isn't where we expect it to be.
Comment 19 Michael Orlitzky gentoo-dev 2023-07-27 13:29:17 UTC
I finally reproduced this, and it happened twice in a row, and now has me questioning my sanity.

I added some einfo statements, so I know exactly what happened: first the "embed" SAPI was ./configure'd, and then...

  * Current SAPI: cli
  * Copying sources to /var/lib/portage/tmp/portage/dev-lang/php-8.2.8/work/sapis-build/cli
  * Running ./configure in /var/lib/portage/tmp/portage/dev-lang/php-8.2.8/work/sapis-build/cli
  * ERROR: dev-lang/php-8.2.8::gentoo failed (configure phase):
  *   no configure script found

So now I can actually look in that directory:

  $ sudo ls -lh /var/lib/portage/tmp/portage/dev-lang/php-8.2.8/work/sapis-build/cli
  total 24K
  drwxr-xr-x  2 portage portage 4.0K Jul 27 09:06 TSRM
  drwxr-xr-x  3 portage portage 4.0K Jul 27 09:06 Zend
  drwxr-xr-x 68 portage portage 4.0K Jul 27 09:06 ext
  drwxr-xr-x  3 portage portage 4.0K Jul 27 09:06 main
  drwxr-xr-x 17 portage portage 4.0K Jul 27 09:06 php-8.2.8
  drwxr-xr-x  3 portage portage 4.0K Jul 27 09:06 sapi

That's the result of,

  cp -a "${S}" "${BUILD_DIR}"

where the last component of $S is "php-8.2.8". So, it looks like "${BUILD_DIR}" already exists when the call to "cp" is made, causing $S to be copied UNDER the new build directory, rather than TO it. But how ${WORKDIR}/sapis-build/cli gets created before we've finished running ./configure in ${WORKDIR}/sapis-build/embed is a mystery to me.
Comment 20 Michael Orlitzky gentoo-dev 2023-07-27 13:40:28 UTC
Before the call to,

  cp -a "${S}" "${BUILD_DIR}"

the contents of $BUILD_DIR (which shouldn't exist yet) are,

  # find ./ -type f
  ./ext/ctype/ctype.gcda
  ./ext/reflection/php_reflection.gcda
  ./ext/sockets/sockaddr_conv.gcda
  ./ext/sockets/conversions.gcda
  ./ext/sockets/sockets.gcda
  ...

that is, all *.gcda files. This means something but who knows what.
Comment 21 Michael Orlitzky gentoo-dev 2023-07-27 14:38:26 UTC
It looks like the problem is USE=coverage on the EXISTING /usr/bin/php (not the one being built). Somehow the path to portage's temporary $WORKDIR is hard-coded, and the CLI workdir gets populated when the pre-existing CLI php is detected or run or whatever.

I'll do two things to fix it:

1. Disable USE=coverage. The option says "FOR DEVELOPERS ONLY!!", and it only works with GCC anyway. Not really something I want to maintain for end users.

2. Hide any existing /usr/bin/php from ./configure. It can't be necessary, and only squares the number of configurations that we have to worry about w.r.t. weird edge cases like this.
Comment 22 Larry the Git Cow gentoo-dev 2023-07-31 00:53:09 UTC
The bug has been closed via the following commit(s):

https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=615036dd66eb3c0a2cf6ef45b4535fe235235108

commit 615036dd66eb3c0a2cf6ef45b4535fe235235108
Author:     Michael Orlitzky <mjo@gentoo.org>
AuthorDate: 2023-07-27 17:24:15 +0000
Commit:     Michael Orlitzky <mjo@gentoo.org>
CommitDate: 2023-07-31 00:49:12 +0000

    dev-lang/php: disable USE=coverage and hide /usr/bin/php.
    
    Code coverage is "FOR DEVELOPERS ONLY!!", and requires GCC. It's not
    really something we want to support for end users, and it's contributing
    to bug 900210, so now it's gone. The rest of that bug is caused by PHP's
    ./configure script detecting an already-installed PHP (at /usr/bin/php)
    and running it.
    
    Obviously PHP isn't needed to build itself, so allowing it to detect and
    (apparently) run an existing installation is only multiplying the insane
    number of configurations we already support. To avoid that in the future
    (and to fix bug 900210 right now), we hide the system "php" by
    overriding its cache variable during ./configure.
    
    Closes: https://bugs.gentoo.org/900210
    Signed-off-by: Michael Orlitzky <mjo@gentoo.org>

 dev-lang/php/{php-8.2.8.ebuild => php-8.2.8-r1.ebuild} | 15 ++++++++-------
 1 file changed, 8 insertions(+), 7 deletions(-)