Is "/usr/ports/devel/pkgconf" misconfigured?

In the course of make walking the dependency tree of a port it comes to devel/pkgconf and promptly stops with the following error:

kyua-0.13_9,3 kyua from base must be used for FreeBSD 14.x and newer.

When I cat the Makefile for pkgconf I get (note TEST_DEPENDS variable):

Code:
:/usr/ports/devel/pkgconf # cat Makefile 
PORTNAME=       pkgconf
PORTVERSION=    2.3.0
PORTEPOCH=      1
CATEGORIES=     devel
MASTER_SITES=   https://distfiles.ariadne.space/${PORTNAME}/

# NOTE: before committing to this port, contact portmgr to arrange for an
# experimental ports run.  Untested commits may be backed out at portmgr's
# discretion.
MAINTAINER=     bapt@FreeBSD.org
COMMENT=        Utility to help to configure compiler and linker flags
WWW=            https://gitea.treehouse.systems/ariadne/${PORTNAME}

LICENSE=        ISCL

TEST_DEPENDS=   kyua:devel/kyua

USES=           cpe tar:xz libtool pathfix
GNU_CONFIGURE=  yes
GNU_CONFIGURE_MANPREFIX=${PREFIX}/share
INSTALL_TARGET= install-strip
USE_LDCONFIG=   yes
TEST_TARGET=    check
CONFIGURE_ARGS= --with-pkg-config-dir=${PREFIX}/libdata/pkgconfig:/usr/libdata/pkgconfig:${PREFIX}/share/pkgconfig \
                --with-system-libdir=/usr/lib \
                --with-system-includedir=/usr/include

OPTIONS_DEFINE= DOCS

TESTING_UNSAFE= tests/Kyuafile:5: Non-existent test program 'tests/basic'

post-install:
        ${LN} -sf pkgconf ${STAGEDIR}${PREFIX}/bin/pkg-config

.include <bsd.port.mk>

15.6 of the handbook says that everything in the list is "optional" which includes the variable "TEST_DEPENDS" so I feel like I could comment it out without any unintended consequences. Would that be a fair assessment?

Also, if kyua is to be used from base why is pkgconf referencing it as a port?
 
15.6 of the handbook says that everything in the list is "optional" which includes the variable "TEST_DEPENDS" so I feel like I could comment it out without any unintended consequences. Would that be a fair assessment?
devel/kyua/Makefile has the conditional below.
Makefile:
.include <bsd.port.pre.mk>

.if ${OPSYS} == FreeBSD && ${OSREL:R} >= 14
IGNORE=        kyua from base must be used for FreeBSD 14.x and newer
.endif

So I've created a patch below for devel/pkgconf.
Diff:
--- a/devel/pkgconf/Makefile
+++ b/devel/pkgconf/Makefile
@@ -13,7 +13,5 @@
 
 LICENSE=    ISCL
 
-TEST_DEPENDS=    kyua:devel/kyua
-
 USES=        cpe tar:xz libtool pathfix
 GNU_CONFIGURE=    yes
@@ -29,7 +27,13 @@
 
 TESTING_UNSAFE=    tests/Kyuafile:5: Non-existent test program 'tests/basic'
 
+.include <bsd.port.pre.mk>
+
+.if ${OPSYS} != FreeBSD || ${OSREL:R} < 14
+TEST_DEPENDS=    kyua:devel/kyua
+.endif
+
 post-install:
     ${LN} -sf pkgconf ${STAGEDIR}${PREFIX}/bin/pkg-config
 
-.include <bsd.port.mk>
+.include <bsd.port.post.mk>

Not yet tested, so need test before filing PR.
If no one file any PR for this after my local tests finished, I'll file it.
As I have no installed OS using ports other than FreeBSD, cannot proceed complete tests, though.

Also, if kyua is to be used from base why is pkgconf referencing it as a port?
As seen in the conditional of devel/kyua/Makefile and my patch, older releases/stables does not have kyua(1) in base. This would be simplified (maybe by the maintainer) once ALL versions not having kyua(1) in base are EoL'ed.

Note that, in my humble opinion, base or devel/kyua and devel/pkgconf shoule need some rework, because if base is built/installed with WITHOUT_TEST knob, kyua is NOT installed. Removing the knob from base or checking existense of /usr/bin/kyua in ports Makefile and warning not to use official pkg if the knob is in use would be needed.
 
Although devel/pkgconf is marked as TESTING_UNSAFE= tests/Kyuafile:5: Non-existent test program 'tests/basic', forcibly tried make test affter make on /usr/ports/devel/pkgconf, resulted in errors below.

Code:
===>  Testing for pkgconf-2.3.0,1
/usr/bin/make 
kyua --config=none test --kyuafile='./Kyuafile'  --build-root='.'
kyua: E: Load of 'Kyuafile' failed: Failed to load Lua file 'Kyuafile': Kyuafile:5: Load of 'tests/Kyuafile' failed: Failed to load Lua file 'tests/Kyuafile': tests/Kyuafile:5: Non-existent test program 'tests/basic'.
*** Error code 2

Stop.
make: stopped in /usr/ports/devel/pkgconf/work/pkgconf-2.3.0
*** Error code 1

Stop.
make: stopped in /usr/ports/devel/pkgconf

This would be the error which TESTING_UNSAFE= line means. So consider this OK here.

And trying several ports requiring devel/pkgconf no longer shows kyua-0.13_9,3 kyua from base must be used for FreeBSD 14.x and newer. error.
And as no one alredy filed PR for this, I'll file it shortly.
 
I know this is at risk of reaching whack-a-mole status but here is another one:

/usr/ports/mail/mlmmj

Code:
PORTNAME=       mlmmj
PORTVERSION=    1.4.7
CATEGORIES=     mail
MASTER_SITES=   https://codeberg.org/mlmmj/mlmmj/releases/download/RELEASE_${PORTVERSION:S/./_/g}/

MAINTAINER=     bapt@FreeBSD.org
COMMENT=        Simple and slim mailing list manager
WWW=            http://mlmmj.org/

LICENSE=        MIT
LICENSE_FILE=   ${WRKSRC}/LICENSE

USES=           cpe iconv shebangfix tar:xz pkgconfig
SHEBANG_FILES=  contrib/web/perl-user/mlmmj.cgi
GNU_CONFIGURE=  yes
CONFIGURE_ARGS= --enable-receive-strip
GNU_CONFIGURE_MANPREFIX=        ${PREFIX}/share

CPPFLAGS+=      -I${ICONV_INCLUDE_PATH}
LDFLAGS+=       ${ICONV_LIB_PATH}

OPTIONS_DEFINE=         DOCS PERL PHP
OPTIONS_SUB=            yes

PERL_RUN_DEPENDS=       p5-URI>0:net/p5-URI \
                        p5-CGI-FastTemplate>0:www/p5-CGI-FastTemplate \
                        p5-HTML-Parser>0:www/p5-HTML-Parser
PHP_USES=               php:web

TEST_DEPENDS=           kyua:devel/kyua \
                        atf-sh:devel/atf
TEST_TARGET=            check

post-install-DOCS-on:
        @${MKDIR} ${STAGEDIR}${DOCSDIR}
        (cd ${WRKSRC} && ${INSTALL_DATA} \
                ChangeLog FAQ README* TODO TUNABLES.md UPGRADE \
                ${STAGEDIR}${DOCSDIR})

post-install-PERL-on:
        @(cd ${WRKSRC}/contrib/web && ${COPYTREE_SHARE} "perl-*" \
                ${STAGEDIR}${WWWDIR})
        @${CHMOD} ${BINMODE} ${STAGEDIR}${WWWDIR}/perl-user/mlmmj.cgi

post-install-PHP-on:
        @(cd ${WRKSRC}/contrib/web && ${COPYTREE_SHARE} "php-*" \
                ${STAGEDIR}${WWWDIR})

.include <bsd.port.options.mk>

.if defined(WITH_TESTING)
CONFIGURE_ARGS+=        --enable-tests
.else
CONFIGURE_ARGS+=        --disable-tests
.endif

.include <bsd.port.mk>

T-Aoki, do you recommend the same Makefile edit?
 
I know this is at risk of reaching whack-a-mole status but here is another one:

/usr/ports/mail/mlmmj

Code:
PORTNAME=       mlmmj
PORTVERSION=    1.4.7
CATEGORIES=     mail
MASTER_SITES=   https://codeberg.org/mlmmj/mlmmj/releases/download/RELEASE_${PORTVERSION:S/./_/g}/

MAINTAINER=     bapt@FreeBSD.org
COMMENT=        Simple and slim mailing list manager
WWW=            http://mlmmj.org/

LICENSE=        MIT
LICENSE_FILE=   ${WRKSRC}/LICENSE

USES=           cpe iconv shebangfix tar:xz pkgconfig
SHEBANG_FILES=  contrib/web/perl-user/mlmmj.cgi
GNU_CONFIGURE=  yes
CONFIGURE_ARGS= --enable-receive-strip
GNU_CONFIGURE_MANPREFIX=        ${PREFIX}/share

CPPFLAGS+=      -I${ICONV_INCLUDE_PATH}
LDFLAGS+=       ${ICONV_LIB_PATH}

OPTIONS_DEFINE=         DOCS PERL PHP
OPTIONS_SUB=            yes

PERL_RUN_DEPENDS=       p5-URI>0:net/p5-URI \
                        p5-CGI-FastTemplate>0:www/p5-CGI-FastTemplate \
                        p5-HTML-Parser>0:www/p5-HTML-Parser
PHP_USES=               php:web

TEST_DEPENDS=           kyua:devel/kyua \
                        atf-sh:devel/atf
TEST_TARGET=            check

post-install-DOCS-on:
        @${MKDIR} ${STAGEDIR}${DOCSDIR}
        (cd ${WRKSRC} && ${INSTALL_DATA} \
                ChangeLog FAQ README* TODO TUNABLES.md UPGRADE \
                ${STAGEDIR}${DOCSDIR})

post-install-PERL-on:
        @(cd ${WRKSRC}/contrib/web && ${COPYTREE_SHARE} "perl-*" \
                ${STAGEDIR}${WWWDIR})
        @${CHMOD} ${BINMODE} ${STAGEDIR}${WWWDIR}/perl-user/mlmmj.cgi

post-install-PHP-on:
        @(cd ${WRKSRC}/contrib/web && ${COPYTREE_SHARE} "php-*" \
                ${STAGEDIR}${WWWDIR})

.include <bsd.port.options.mk>

.if defined(WITH_TESTING)
CONFIGURE_ARGS+=        --enable-tests
.else
CONFIGURE_ARGS+=        --disable-tests
.endif

.include <bsd.port.mk>

T-Aoki, do you recommend the same Makefile edit?
Yes, and a discussion is ongoing at PR 282831.
Some more ports are pointed out.
 
Back
Top