Re: Setting of DEFAULT_VERSIONS of php and poudriere's ports compilation woes in my setup
Date: Sun, 03 Dec 2023 15:48:12 UTC
Guido Falsi <mad@madpilot.net> wrote: > On 02/12/23 21:37, Michael Grimm wrote: >> Hi, >> I am following the git repository for ports and using poudriere to compile those. >> Today I stumbled over: >> 20231125: >> AFFECTS: users of lang/php81 >> AUTHOR: bofh@FreeBSD.org >> The default version of PHP has been switched from 8.1 to 8.2. >> […] >> I had had the following definition for default php version in my poudriere make.conf: >> DEFAULT_VERSIONS+= php=81 […] >> Now, I *removed* 'php=81' from DEFAULT_VERSIONS and ended up with the following errors from poudriere: >> Warning: (local/wpm): Error: local/wpm depends on nonexistent origin 'lang/php8.2-extensions'; >> Please contact maintainer of the port to fix this. >> Warning: (mail/roundcube@php8.2): Error: Invalid FLAVOR 'php8.2' for mail/roundcube >> Error: Fatal errors encountered gathering ports metadata >> Understandable to me because all relevant ports are named as 'php82'... >> I do have that local port local/wpm defined as follows: >> […] >> RUN_DEPENDS+= php${ }-extensions>0:${PORTSDIR}/lang/php${PHP_DEFAULT}-extensions >> RUN_DEPENDS+= roundcube-php${PHP_DEFAULT}>0:${PORTSDIR}/mail/roundcube@php${PHP_DEFAULT} >> […] >> Adding 'DEFAULT_VERSIONS+= php=82 […]' to my poudriere make.conf resolves this issue. >> It looks like $PHP_DEFAULT in port definition without 'DEFAULT_VERSIONS+= php=82' in make.conf translates to an erroneous 'php8.2' and runs into errors. >> Whereas the explicit definition of 'DEFAULT_VERSIONS+= php=82' in make.conf is resulting in a $PHP_DEFAULT translating to 'php82' which successfully compiles those ports without complaints. >> I really don't understand what I am doing wrong. And I would appreciate if someone could explain it to me. > > AFAIK to depend on php components younshould leverage USES=php, and define the actual required modules in USE_PHP. > > If your port only works with some PHP versions you should list the unsupported ones in IGNORE_WITH_PHP. > > Depending on php-extensions is not really good practice, since what is actually installed by it depends on options. It really is just a convenience metaport for final users. > > Anyway PHP_DEFAULT is defined in the framework Makefiles, so to use that variable you need to put it after ".include <bsd.port.pre.mk>". But I don't think that's the best strategy, you'd be better off leveraging USES=php and flavorizing your port, using PHP_VER. > > Not many live examples in the ports tree, but maybe you can find some inspiration in some of these Makefiles: > > databases/pear-DoctrineDBAL/Makefile > devel/php-composer/Makefile > > Hope this information helps. Yes, it helped a lot in understanding the backgrounds and thus solving my issue. Thanks for that! FYI: local/wpm serves as a metaport for all essential ports running in one of my service jails FTR: I ended up in adding USES=python and using the correct variable PHP_VER instead of PHP_VERSION # USES needed to follow default PHP versions USES= php […] RUN_DEPENDS+= php${PHP_VER}-extensions>0:${PORTSDIR}/lang/php${PHP_VER}-extensions RUN_DEPENDS+= roundcube-php${PHP_VER}>0:${PORTSDIR}/mail/roundcube@php${PHP_VER} […] In addition I did reduce those ports activated in php extensions to the bare minimum needed in this service jail. Thanks again and regards, Michael