tarantool/tarantool-php

Update driver to PHP8.1

oleggr opened this issue · 3 comments

We use this driver in project on PHP7.4 currently. Now we want to update PHP version to 8.1.2 so we need driver to support this version. We use ondrej/php repo for PHP, Ubuntu 18.04 bionic and Ubuntu 16.04 xenial. Probably builded file will be ok. Help us pls.

PHP 8.1.2 (cli) (built: Jan 24 2022 10:42:15) (NTS)
Copyright (c) The PHP Group
Zend Engine v4.1.2, Copyright (c) Zend Technologies
with Zend OPcache v8.1.2, Copyright (c), by Zend Technologies

@negram fixed all known problems on PHP 8.0 and 8.1.

I'll follow up with packages.

I can't build a package for Ubuntu Xenial, because ppa:ondrej/php does not support it anymore. If you still need it, please, give me a recipe how to get a PHP 8.1 package on Ubuntu Xenial and I'll try again.

Cite from https://github.com/oerdnj/deb.sury.org/wiki/Frequently-Asked-Questions:

Debian 8 Jessie and Ubuntu 16.04 Xenial LTS are available as paid option from PHP LTS by Freexian as a collaboration between DEB.SURY.ORG and Freexian.

Patch (Ubuntu 18.04 Bionic, PHP 8.1 from ppa:ondrej/php)
diff --git a/debian/prebuild.sh b/debian/prebuild.sh
index c17d14c..f277e7e 100755
--- a/debian/prebuild.sh
+++ b/debian/prebuild.sh
@@ -11,6 +11,12 @@ SUDO="sudo -E"
 ${SUDO} apt-get update > /dev/null
 ${SUDO} apt-get -y install php-all-dev
 
+# Build against php8.1 on Ubuntu Bionic.
+${SUDO} apt-get install -y software-properties-common
+${SUDO} add-apt-repository -y ppa:ondrej/php
+${SUDO} apt-get update > /dev/null
+${SUDO} apt-get install -y php8.1-dev
+
 phpversion=$(php-config --version | sed 's/^\([0-9]\+\.[0-9]\).*/\1/')
 
 cd /build/php-tarantool-*
diff --git a/test.pkg.all.sh b/test.pkg.all.sh
index 138a1b0..388cc62 100755
--- a/test.pkg.all.sh
+++ b/test.pkg.all.sh
@@ -3,27 +3,9 @@
 set -exu  # Strict shell (w/o -o pipefail)
 
 distros="
-    el:8
-    fedora:25
-    fedora:26
-    fedora:27
-    fedora:28
-    fedora:29
-    fedora:30
-    fedora:31
-    debian:stretch
-    debian:buster
-    ubuntu:xenial
     ubuntu:bionic
-    ubuntu:eoan
-    ubuntu:focal
 "
 
-if ! type packpack; then
-    echo "Unable to find packpack"
-    exit 1
-fi
-
 for distro in $distros; do
     export OS="${distro%%:*}"
     export DIST="${distro#*:}"
@@ -31,9 +13,6 @@ for distro in $distros; do
         export OS=centos
     fi
 
-    rm -rf build
-    packpack
-
     docker run \
         --volume "$(realpath .):/tarantool-php" \
         --workdir /tarantool-php                \
diff --git a/test.pkg.sh b/test.pkg.sh
index 3c1c271..648d324 100755
--- a/test.pkg.sh
+++ b/test.pkg.sh
@@ -16,7 +16,7 @@ elif type apt-get; then
     PM_SYNC='apt-get update'
     PM_INSTALL_NAME='apt-get -qy install'
     PM_INSTALL_FILE='dpkg -i'
-    PKG_GLOB='php7.?-tarantool*_amd64.deb'
+    PKG_GLOB='php8.?-tarantool*_amd64.deb'
     # Prevent packages like tzdata from asking configuration
     # parameters interactively.
     # See https://github.com/packpack/packpack/issues/7
@@ -29,8 +29,14 @@ fi
 # Update available packages list.
 ${PM_SYNC}
 
+# Verify against php8.1 on Ubuntu Bionic.
+apt-get -y install software-properties-common
+add-apt-repository -y ppa:ondrej/php
+apt-get update > /dev/null
+
 # Install php interpreter.
-${PM_INSTALL_NAME} php
+apt-get install -y php8.1
+php --version
 
 # Install php-tarantool package.
 ${PM_INSTALL_FILE} build/${PKG_GLOB}

How to build and verify:

$ OS=ubuntu DIST=bionic /path/to/packpack/packpack # build
$ ./test.pkg.all.sh # verify

Mostly the same as #117 (comment).