You are not logged in.

#1 2022-08-21 20:12:25

rhinjard
Member
Registered: 2022-08-21
Posts: 3

composer without php8 dependency

Is there anyway to install composer without installing PHP8 as dependency? I use php7 from the community repo and wish not to install another version of php in my system.

Offline

#2 2022-08-21 21:03:28

mpan
Member
Registered: 2012-08-01
Posts: 1,208
Website

Re: composer without php8 dependency

Without introducing inconsistencies, that will bite later? No.

Packages extra/php and extra/php7 are not in conflict: they may be installed at the same time. So the cleanest method is to simply install them both, unless something breaks with both of them present. The old version exists for backward compatibility and, as Zend plans EOL of PHP 7.4 for this November, soon it should disappear.

Composer claims PHP 7.2.x support, so the other option is opening a feature request on Arch Bugtracker for extra/compose to replace hard “php” dependency with “php-interpreter>7.2”.

A third option is no longer safe, but quite clean as unsafe methods go: a fake dependency. I discourage you from doing so and provide this method only to avoid a situation in which someone else comes and offers it without any warning. Or gives even worse advice. Create your own package, let’s call it “fake-php8”, which has “php” in its `provides` array. The package would not install any actual files. That will satisfy pacman, while retaining database consistency, and Composer should also be happy. But the first attempt to install a package tha actually depends on a real extra/php will put you in trouble. You will experience either weird errors from pacman or the installed package will unexpectedly fail to work. Since you are going outside of what is officially supported, by doing so you are own your own.

Last edited by mpan (2022-08-21 21:20:53)


Sometimes I seem a bit harsh — don’t get offended too easily!

Offline

Board footer

Powered by FluxBB