Hi Alex,

Apologies on my slow response.

On 26/1/24 20:55, Alexandre Rossi wrote:
php-mysql depends on php8.2-mysql which provides php-mysqli and
contains mysqli.so

For adminer, adding an alternate dependency to php-mysqli would
tighten (adminer actually requires mysqli.so or pdo_mysql.so loaded in
PHP for mysql interaction). But then why keep the dependency on
php-mysql?

The patch becomes:

diff --git a/debian/control b/debian/control
index 35a3f2a..43b2d7d 100644
--- a/debian/control
+++ b/debian/control
@@ -14,11 +14,11 @@ Package: adminer
  Architecture: all
  Depends:
   libapache2-mod-php | php-cgi | php-fpm | php,
- php-mysql | php-sqlite3 | php-pgsql,
+ php-mysqli | php-pdo-mysql | php-sqlite3 | php-pgsql,
   ${misc:Depends},
  Recommends:
   php-cli,
- php-mysql,
+ php-mysqli,
   php-pgsql,
   php-sqlite3,
   ${misc:Recommends},

Actually, you raise a good point! Although TBH, I'm not 100% sure?

As I mentioned in my offer to assist with AdminerEvo[1], my packaging knowledge is a bit adhoc, with lots of gaps...

[1] https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=1055329


Or is there something I missed?

It's just as (perhaps more?) likely that I'm the one missing something! :)

However, having pondered this for some time now, I think that the reason to continue depending on the 'php-mysql' package (and just adding an alternative dependency on 'php-mysqli' - or 'php-pdo-mysql') is so that the php-mysql package - assuming it's installed - gets updated during a dist-upgrade (e.g. once trixie becomes stable).

AFAICT virtual packages don't (can't?) have a Debian version. I.e.:

# apt policy php-mysqli
php-mysqli:
   Installed: (none)
   Candidate: (none)
   Version table:

And the way it stands now, during a dist-upgrade, the 'php-mysql' package would pull in the newer phpX.Y-mysql package.

Let's imagine that trixie includes PHP 8.3:

If adminer depends on (virtual package) 'php-mysqli' (and not 'php-mysql'), the dependency is fulfilled by (real package) 'php8.2-mysql' in bookworm (and 'php-mysql' would not be installed).

Then when the user upgrades to trixie (with 'php8.3-mysql') the php-mysqli dependency would still be fulfilled by php8.2-mysql wouldn't it? Unless there's a specific Breaks/Conflicts (?) against the 'php8.2-mysql, the 'php8.3-mysql' wouldn't get pulled in would it? (IIUC there is no upgrade path from 'php8.2-mysql' is there? Only 'php-mysql'?)

So focusing back on bookworm, in my mind, the preferred dependency remains the 'php-mysql' package. The alternate 'php-mysqli' virtual package dependency would just mean you could use an alternate phpX.Y-mysql package to fulfill the dependency (without needing to pull in the php8.2-mysql package). You could instead install Adminer with an alternate phpX.Y-mysql package (e.g. php8.3-mysql from Ondřej's 3rd party PHP repo).

That may well cause other issues for the 3rd party PHP user, but IMO a user using default Debian packages should have prior consideration over someone using third party repos.

So whilst I'm not completely sure, it seems right to me to still depend on the real package and just have the virtual package as a fallback option.

Sorry I feel like I'm saying the same thing over and over but in slightly different ways... Hopefully I making sense?

Actually, it just occurred to me to have a quick look at some other php based packages that use mysql DB too. The first 2 I checked seem to be using a similar thing to what I previously proposed (albeit depending on the virtual 'php-mysqlnd' package instead of 'php-mysqli'):

Package: mediawiki
Depends: [...], php-mysql | php-pgsql | php-sqlite3 | php-mysqlnd, [...]

Package: wordpress
epends: [...], php-mysql | php-mysqlnd, [...]

Although I note that phpmyadmin appears to depends on php-mysql only (as adminer does now):

Package: phpmyadmin
Depends: [...], php-mysql, [...]

TBH I'm still inclined to think that having the phpX.Y-mysql package provide a virtual 'php-mysql' package would be an easier way to go, but Ondřej seemed pretty clear that wasn't the way he thought it should be.

So on that basis my inclination remains to go with my prior suggestion (i.e. add 'php-mysqli' as an optional dependency to 'php-mysql') but you're the maintainer, so I'll defer the decision to you.

(FWIW the hack I currently use to work around this is build a local dummy php-mysql package that depends on the relevant phpX.Y-mysql that I'm using).

I hope I haven't made things worse for you by trying to explain myself.. :D

Regards,
Jeremy

Attachment: OpenPGP_signature.asc
Description: OpenPGP digital signature

Reply via email to