Bug 244239 - ports-mgmt/portlint: strange output for security/p5-IO-Socket-SSL
Summary: ports-mgmt/portlint: strange output for security/p5-IO-Socket-SSL
Status: In Progress
Alias: None
Product: Ports & Packages
Classification: Unclassified
Component: Individual Port(s) (show other bugs)
Version: Latest
Hardware: Any Any
: --- Affects Only Me
Assignee: freebsd-ports-bugs (Nobody)
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2020-02-20 08:33 UTC by Kurt Jaeger
Modified: 2020-05-07 15:17 UTC (History)
3 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Kurt Jaeger freebsd_committer 2020-02-20 08:33:58 UTC
This looks wrong:

$ cd security/p5-IO-Socket-SSL
$ portlint -AC
WARN: Makefile: for new port, make $FreeBSD$ tag in comment section empty, to make SVN happy.
WARN: Makefile: no port directory /usr/ports/UIDN}_${ found, even though it is listed in BUILD_DEPENDS.
WARN: Makefile: no port directory /usr/ports/UIPV6}_${ found, even though it is listed in BUILD_DEPENDS.

Any ideas on how to fix this ?
Comment 1 Mikael Urankar freebsd_committer 2020-02-20 10:20:35 UTC
(In reply to Kurt Jaeger from comment #0)
reverse the order of RUN_DEPENDS and BUILD_DEPENDS:

--- Makefile    (revision 526484)
+++ Makefile    (working copy)
@@ -14,9 +14,9 @@
 LICENSE_COMB=  dual
 LICENSE_FILE=  ${WRKSRC}/lib/IO/Socket/SSL.pod
 
-BUILD_DEPENDS= ${RUN_DEPENDS}
 RUN_DEPENDS=   p5-Net-SSLeay>=1.59:security/p5-Net-SSLeay \
                p5-Mozilla-CA>=20130114:www/p5-Mozilla-CA
+BUILD_DEPENDS= ${RUN_DEPENDS}
 
 NO_ARCH=       yes
 USES=          perl5 shebangfix



portlint -AC
WARN: Makefile: for new port, make $FreeBSD$ tag in comment section empty, to make SVN happy.
WARN: Consider to set DEVELOPER=yes in /etc/make.conf
0 fatal errors and 2 warnings found.
Comment 3 Sergei Vyshenski 2020-05-03 00:41:17 UTC
Hi,

A note for discussion.

Subroutine of /usr/local/bin/portlint named
sub get_makevar_shallow {}
forms argument list for "make" as follows (see line 3821):

$cmd = join(' -dV -V ', "make $makeenv MASTER_SITE_BACKUP=''", map { "'$_'" } @_);

which causes exactly reported garbage:

$ cd /usr/ports/security/p5-IO-Socket-SSL
$ make MASTER_SITE_BACKUP='' -dV -V 'RUN_DEPENDS'
p5-Net-SSLeay>=1.59:security/p5-Net-SSLeay  p5-Mozilla-CA>=20130114:www/p5-Mozilla-CA ${${:UIDN}_${:URUN}_DEPENDS} ${${:UIPV6}_${:URUN}_DEPENDS} ${PERL5_DEPEND}:lang/${PERL_PORT}
$ portling -AC
WARN: Makefile: for new port, make $FreeBSD$ tag in comment section empty, to make SVN happy.
WARN: Makefile: no port directory /usr/ports/UIPV6}_${ found, even though it is listed in BUILD_DEPENDS.
0 fatal errors and 2 warnings found.

The "-dV" flag for make suppresses variable expansion, and seems irrelevant for the ports with conditional dependency list. 
If this flag is omitted from line 3821 of /usr/local/bin/portlint, that is:

$cmd = join(' -V ', "make $makeenv MASTER_SITE_BACKUP=''", map { "'$_'" } @_);

the garbage is gone:

$ cd /usr/ports/security/p5-IO-Socket-SSL
$ make MASTER_SITE_BACKUP='' -V 'RUN_DEPENDS'
p5-Net-SSLeay>=1.59:security/p5-Net-SSLeay  p5-Mozilla-CA>=20130114:www/p5-Mozilla-CA p5-URI>=1.50:net/p5-URI p5-IO-Socket-INET6>0:net/p5-IO-Socket-INET6 perl5>=5.30.r1<5.31:lang/perl5.30
$ portling -AC
WARN: Makefile: for new port, make $FreeBSD$ tag in comment section empty, to make SVN happy.
0 fatal errors and 1 warning found.

Sorry for slow thinking, and not sure though if the proposed change fits for the rest of the world.

Regards, Sergei
Comment 4 Joe Marcus Clarke freebsd_committer 2020-05-04 17:22:37 UTC
Can you try this patch instead:

https://www.marcuscom.com/~jclarke/portlint.pl.diff
Comment 5 Sergei Vyshenski 2020-05-04 21:54:43 UTC
Markus,

Yes, at first it complains as: 
FATAL: Makefile: BUILD_DEPENDS points to RUN_DEPENDS which has not yet been defined.
And after changing order of BUILD_ and RUN_ lines, it becomes happy.
Which violates point 15.6. "The Dependencies Block" of Porter's Handbook.

The variables are:
    FETCH_DEPENDS
    EXTRACT_DEPENDS
    PATCH_DEPENDS
    BUILD_DEPENDS
    LIB_DEPENDS
    RUN_DEPENDS
    TEST_DEPENDS

And lots of ports are going to make it FATAL now?

Regards, Sergei
Comment 6 Joe Marcus Clarke freebsd_committer 2020-05-05 21:14:49 UTC
Thanks for the feedback, Sergei.  Yeah, I agree re-ordering the dependencies is wrong.  Seems lots of Perl ports do this reverse declaration (which bugs me, but with the way make expands things, it works).  What about this diff (same URL as above, so refresh).

https://www.marcuscom.com/~jclarke/portlint.pl.diff
Comment 7 Sergei Vyshenski 2020-05-06 02:16:23 UTC
Marcus,

This time portlint becomes very tolerant to 
1) order of RUN_ and BUILD_ , and to 
2) "use then assign" for variables.

Point 2 is too common of practice in typical Makefile of port (consider include of bsd.port.mk in the last section of Makefile), and moreover - inside typical Mk/*.mk.

What do you think of demanding one of two reasonable approaches
(see 5.9.2. "RUN_DEPENDS" from Porter's Handbook),
each of which respects correct version of points 1) and 2) above:

(approach A) 
MY_DEPENDS=	...explicit list...
BUILD_DEPENDS=	${MY_DEPENDS}
RUN_DEPENDS=	${MY_DEPENDS}

(approach B)
BUILD_DEPENDS=	...explicit list for build...
RUN_DEPENDS=	...explicit list for run...

As for Perl ports which you mention, maybe they could be promoted to a new standards via automatic blanket commit?

Regards, Sergei
Comment 8 Joe Marcus Clarke freebsd_committer 2020-05-07 15:17:34 UTC
(In reply to Sergei Vyshenski from comment #7)

I like the MY_DEPENDS approach, but this would need portmgr buy-in to do a sweeping change.  That said, I don't see anything wrong per se in my patch.  The underlying checks are still there for other variables, and the explicit setting of RUN_DEPENDS to BUILD_DEPENDS (error) still holds.