Skip site navigation (1)Skip section navigation (2)
Date:      Sun, 3 Dec 2023 16:48:12 +0100
From:      Michael Grimm <trashcan@ellael.org>
To:        Guido Falsi <mad@madpilot.net>
Cc:        ports@freebsd.org
Subject:   Re: Setting of DEFAULT_VERSIONS of php and poudriere's ports compilation woes in my setup
Message-ID:  <DDC5A4EC-063D-467F-9DF4-F34BEC5E6AFE@ellael.org>
In-Reply-To: <abd31e68-f936-4cb4-97dd-839a0d213c8c@madpilot.net>
References:  <420DE888-DFEC-417F-B557-50FFCB416FB8@ellael.org> <abd31e68-f936-4cb4-97dd-839a0d213c8c@madpilot.net>

next in thread | previous in thread | raw e-mail | index | archive | help
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.
>> [=E2=80=A6]
>> I had had the following definition for default php version in my =
poudriere make.conf:
>> DEFAULT_VERSIONS+=3D php=3D81 [=E2=80=A6]
>> Now, I *removed* 'php=3D81' 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:
>> [=E2=80=A6]
>> RUN_DEPENDS+=3D php${ =
}-extensions>0:${PORTSDIR}/lang/php${PHP_DEFAULT}-extensions
>> RUN_DEPENDS+=3D =
roundcube-php${PHP_DEFAULT}>0:${PORTSDIR}/mail/roundcube@php${PHP_DEFAULT}=

>> [=E2=80=A6]
>> Adding 'DEFAULT_VERSIONS+=3D php=3D82 [=E2=80=A6]' to my poudriere =
make.conf resolves this issue.
>> It looks like $PHP_DEFAULT in port definition without =
'DEFAULT_VERSIONS+=3D php=3D82' in make.conf translates to an erroneous =
'php8.2' and runs into errors.
>> Whereas the explicit definition of 'DEFAULT_VERSIONS+=3D php=3D82' 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.
>=20
> AFAIK to depend on php components younshould leverage USES=3Dphp, and =
define the actual required modules in USE_PHP.
>=20
> If your port only works with some PHP versions you should list the =
unsupported ones in IGNORE_WITH_PHP.
>=20
> 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.
>=20
> 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=3Dphp and flavorizing your port, using PHP_VER.
>=20
> Not many live examples in the ports tree, but maybe you can find some =
inspiration in some of these Makefiles:
>=20
> databases/pear-DoctrineDBAL/Makefile
> devel/php-composer/Makefile
>=20
> 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=3Dpython and using the correct variable =
PHP_VER instead of PHP_VERSION

# USES needed to follow default PHP versions
	USES=3D php
	[=E2=80=A6]
	RUN_DEPENDS+=3D =
php${PHP_VER}-extensions>0:${PORTSDIR}/lang/php${PHP_VER}-extensions
	RUN_DEPENDS+=3D =
roundcube-php${PHP_VER}>0:${PORTSDIR}/mail/roundcube@php${PHP_VER}
	[=E2=80=A6]

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








Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?DDC5A4EC-063D-467F-9DF4-F34BEC5E6AFE>