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 ?
(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.
To cite mat's Mail: https://lists.freebsd.org/pipermail/svn-ports-all/2020-February/243379.html The order is BUILD, then RUN, see https://www.freebsd.org/doc/en/books/porters-handbook/porting-order.html
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
Can you try this patch instead: https://www.marcuscom.com/~jclarke/portlint.pl.diff
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
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
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
(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.
Ports mgmt team, have a look at Comments 7 and 8 below. Is this something that portmgr can do as a blanket commit?
Can you be a bit more explicit about what you are talking about? The order in the Makefile is : BUILD_DEPENDS= foo RUN_DEPENDS= bar If you need the same build and run depends, you can write : BUILD_DEPENDS= ${RUN_DEPENDS} RUN_DEPENDS= foo
Use-before-define is perfectly valid in make syntax, so I'm not sure what we'd gain by shoehorning Makefiles to look more like valid syntax in other languages. I completely agree that it looks strange, but it's a valid pattern. My take is that it's probably more incumbent upon portlint to recognize the valid syntactic pattern than it is for us to mandate what in some ways amounts to an anti-pattern.
In Comment 4, I propose a patch to do just that, Adam. Sounds like I may have to go ahead with that.
I don't like the wording of your patch at all. It leaves a feeling that the user is doing something wrong, which they are not. I do not know how portlint evaluates the Makefile, but if, as it seems, it is trying to parse it line by line, it is really doing it wrong. In any way, if a message is to be outputted at all, as saying something is probably wrong because the syntax is perfectly correct, it should be something like this: > OK: $j refers to $1 (declared later), skipping checks. make(1) does lazy evaluations of variables, it means that you can order them in whatever order you want, until they are used by a control structure (.if/.for/...), their content is not actually evaluated.
Thanks for the comments. I have updated the wording to make this allowable and I no longer flag it as an error.