Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

pecl install fails on PHP 8.3 due to missing files #2025

Closed
3 tasks done
sjinks opened this issue Sep 13, 2023 · 1 comment
Closed
3 tasks done

pecl install fails on PHP 8.3 due to missing files #2025

sjinks opened this issue Sep 13, 2023 · 1 comment

Comments

@sjinks
Copy link

sjinks commented Sep 13, 2023

Frequently asked questions

  • I have read Frequently Asked Questions
  • I have looked at the list of the existing issues (including closed issues) and searched if my issue has been already reported
  • I have tried to resolve the issue myself and will describe what I did in clear and consise manner

Describe the bug

pecl install <package> fails on PHP 8.3.

To Reproduce

On a clean Ubuntu 22.04 install with software-properties-common installed (I used ubuntu:2204 Docker image):

add-apt-repository -y ppa:ondrej/php
apt-get install -y php8.3-dev php8.3-xml
pecl install apcu

This yields:

WARNING: channel "pecl.php.net" has updated its protocols, use "pecl channel-update pecl.php.net" to update
downloading apcu-5.1.22.tgz ...
Starting to download apcu-5.1.22.tgz (93,926 bytes)
.....................done: 93,926 bytes
44 source files, building
running: phpize
Configuring for:
PHP Api Version:         20230831
Zend Module Api No:      20230831
Zend Extension Api No:   420230831
cp: cannot stat 'shtool': No such file or directory
cp: cannot stat 'config.guess': No such file or directory
cp: cannot stat 'config.sub': No such file or directory
cp: cannot stat 'ltmain.sh': No such file or directory
chmod: cannot access '/tmp/pear/temp/apcu/build/shtool': No such file or directory
shtool at '/tmp/pear/temp/apcu/build/shtool' does not exist or is not executable.
Make sure that the file exists and is executable and then rerun this script.

ERROR: `phpize' failed

It works fine with php8.2 though.

Your understanding of what is happening

phpize8.3 does this:

+ cd /usr/lib/php/20230831/build
+ cp php.m4 shtool ax_check_compile_flag.m4 ax_gcc_func_attribute.m4 php_cxx_compile_stdcxx.m4 config.guess config.sub ltmain.sh Makefile.global gen_stub.php /tmp/pear/temp/apcu/build

However, shtool, config.guess, config.sub, and ltmain.sh are missing from /usr/lib/php/20230831/build.

I compared this with phpize8.2 and found this:

+ cd /usr/lib/php/20220829/build
+ cp php.m4 /usr/bin/shtool ax_check_compile_flag.m4 ax_gcc_func_attribute.m4 php_cxx_compile_stdcxx.m4 Makefile.global gen_stub.php /tmp/pear/temp/apcu/build
+ cd /usr/share/aclocal
+ cp pkg.m4 libtool.m4 ltoptions.m4 ltsugar.m4 ltversion.m4 lt~obsolete.m4 /tmp/pear/temp/apcu/build
+ cd /usr/share/libtool/build-aux
+ cp config.sub config.guess ltmain.sh /tmp/pear/temp/apcu/build
+ cd /usr/lib/php/20220829/build
+ cp run-tests.php /tmp/pear/temp/apcu/build

That is, config.guess, config.sub, and ltmain.sh are copied from /usr/share/libtool/build-aux, and shtool is copied from /usr/bin, not from /usr/lib/php/20230831/build

My further analysis showed that the php8.2 source has this patch that is missing in php8.3: 0036-In-phpize-also-copy-config.guess-config.sub-ltmain.s.patch. That patch fixes paths of the files in question.

What steps did you take to resolve issue yourself before reporting it here

Analyzed the sources of phpize8.2 and phpize8.3 and checked for patches that alter the original phpize.

To fix the issue for my Docker build, I had to use a workaround:

RUN cp \
    /usr/share/libtool/build-aux/config.sub \
    /usr/share/libtool/build-aux/config.guess \
    /usr/share/libtool/build-aux/ltmain.sh \
    /usr/bin/shtool \
    /usr/lib/php/20230831/build

Related: Automattic/vip-container-images#536

Expected behavior

phpize does not fail.

Distribution (please complete the following information):

  • OS: Ubuntu 22.04
  • Architecture: amd64, arm64
  • Repository: Ubuntu PPA

Package(s) (please complete the following information):

 apt-cache policy php8.3-dev
php8.3-dev:
  Installed: 8.3.0~rc1-1+ubuntu22.04.1+deb.sury.org+1
  Candidate: 8.3.0~rc1-1+ubuntu22.04.1+deb.sury.org+1
  Version table:
 *** 8.3.0~rc1-1+ubuntu22.04.1+deb.sury.org+1 500
        500 https://ppa.launchpadcontent.net/ondrej/php/ubuntu jammy/main amd64 Packages
        100 /var/lib/dpkg/status

Additional context
N/A

boesing added a commit to boesing/laminas-continuous-integration-action that referenced this issue Oct 1, 2023
…iner setup

Refs: oerdnj/deb.sury.org#2025
Signed-off-by: Maximilian Bösing <2189546+boesing@users.noreply.github.com>
boesing added a commit to laminas/laminas-continuous-integration-action that referenced this issue Oct 1, 2023
…iner setup

Refs: oerdnj/deb.sury.org#2025
Signed-off-by: Maximilian Bösing <2189546+boesing@users.noreply.github.com>
@oerdnj
Copy link
Owner

oerdnj commented Oct 6, 2023

Fix was included in 8.3.0~rc3

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

No branches or pull requests

2 participants