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

Fix two Lintian errors in generated Debian package #594

Open
wants to merge 8 commits into
base: main
Choose a base branch
from

Conversation

lewart3
Copy link

@lewart3 lewart3 commented Oct 31, 2023

Fixes #593 Lintian reports php-wpcli_2.9.0_all.deb has two errors

Thank you!
Daniel Lewart
Urbana, Illinois

@lewart3 lewart3 requested a review from a team as a code owner October 31, 2023 07:20
@@ -31,8 +31,8 @@ Architecture: all
Maintainer: Alain Schlesser <alain.schlesser@gmail.com>
Section: php
Priority: optional
Depends: php5-cli (>= 5.6) | php-cli | php7-cli, php5-mysql | php5-mysqlnd | php7.0-mysql | php7.1-mysql | php7.2-mysql | php7.3-mysql | php7.4-mysql | php8.0-mysql | php8.1-mysql | php8.2-mysql | php-mysql, mysql-client | mariadb-client
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What's the significance of dropping all of these dependencies?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

  1. Fix Lintian errors
  2. Drop support for PHP 5.6 (EOL Dec 31, 2018)
  3. Keep support for legacy PHP 7 thanks to Provides fields
  4. Simplify dependencies to make it easier to maintain

Please note that I have revised one dependency (php-mysqlnd -> php-mysql | php-mysqlnd)

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hmm not sure about dropping PHP 5.6 support for this package, as WP-CLI in fact still supports PHP 5.6. Could we restore that part somehow?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@swissspidy, Yes ... commit 54056c0 restores PHP 5.6 support.
Downside is that Lintian reports the php-script-but-no-php-cli-dep error again.

WordPress 6.3 “Lionel” discontinued support for PHP 5 (Aug 8, 2023).
Are there any plans for WP-CLI to do the same?
If it is not imminent, I can create a lintian-override file.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Are there any plans for WP-CLI to do the same?

Not until Aug 8, 2024. See https://make.wordpress.org/cli/2019/01/15/wp-cli-php-requirements-strategy/

@lewart3
Copy link
Author

lewart3 commented Nov 7, 2023

Thank you, @swissspidy !
Commit bbc405d creates the Lintian override file.

@swissspidy
Copy link
Member

Not sure we want to actually have a hardcoded date in there... I imagine next August we'll release a new version of WP-CLI that officially drops support. Then we can remove the support here.

@szepeviktor
Copy link
Contributor

szepeviktor commented Nov 10, 2023

It is nice to have zero lintian warnings.
The root cause of all these is that a Debian package is released for each Debian release but we release only 1 package.

So modifying dependencies is not a good idea.

@lewart3
Copy link
Author

lewart3 commented Nov 13, 2023

@szepeviktor,

  1. The new overrides file takes care of the Lintian warning.

  2. I agree about the root cause.

  3. WP-CLI requires "PHP 5.6 or later". The current version of my dependencies should match that exactly:
    Depends: php-cli | php5-cli (>= 5.6), php-mysql | php-mysqlnd | php5-mysql, default-mysql-client | virtual-mysql-client
    I don't understand why this "is not a good idea".

For some numbers, here is a table based on the Debian Popularity Contest:

popcon version            %  PHP
-----------------------  --  ---
1.49 (squeeze)            1  5.3
1.56 (wheezy)             2  5.4
1.61 (jessie)             4  5.6
1.64 (stretch)            7  7.0
1.67 (buster)            16  7.3
1.71 (bullseye)          33  7.4
1.76 (bookworm/stable)   34  8.2
1.77 (testing/unstable)   4  8.2

@szepeviktor
Copy link
Contributor

szepeviktor commented Nov 13, 2023

@lewart3 WP-CLI should be packaged as if it was the time of Debian jessie but be compatible with current stable.
After dropping PHP 5.6 support we should move to the era when Debian had PHP 7.0.
Please understand.

@lewart3
Copy link
Author

lewart3 commented Nov 13, 2023

@szepeviktor, I completely agree.
What exactly is missing from my current dependencies?

@szepeviktor
Copy link
Contributor

What exactly is missing from my current dependencies?

I do not know that.
One must go through all 5 Debian releases and check virtual PHP packages etc.

@lewart3
Copy link
Author

lewart3 commented Dec 23, 2023

@szepeviktor,

I do not know that. One must go through all 5 Debian releases and check virtual PHP packages etc.

This Pull request says:

All checks have passed
36 successful and 1 skipped checks

Does that suffice?

@szepeviktor
Copy link
Contributor

I do not know what to add here as an answer.

utils/wp-cli-updatedeb.sh Outdated Show resolved Hide resolved
@schlessera
Copy link
Member

schlessera commented Feb 5, 2024

@szepeviktor I'd love to better understand your dependencies objection.

Here's what I'm hearing so far:

  • fixing the lintian errors makes the package compatible with latest Debian release
  • HOWEVER, it also therefore drops compatibility with older Debian releases
  • to properly support PHP 5.6, WP-CLI should be packaged so it can be used on these older Debian releases that are typically running on WordPress servers running PHP 5.6.
  • THEREFORE, we should stick with the lintian warnings, as they are only pointing to issues we require for BC reasons

Am I understanding this correctly?

@szepeviktor
Copy link
Contributor

Am I understanding this correctly?

YESS!!

Co-authored-by: Alain Schlesser <alain.schlesser@gmail.com>
@lewart3
Copy link
Author

lewart3 commented Feb 7, 2024

@schlessera , allow me to address your second point:

  • HOWEVER, it also therefore drops compatibility with older Debian releases

This is what you are hearing, but it is not true.
The Workflow, which includes PHP 5.6, passed.

@schlessera
Copy link
Member

@lewart3 This is not about staying compatible with PHP 5.6, but rather about the package staying compatible with the earliest version of Debian that supports PHP 5.6 and with its entire package ecosystem.

@lewart3
Copy link
Author

lewart3 commented Feb 7, 2024

@schlessera , I installed it, with some difficulty, on Debian 8.11 (jessie).

$ cat go
#!/bin/sh
set -x
dpkg -l base-files
sudo dpkg --force-depends -i php-wpcli_2.9.1_all.deb
sudo apt-get --fix-broken -y install
wp cli version
wp cli info

$ ./go
+ dpkg -l base-files
Desired=Unknown/Install/Remove/Purge/Hold
| Status=Not/Inst/Conf-files/Unpacked/halF-conf/Half-inst/trig-aWait/Trig-pend
|/ Err?=(none)/Reinst-required (Status,Err: uppercase=bad)
||/ Name Version Architecture Description
+++-==============================-====================-====================-==================================================================
ii base-files 8+deb8u11 amd64 Debian base system miscellaneous files

+ sudo dpkg --force-depends -i php-wpcli_2.9.1_all.deb
Selecting previously unselected package php-wpcli.
(Reading database ... 31141 files and directories currently installed.)
Preparing to unpack php-wpcli_2.9.1_all.deb ...
Unpacking php-wpcli (2.9.0) ...
dpkg: php-wpcli: dependency problems, but configuring anyway as you requested:
php-wpcli depends on php-cli | php5-cli (>= 5.6); however:
Package php-cli is not installed.
Package php5-cli is not installed.
php-wpcli depends on php-mysql | php-mysqlnd | php5-mysql; however:
Package php-mysql is not installed.
Package php-mysqlnd is not installed.
Package php5-mysql is not installed.
php-wpcli depends on default-mysql-client | virtual-mysql-client; however:
Package default-mysql-client is not installed.
Package virtual-mysql-client is not installed.

Setting up php-wpcli (2.9.0) ...
Processing triggers for man-db (2.7.0.2-5) ...

+ sudo apt-get --fix-broken -y install
Reading package lists... Done
Building dependency tree
Reading state information... Done
Correcting dependencies... Done
The following extra packages will be installed:
libdbd-mysql-perl libdbi-perl libmysqlclient18 libonig2 libperl4-corelibs-perl libqdbm14 libterm-readkey-perl lsof mysql-client-5.5
mysql-common php5-cli php5-common php5-json php5-mysql php5-readline
Suggested packages:
libclone-perl libmldbm-perl libnet-daemon-perl libsql-statement-perl php-pear php5-user-cache
The following NEW packages will be installed:
libdbd-mysql-perl libdbi-perl libmysqlclient18 libonig2 libperl4-corelibs-perl libqdbm14 libterm-readkey-perl lsof mysql-client-5.5
mysql-common php5-cli php5-common php5-json php5-mysql php5-readline
0 upgraded, 15 newly installed, 0 to remove and 0 not upgraded.
Need to get 0 B/7,173 kB of archives.
After this operation, 55.9 MB of additional disk space will be used.
Selecting previously unselected package mysql-common.
(Reading database ... 31147 files and directories currently installed.)
Preparing to unpack .../mysql-common_5.5.62-0+deb8u1_all.deb ...
Unpacking mysql-common (5.5.62-0+deb8u1) ...
Selecting previously unselected package libmysqlclient18:amd64.
Preparing to unpack .../libmysqlclient18_5.5.62-0+deb8u1_amd64.deb ...
Unpacking libmysqlclient18:amd64 (5.5.62-0+deb8u1) ...
Selecting previously unselected package libonig2:amd64.
Preparing to unpack .../libonig2_5.9.5-3.2+deb8u4_amd64.deb ...
Unpacking libonig2:amd64 (5.9.5-3.2+deb8u4) ...
Selecting previously unselected package libperl4-corelibs-perl.
Preparing to unpack .../libperl4-corelibs-perl_0.003-1_all.deb ...
Unpacking libperl4-corelibs-perl (0.003-1) ...
Selecting previously unselected package lsof.
Preparing to unpack .../lsof_4.86+dfsg-1_amd64.deb ...
Unpacking lsof (4.86+dfsg-1) ...
Selecting previously unselected package libdbi-perl.
Preparing to unpack .../libdbi-perl_1.631-3+b1_amd64.deb ...
Unpacking libdbi-perl (1.631-3+b1) ...
Selecting previously unselected package libdbd-mysql-perl.
Preparing to unpack .../libdbd-mysql-perl_4.028-2+deb8u2_amd64.deb ...
Unpacking libdbd-mysql-perl (4.028-2+deb8u2) ...
Selecting previously unselected package libqdbm14.
Preparing to unpack .../libqdbm14_1.8.78-5+b1_amd64.deb ...
Unpacking libqdbm14 (1.8.78-5+b1) ...
Selecting previously unselected package libterm-readkey-perl.
Preparing to unpack .../libterm-readkey-perl_2.32-1+b1_amd64.deb ...
Unpacking libterm-readkey-perl (2.32-1+b1) ...
Selecting previously unselected package mysql-client-5.5.
Preparing to unpack .../mysql-client-5.5_5.5.62-0+deb8u1_amd64.deb ...
Unpacking mysql-client-5.5 (5.5.62-0+deb8u1) ...
Selecting previously unselected package php5-common.
Preparing to unpack .../php5-common_5.6.40+dfsg-0+deb8u12_amd64.deb ...
Unpacking php5-common (5.6.40+dfsg-0+deb8u12) ...
Selecting previously unselected package php5-json.
Preparing to unpack .../php5-json_1.3.6-1_amd64.deb ...
Unpacking php5-json (1.3.6-1) ...
Selecting previously unselected package php5-cli.
Preparing to unpack .../php5-cli_5.6.40+dfsg-0+deb8u12_amd64.deb ...
Unpacking php5-cli (5.6.40+dfsg-0+deb8u12) ...
Selecting previously unselected package php5-mysql.
Preparing to unpack .../php5-mysql_5.6.40+dfsg-0+deb8u12_amd64.deb ...
Unpacking php5-mysql (5.6.40+dfsg-0+deb8u12) ...
Selecting previously unselected package php5-readline.
Preparing to unpack .../php5-readline_5.6.40+dfsg-0+deb8u12_amd64.deb ...
Unpacking php5-readline (5.6.40+dfsg-0+deb8u12) ...
Processing triggers for man-db (2.7.0.2-5) ...
Setting up mysql-common (5.5.62-0+deb8u1) ...
Setting up libmysqlclient18:amd64 (5.5.62-0+deb8u1) ...
Setting up libonig2:amd64 (5.9.5-3.2+deb8u4) ...
Setting up libperl4-corelibs-perl (0.003-1) ...
Setting up lsof (4.86+dfsg-1) ...
Setting up libdbi-perl (1.631-3+b1) ...
Setting up libdbd-mysql-perl (4.028-2+deb8u2) ...
Setting up libqdbm14 (1.8.78-5+b1) ...
Setting up libterm-readkey-perl (2.32-1+b1) ...
Setting up mysql-client-5.5 (5.5.62-0+deb8u1) ...
Setting up php5-common (5.6.40+dfsg-0+deb8u12) ...

Creating config file /etc/php5/mods-available/pdo.ini with new version
php5_invoke: Enable module pdo for cli SAPI

Creating config file /etc/php5/mods-available/opcache.ini with new version
php5_invoke: Enable module opcache for cli SAPI
Setting up php5-json (1.3.6-1) ...
php5_invoke: Enable module json for cli SAPI
Setting up php5-cli (5.6.40+dfsg-0+deb8u12) ...
update-alternatives: using /usr/bin/php5 to provide /usr/bin/php (php) in auto mode
update-alternatives: using /usr/bin/phar5 to provide /usr/bin/phar (phar) in auto mode

Creating config file /etc/php5/cli/php.ini with new version
Setting up php5-mysql (5.6.40+dfsg-0+deb8u12) ...

Creating config file /etc/php5/mods-available/mysql.ini with new version
php5_invoke: Enable module mysql for cli SAPI

Creating config file /etc/php5/mods-available/mysqli.ini with new version
php5_invoke: Enable module mysqli for cli SAPI

Creating config file /etc/php5/mods-available/pdo_mysql.ini with new version
php5_invoke: Enable module pdo_mysql for cli SAPI
Setting up php5-readline (5.6.40+dfsg-0+deb8u12) ...

Creating config file /etc/php5/mods-available/readline.ini with new version
php5_invoke: Enable module readline for cli SAPI
Processing triggers for libc-bin (2.19-18+deb8u10) ...

+ wp cli version
WP-CLI 2.9.0

+ wp cli info
OS: Linux debian 3.16.0-11-amd64 #1 SMP Debian 3.16.84-1 (2020-06-09) x86_64
Shell: /bin/bash
PHP binary: /usr/bin/php5
PHP version: 5.6.40-0+deb8u12
php.ini used: /etc/php5/cli/php.ini
MySQL binary: /usr/bin/mysql
MySQL version: mysql Ver 14.14 Distrib 5.5.62, for debian-linux-gnu (x86_64) using readline 6.3
SQL modes:
WP-CLI root dir: phar://wp-cli.phar/vendor/wp-cli/wp-cli
WP-CLI vendor dir: phar://wp-cli.phar/vendor
WP_CLI phar path: /home/user
WP-CLI packages dir:
WP-CLI cache dir: /home/user/.wp-cli/cache
WP-CLI global config:
WP-CLI project config:
WP-CLI version: 2.9.0

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Lintian reports php-wpcli_2.9.0_all.deb has two errors
5 participants