FS#78028 - [nextcloud] 26.0.0 mixed php and php-legacy deps

Attached to Project: Community Packages
Opened by Lex Black (TrialnError) - Tuesday, 28 March 2023, 21:55 GMT
Last edited by David Runge (dvzrv) - Monday, 03 April 2023, 07:43 GMT
Task Type Bug Report
Category Packages
Status Closed
Assigned To Sergej Pupykin (sergej)
David Runge (dvzrv)
Architecture All
Severity Low
Priority Normal
Reported Version
Due in Version Undecided
Due Date Undecided
Percent Complete 100%
Votes 7
Private No

Details

Description:
Due to the php version shenanigans of nextcloud with the release of 8.x, my current setup changed to and is still using php-legacy back then.
But now if I want to install the updates now it wants to additionally install php and php-gd.

So it seems this
https://github.com/archlinux/svntogit-community/blob/d9f0657da70029f5d0413d61fb065b39ab6cae49/trunk/PKGBUILD#L130
didn't work as expected while packaging the new version?

Respective quote:
"""
local _dep_ver=""

_get_php_versions
depends=("php-interpreter<$_max_php")

# NOTE: this sets a custom php postfix based on whether php-legacy needs to be used
if [[ "$_php_interpreter" != *php ]]; then
_dep_ver="-legacy"
fi

depends+=("php$_dep_ver-gd")
"""
This task depends upon

Closed by  David Runge (dvzrv)
Monday, 03 April 2023, 07:43 GMT
Reason for closing:  Fixed
Additional comments about closing:  Fixed with nextcloud 26.0.0-2
Comment by Lex Black (TrialnError) - Tuesday, 28 March 2023, 22:01 GMT
Sorry for my english... I'm past sleep time >.> Hopefully it is still somewhat understandable

I forgot to add: Maybe the php-gd dep should be handled like the general php dep? Just a general version check and not if there should be -legacy present?

Edit: Oh, and I overlooked the optdepends. It's not only about php-gd. Currently nextcloud setups with php-legacy will install unneeded deps
Comment by Toolybird (Toolybird) - Tuesday, 28 March 2023, 22:21 GMT
Related  FS#77996 
Comment by Chih-Hsuan Yen (yan12125) - Wednesday, 29 March 2023, 11:07 GMT
A similar issue was mentioned at https://lists.archlinux.org/archives/list/arch-dev-public%40lists.archlinux.org/message/YPLGHFAV5X5EMMAIRRBRVMRB4E6ZFVZY/ some time ago, but not much discussions about this happened then.

> We should also be aware that using this approach might unexpectedly change the dependencies. E.g. if you build nextcloud today it will depend on php-legacy. If you build it in 6 month it might depend on the regular php package. When this happens, users might need to update their php.ini, web server and systemd services configuration.
Comment by Toolybird (Toolybird) - Thursday, 30 March 2023, 08:31 GMT
Dupe  FS#78042 
Comment by Markus (wolegis) - Thursday, 30 March 2023, 08:49 GMT
Allow me to cite myself from 78042 (as a motivation for hardcoding dependency on php-legacy):

Recently (2023-01-13) package nextcloud changed its dependency on PHP from package php to package php-legacy. This was for very good reasons as in the past it has happened more than once that Nextcloud was not compatible with the latest version of PHP. In all these cases this caused considerable pain for users (and also for maintainers of package nextcloud). With the dependency on package php-legacy this pain should have become a matter of the past.

[...]

Please publish an updated version of package nextcloud with dependeny on package php-legacy (not package php).

As a side note: The introduction of the dependency on package php-legacy caused considerable efforts for users to migrate their setups from package php (and related packages) to package php-legacy. I know this because as the main author of the wiki article about Nextcloud I was involved in quite some supporting and trouble shooting. Not to mention by own efforts in adapting the wiki article and additionally writing a migration guide there. So in case anyone had some kind of reason for the reintroduction of the dependency on package php: consider all the efforts this back and forth would cause.
Comment by Nimrod Maclomhair (nimrod_mack) - Thursday, 30 March 2023, 11:25 GMT
I would like to add that this actually *breaks* stuff, namely the /usr/bin/occ command, which now cannot find the proper interpreter and hence, the proper php configuration file anymore. (It can be fixed by env variables but still.)
Comment by Gunnar Bretthauer (Taijian) - Thursday, 30 March 2023, 15:27 GMT
Yes, please make nextcloud hard-depend of php-legacy, because having to switch around the whole setup every six months form php to php-legacy and back is just nuts!
Comment by Sergej Pupykin (sergej) - Thursday, 30 March 2023, 17:03 GMT
I believe that fixing https://bugs.archlinux.org/task/77996 also will fix this issue.
Comment by Chih-Hsuan Yen (yan12125) - Thursday, 30 March 2023, 17:19 GMT
> I believe that fixing https://bugs.archlinux.org/task/77996 also will fix this issue.

Maybe not completely. The occ issue mentioned above by Nimrod Maclomhair will likely persist.
Comment by Sergej Pupykin (sergej) - Thursday, 30 March 2023, 18:02 GMT
Yes, but he also mentioned env, which looks like solution

I've added on my machines:
```
# cat /etc/profile.d/nextcloud.sh
export NEXTCLOUD_PHP=php-legacy
export NEXTCLOUD_PHP_CONFIG=/etc/php-legacy/php.ini
```
Comment by Gunnar Bretthauer (Taijian) - Thursday, 30 March 2023, 19:33 GMT
Even if https://bugs.archlinux.org/task/77996 gets fixed, this will not change the fact that you somewhat ingenious scripting with php versions in the PKGBUILD will switch dependencies around between php and php-legacy every other major release.

So even then, nextcloud should not depend on either 'php' or 'php-legacy', but on 'php-interpreter<=whateveristhecurrentmaxsupportedversionbynextcloud' AND then you could just (opt-)depend on other php-* packages.

But the much easier solution would be to simply depend on php-legacy(-*) for everything with really no downside. I really do not understand why you refuse to make this really simple switch that would make all of our lives so much simpler.
Comment by Markus (wolegis) - Thursday, 30 March 2023, 19:45 GMT
I so strongly second Gunnar's statement. Just make package nextcloud depend on package php-legacy. As far as I understand package php-legacy was introduced exactly for cases like Nextcloud. I even suppose that the frequent hassles with Nextcloud not being compatible with the latest version of PHP was the main motivation for package php-legacy.
Comment by David Runge (dvzrv) - Thursday, 30 March 2023, 21:13 GMT
@TrialInError: Thanks for opening this ticket! I guess having php-gd still not resolved has been an oversight and should be fixed accordingly.
I will look into https://bugs.archlinux.org/task/77996 to have the split packages provide virtual dependencies as well, based on which we can have a more flexible dependency resolution.

@nimrod_mack: Please use the environment variable overrides for the occ command (as mentioned by Sergej in https://bugs.archlinux.org/task/78028#comment216732). That is what they are there for! :)
I am also open for making the legacy versions the default for the command (as the latest php is more likely to be the one not working from time to time).

@wolegis: The interpreter version dependencies are there for a reason: For people to be able to choose which one to use. Noone is required or forced to use php and can stay with php-legacy.

@Taijian: We are trying to provide a more flexible setup than just sticking with the legacy interpreter at all times. After all, we are a rolling release distribution. I hope you can appreciate that.
Comment by David Runge (dvzrv) - Thursday, 30 March 2023, 22:13 GMT
Updated versions of php, php-legacy and nextcloud are now in testing/community-testing.

Please have a look, test and give feedback here!
Comment by Chih-Hsuan Yen (yan12125) - Friday, 31 March 2023, 12:31 GMT
php-legacy and nextcloud work fine! Signed off.
Comment by Lex Black (TrialnError) - Friday, 31 March 2023, 19:44 GMT
With the packages from testing I could upgrade without a problem. So a virtual sign off from me :D
Maybe changes needed for the wiki page, as the occ script is now hardcoded for php-legacy?
Comment by Markus (wolegis) - Friday, 31 March 2023, 19:53 GMT
> Maybe changes needed for the wiki page, as the occ script is now hardcoded for php-legacy?

Rest assured I will update the wiki article as soon as my time allows to try out the packages from testing / community-testing.
Comment by Musikolo (Musikolo) - Friday, 31 March 2023, 20:08 GMT
Considering Arch is a rolling distro and nextcloud (and other pieces of software) have their own development life cycles, I think keeping nextcloud in sync with the latest version has traditionally been problematic. Past experience has shown numerous times that nextcloud only upgrades to the latest php version on major releases (eg. 25.x to 26.x), which causes a lot of pain and trouble for all Arch users. Because of this, we should consider the outcome of each combination:

- nextcloud + php: this would require freezing php upgrades until nextcloud is compatible with latest php version. This contravenes Arch rolling spirit and impacts all other php dependent packages. For this reason, it isn't a realistic option to me.
- nextcloud + php-legacy: this would make upgrades very straightforward and should never break.

I'm all for freedom, but offering php and php-legacy as optional dependencies of nextcloud will very often cause a lot of breakages (and complaints!) for the former. I don't see the point in offering php as an option given that we all know it will stop working every now and then.

Just wanted to share my thoughts about this matter and I hope there is something useful here.
Comment by Markus (wolegis) - Saturday, 01 April 2023, 21:27 GMT
deleted
Comment by trumee (trumee) - Sunday, 02 April 2023, 11:32 GMT
Tried to install from community-testing but ran into an error,

# pacman -S community-testing/nextcloud
resolving dependencies...
warning: cannot resolve "php-gd-interpreter<8.3", a dependency of "nextcloud"
:: The following package cannot be upgraded due to unresolvable dependencies:
nextcloud
Comment by Markus (wolegis) - Sunday, 02 April 2023, 14:20 GMT
@trumee: Probably you only have enabled community-testing, but not testing (which provides test packages of core and extra). Mind that order is relevant in pacman.conf. So in my case the relevant lines are:

[testing]
Include = /etc/pacman.d/mirrorlist

[core]
Include = /etc/pacman.d/mirrorlist

[extra]
Include = /etc/pacman.d/mirrorlist

[community-testing]
Include = /etc/pacman.d/mirrorlist

[community]
Include = /etc/pacman.d/mirrorlist
Comment by Markus (wolegis) - Sunday, 02 April 2023, 15:18 GMT
I did a fresh install on a VM with packages from testing & community-testing, opting for php-legacy. I can confirm the solution with dependency on meta package php-interpreter<8.3 and the resulting choice between php and php-legacy works fine. I haven't done an upgrade Nextcloud 25 => 26. This has to wait until package nextcloud 26.0.0-2 is available in community.

I've already prepared an updated version of the wiki article. https://wiki.archlinux.org/title/User:Wolegis/Nextcloud I will publish as soon package nextcloud 26.0.0-2 is available in community.
Comment by David Runge (dvzrv) - Sunday, 02 April 2023, 15:22 GMT
@wolegis: Thanks! That's some awesome news!

Will move the packages later today.

Loading...