dh-php throws PHP_DEFAULT_VERSION cannot be empty

Bug #2007679 reported by Hans Rakers
12
This bug affects 2 people
Affects Status Importance Assigned to Milestone
dh-php (Ubuntu)
Confirmed
Undecided
Unassigned

Bug Description

While trying to compile php-mongodb-1.15.1, the dpkg-buildpackage stage keeps failing with:

#12 1.337 dpkg-buildpackage: info: host architecture amd64
#12 2.192 fakeroot debian/rules clean
#12 2.966 PHP_DEFAULT_VERSION_DEFAULT := "8.1.2-1ubuntu2"
#12 2.992 PHP_DEFAULT_VERSION_OVERRIDE := ""
#12 2.992 AVAILABLE_PHP_VERSIONS := "8.1"
#12 2.992 /usr/share/dh-php/pkg-pecl.mk:39: *** PHP_DEFAULT_VERSION cannot be empty. Stop.
#12 2.997 dpkg-buildpackage: error: fakeroot debian/rules clean subprocess returned exit status 2

This appears to be related to the changes made in dh-php 4.9. These changes might work fine on Debian, but since the output of `php-config --version` is quite different between Debian and Ubuntu, the matching seems to fail in pkg-pecl.mk.

Debian:

# php-config --version | sed -E -e 's,\.[^.]*$$,,'
7.4
# /usr/sbin/phpquery -V
7.4

Ubuntu:

# php-config --version | sed -E -e 's,\.[^.]*$$,,'
8.1.2-1ubuntu2
# /usr/sbin/phpquery -V
8.1

Environment:

Ubuntu 22.04
dh-php 4.9

Hans Rakers (hrak)
description: updated
Revision history for this message
Elbandi (ea333) wrote :

I run this bug too. The sed regex is wrong:

If you install main release php8.1-dev package:
# dpkg -l|grep php8.1-dev
ii php8.1-dev 8.1.2-1ubuntu2 amd64 Files for PHP8.1 module development
It works good:
# php-config --version
8.1.2
# php-config --version | sed -e 's,\.[^.]*$,,'
8.1

If you install the security package:
# dpkg -l|grep php8.1-dev
ii php8.1-dev 8.1.2-1ubuntu2.11 amd64 Files for PHP8.1 module development
It's not good:
# php-config --version
8.1.2-1ubuntu2.11
# php-config --version | sed -e 's,\.[^.]*$,,'
8.1.2-1ubuntu2

Revision history for this message
Elbandi (ea333) wrote :

The security "long" version is the good:
https://bugs.launchpad.net/ubuntu/+source/php8.1/+bug/1989196

Revision history for this message
Launchpad Janitor (janitor) wrote :

Status changed to 'Confirmed' because the bug affects multiple users.

Changed in dh-php (Ubuntu):
status: New → Confirmed
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.