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

php/composer: turn into meta package as 7.4 is EOL; php8.[01] and composer8.[01]: add alternatives groups. #38536

Merged
merged 7 commits into from Mar 4, 2023

Conversation

TinfoilSubmarine
Copy link
Contributor

@TinfoilSubmarine TinfoilSubmarine commented Aug 8, 2022

Should not be merged until PHP 7.4 EOL (28 Nov 2022): https://www.php.net/supported-versions.php

Testing the changes

  • I tested the changes in this PR: YES

Packages depending on php:

Packages depending on php-gd:

Packages depending on php-mysql:

Packages with php-devel in *makedepends:

  • libguestfs (configures and compiles fine with 8.1, but php is not enabled by default anyway)

Other things to take care of:

  • php-pear

@paper42
Copy link
Member

paper42 commented Aug 8, 2022

I think this is a bit too fragile and we should wait with this for php 7.4 EOL which should be in November. Which /usr/bin/php gets chosen when the user has php (7) and php8.0 installed? Are we sure it always works as expected and won't break the setup for some users who rely on /usr/bin/php being php7, etc?

@Chocimier
Copy link
Member

It does not work correctly:

before:

composer --version
Composer version 2.2.4 2022-01-08 12:30:42

after:

composer --version
PHP 7.4.30 (cli) (built: Aug  9 2022 17:56:39) ( NTS )
Copyright (c) The PHP Group

composer -h       
Usage: php [options] [-f] <file> [--] [args...]

@TinfoilSubmarine
Copy link
Contributor Author

It does not work correctly:

before:

composer --version
Composer version 2.2.4 2022-01-08 12:30:42

after:

composer --version
PHP 7.4.30 (cli) (built: Aug  9 2022 17:56:39) ( NTS )
Copyright (c) The PHP Group

composer -h       
Usage: php [options] [-f] <file> [--] [args...]

Should be fixed, I dropped the -f from /usr/bin/composer${_php_version}

@TinfoilSubmarine TinfoilSubmarine changed the title php/php8.0/php8.1 and composer/composer8.0/composer8.1: add alternatives groups. [NOMERGE] php/composer: turn into meta package as 7.4 is EOL; php8.[01] and composer8.[01]: add alternatives groups. Aug 29, 2022
@TinfoilSubmarine
Copy link
Contributor Author

So, the one thing that I'm unsure of is for composer. Currently, there is a package for each PHP version with a shim script to invoke composer with the right interpreter:

php8.0 /usr/libexec/composer.phar8.0 "$@"

php8.1 /usr/libexec/composer.phar8.1 "$@"

This could also be handled by having a single composer package with the shim script, but call php which is handled by alternatives. But I think that may be confusing since it isn't as explicit.

@TinfoilSubmarine TinfoilSubmarine changed the title [NOMERGE] php/composer: turn into meta package as 7.4 is EOL; php8.[01] and composer8.[01]: add alternatives groups. [WIP] [NOMERGE] php/composer: turn into meta package as 7.4 is EOL; php8.[01] and composer8.[01]: add alternatives groups. Aug 29, 2022
@TinfoilSubmarine
Copy link
Contributor Author

So, the one thing that I'm unsure of is for composer. Currently, there is a package for each PHP version with a shim script to invoke composer with the right interpreter:

php8.0 /usr/libexec/composer.phar8.0 "$@"

php8.1 /usr/libexec/composer.phar8.1 "$@"

This could also be handled by having a single composer package with the shim script, but call php which is handled by alternatives. But I think that may be confusing since it isn't as explicit.

After thinking about this, I think that it's best to keep the separate composer packages, since collapsing into one and relying on xbps-alternatives to choose a php version restricts the utility of having alternatives in the first place. If I want to have both a PHP 8.0 and 8.1 installation on a single machine, I would still like to be able to use composer with both 8.0 and 8.1.

srcpkgs/composer/template Outdated Show resolved Hide resolved
@paper42
Copy link
Member

paper42 commented Nov 27, 2022

I think it would be nice to make every package depend on a specific version that's the last supported one.

@TinfoilSubmarine TinfoilSubmarine changed the title [WIP] [NOMERGE] php/composer: turn into meta package as 7.4 is EOL; php8.[01] and composer8.[01]: add alternatives groups. php/composer: turn into meta package as 7.4 is EOL; php8.[01] and composer8.[01]: add alternatives groups. Nov 28, 2022
@TinfoilSubmarine TinfoilSubmarine marked this pull request as ready for review November 28, 2022 20:01
@TinfoilSubmarine
Copy link
Contributor Author

Anything else needed for this? 7.4 is officially EOL now

srcpkgs/composer8.1/template Outdated Show resolved Hide resolved
srcpkgs/php8.0/template Outdated Show resolved Hide resolved
srcpkgs/php8.0/template Outdated Show resolved Hide resolved
srcpkgs/xdebug8.1/template Outdated Show resolved Hide resolved
php-fpm_package() {
depends="${sourcepkg}-fpm"
build_style=meta
short_desc="PHP FastCGI Process Manager meta package"
Copy link
Member

Choose a reason for hiding this comment

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

I can imagine that people will be confused by these meta packages a bit - they will install php-fpm, enable the php8.1-fpm service and then on an update php will be updated to 8.2 and php-fpm will be orphaned and removed. Do you think we could somehow clarify that php-* packages will move in short_desc or even as a page in void-docs?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I think something like that could be helpful. Probably want a page since it's fairly easy to miss a short_desc if you just do xi php-fpm. Reminds me of #38306

Copy link
Contributor Author

Choose a reason for hiding this comment

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

srcpkgs/php-meta/template Outdated Show resolved Hide resolved
srcpkgs/php8.1/template Outdated Show resolved Hide resolved
@paper42 paper42 merged commit 4e83b32 into void-linux:master Mar 4, 2023
@jchook
Copy link
Contributor

jchook commented Apr 8, 2023

@TinfoilSubmarine thank you very much my man. Very appreciative of this much-needed change! Also very educational to read the PR as well.

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

Successfully merging this pull request may close these issues.

None yet

4 participants