tech-pkg archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

Re: php multiversion sets PKG_SYSCONFSUBDIR (I think wrongly)



Greg Troxel <gdt%lexort.com@localhost> writes:

> I found that zoneminder was broken, and tracked it down to in
> lang/php/phpversion.mk:
>
>   PKG_SYSCONFSUBDIR?=     php/${PHP_API_VERS}
>
> I think this is incorrect, as a package shouldn't get its sysconfdir
> changed just because it's using php.
>
> I avoided zoneminder being configured for the wrong conf directory by
> setting PKG_SYSCONFSUBDIR in the zoneminder Makefile before including
> php, but I think this line should be removed -- and I don't know where
> it needs to go instead.
>
> While it feels like a big change at end of freeze, I think it is likely
> to break other packages at runtime, even if they build ok, so I believe
> we should fix it now.

Reading code a bit, I now think:

  - lang/phpNN must have PKG_SYSCONFSUBDIR set

  - php modules (lang/php/ext.mk) must have PKG_SYSCONFSUBDIR set

  - other packages that include phpversion.mk MUST NOT have
    PKG_SYSCONFSUBDIR set

and that this can be done by moving the line from phpversion.mk to
common.mk.  Arguably PHP_EXTENSION_DIR should move too as it doesn't
make sense for a php-using program to have that variable but I am
steering to minimal fix.

I'm starting to test this now but IANA php expert. 

Rebuilding php82 and php82-gd resulted in no change to PKG_SYSCONFDIR
(in +BUILD_INFO).  Rebuilding php82-nextcloud changed  it from

  PKG_SYSCONFDIR=/usr/pkg/etc/php/8.2

to

  PKG_SYSCONFDIR=/usr/pkg/etc


which I would say is better, even if nextcloud doesn't use the variable.


What do the assembled php people think?   I am thinking that if we
don't get comments soon I should commit this, maybe say tomorrow after
12Z, but this may get decided offline by me, taca@, maya@, it really
being maya@'s call.




Index: lang/php/common.mk
===================================================================
RCS file: /cvsroot/pkgsrc/lang/php/common.mk,v
retrieving revision 1.13
diff -u -p -r1.13 common.mk
--- lang/php/common.mk	8 Feb 2025 02:56:24 -0000	1.13
+++ lang/php/common.mk	26 Mar 2025 22:45:58 -0000
@@ -18,4 +18,7 @@ EXTRACT_SUFX?=		.tar.xz
 HOMEPAGE?=		https://www.php.net/
 
 .include "../../lang/php/phpversion.mk"
+
+PKG_SYSCONFSUBDIR?=	php/${PHP_API_VERS}
+
 .endif	# PHPCOMMON_MK
Index: lang/php/phpversion.mk
===================================================================
RCS file: /cvsroot/pkgsrc/lang/php/phpversion.mk,v
retrieving revision 1.459
diff -u -p -r1.459 phpversion.mk
--- lang/php/phpversion.mk	14 Mar 2025 15:27:16 -0000	1.459
+++ lang/php/phpversion.mk	26 Mar 2025 22:45:58 -0000
@@ -218,8 +218,6 @@ PHP_SHAREDIR=		share/php/${PHP_API_VERS}
 
 PHP_EXTENSION_DIR=	${PHP_LIBDIR}/${MACHINE_GNU_ARCH}
 
-PKG_SYSCONFSUBDIR?=	php/${PHP_API_VERS}
-
 MAKE_ENV+=		PHP_VERSION_REQD="${PHP_VER}" \
 			PHP_VER="${PHP_VER}" PHP_API_VERS="${PHP_API_VERS}" \
 			PHP_INCDIR="${PHP_INCDIR}" \


Home | Main Index | Thread Index | Old Index