NetBSD Problem Report #56352

From dholland@netbsd.org  Sun Aug  8 18:39:20 2021
Return-Path: <dholland@netbsd.org>
Received: from mail.netbsd.org (mail.netbsd.org [199.233.217.200])
	(using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits))
	(Client CN "mail.NetBSD.org", Issuer "mail.NetBSD.org CA" (not verified))
	by mollari.NetBSD.org (Postfix) with ESMTPS id EDD051A921F
	for <gnats-bugs@gnats.NetBSD.org>; Sun,  8 Aug 2021 18:39:19 +0000 (UTC)
Message-Id: <20210808183919.51D5584E5C@mail.netbsd.org>
Date: Sun,  8 Aug 2021 18:39:19 +0000 (UTC)
From: dholland@NetBSD.org
Reply-To: dholland@NetBSD.org
To: gnats-bugs@NetBSD.org
Subject: pkglint doesn't complain about invalid CFLAGS.mumble
X-Send-Pr-Version: 3.95

>Number:         56352
>Category:       pkg
>Synopsis:       pkglint doesn't complain about invalid CFLAGS.mumble
>Confidential:   no
>Severity:       serious
>Priority:       medium
>Responsible:    rillig
>State:          closed
>Class:          change-request
>Submitter-Id:   net
>Arrival-Date:   Sun Aug 08 18:40:00 +0000 2021
>Closed-Date:    Sun Aug 08 22:09:50 +0000 2021
>Last-Modified:  Sun Aug 08 22:09:50 +0000 2021
>Originator:     David A. Holland
>Release:        NetBSD 9.99.85 (20210623) pkgsrc 20210808 pkglint 21.2.1nb1
>Organization:
>Environment:
System: NetBSD valkyrie 9.99.85 NetBSD 9.99.85 (VALKYRIE) #7: Wed Jun 23 18:32:25 EDT 2021  dholland@valkyrie:/usr/src/sys/arch/amd64/compile/VALKYRIE amd64
Architecture: x86_64
Machine: amd64
>Description:

pkglint doesn't notice if you write CFLAGS.NebTSD+=foo. Shouldn't it
have a known list of platforms and compilers so it can flag typos like
this?

(also, it doesn't complain if you assign CFLAGS with = instead of +=;
I would have sworn it used to, but pkglint4 apparently doesn't either.
Should it? What about CFLAGS.mumble? This is more interesting for
CFLAGS.mumble than plain CFLAGS because flatly assigning CFLAGS is
likely to unconditionally break the build but per-target stuff can go
unnoticed.)

(all of the above also applies to LDFLAGS and LIBS and I think all the
other similar variables)

>How-To-Repeat:

Notice e.g. in games/neverball/Makefile:

   LDFLAGS.DragonFly=      -lX11 -lm
   LDFLAGS.SunOS+=         -lX11 -lm

Then run pkglint -Wall on it, try a bunch of stuff, become confused...

>Fix:

probably not difficult, can try to write a patch if desired

>Release-Note:

>Audit-Trail:

Responsible-Changed-From-To: pkg-manager->rillig
Responsible-Changed-By: wiz@NetBSD.org
Responsible-Changed-When: Sun, 08 Aug 2021 18:49:27 +0000
Responsible-Changed-Why:
Over to maintainer


From: "Roland Illig" <rillig@netbsd.org>
To: gnats-bugs@gnats.NetBSD.org
Cc: 
Subject: PR/56352 CVS commit: pkgsrc/pkgtools/pkglint
Date: Sun, 8 Aug 2021 22:04:15 +0000

 Module Name:	pkgsrc
 Committed By:	rillig
 Date:		Sun Aug  8 22:04:15 UTC 2021

 Modified Files:
 	pkgsrc/pkgtools/pkglint: Makefile
 	pkgsrc/pkgtools/pkglint/files: mkassignchecker.go
 	    mkassignchecker_test.go pkgsrc.go vartype.go
 	pkgsrc/pkgtools/pkglint/files/makepat: pat.go pat_test.go
 	pkgsrc/pkgtools/pkglint/files/textproc: lexer.go

 Log Message:
 pkgtools/pkglint: update to 21.2.2

 Changes since 21.2.1:

 Check the variable names of OPSYS-specific variables for typos, such as
 'Dragonfly' with a lowercase 'f'.  Suggested by David A. Holland in
 PR pkg/56352.

 Warn if variables like CFLAGS are assigned using the operator '='.
 Suggested by David A. Holland in PR pkg/56352.


 To generate a diff of this commit:
 cvs rdiff -u -r1.691 -r1.692 pkgsrc/pkgtools/pkglint/Makefile
 cvs rdiff -u -r1.9 -r1.10 pkgsrc/pkgtools/pkglint/files/mkassignchecker.go
 cvs rdiff -u -r1.7 -r1.8 \
     pkgsrc/pkgtools/pkglint/files/mkassignchecker_test.go
 cvs rdiff -u -r1.61 -r1.62 pkgsrc/pkgtools/pkglint/files/pkgsrc.go
 cvs rdiff -u -r1.52 -r1.53 pkgsrc/pkgtools/pkglint/files/vartype.go
 cvs rdiff -u -r1.2 -r1.3 pkgsrc/pkgtools/pkglint/files/makepat/pat.go
 cvs rdiff -u -r1.3 -r1.4 pkgsrc/pkgtools/pkglint/files/makepat/pat_test.go
 cvs rdiff -u -r1.11 -r1.12 pkgsrc/pkgtools/pkglint/files/textproc/lexer.go

 Please note that diffs are not public domain; they are subject to the
 copyright notices on the relevant files.

State-Changed-From-To: open->closed
State-Changed-By: rillig@NetBSD.org
State-Changed-When: Sun, 08 Aug 2021 22:09:50 +0000
State-Changed-Why:
All suggestions from this PR are implemented in pkglint-21.2.2,
released a few minutes ago.


>Unformatted:

NetBSD Home
NetBSD PR Database Search

(Contact us) $NetBSD: query-full-pr,v 1.46 2020/01/03 16:35:01 leot Exp $
$NetBSD: gnats_config.sh,v 1.9 2014/08/02 14:16:04 spz Exp $
Copyright © 1994-2020 The NetBSD Foundation, Inc. ALL RIGHTS RESERVED.