From owner-dev-commits-src-main@freebsd.org Thu Jun 10 19:48:53 2021 Return-Path: Delivered-To: dev-commits-src-main@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 50DE06530AB; Thu, 10 Jun 2021 19:48:53 +0000 (UTC) (envelope-from freebsd@gndrsh.dnsmgr.net) Received: from gndrsh.dnsmgr.net (br1.CN84in.dnsmgr.net [69.59.192.140]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 4G1F0N697yz4VKV; Thu, 10 Jun 2021 19:48:52 +0000 (UTC) (envelope-from freebsd@gndrsh.dnsmgr.net) Received: from gndrsh.dnsmgr.net (localhost [127.0.0.1]) by gndrsh.dnsmgr.net (8.13.3/8.13.3) with ESMTP id 15AJmlwS021047; Thu, 10 Jun 2021 12:48:47 -0700 (PDT) (envelope-from freebsd@gndrsh.dnsmgr.net) Received: (from freebsd@localhost) by gndrsh.dnsmgr.net (8.13.3/8.13.3/Submit) id 15AJmlgS021046; Thu, 10 Jun 2021 12:48:47 -0700 (PDT) (envelope-from freebsd) From: "Rodney W. Grimes" Message-Id: <202106101948.15AJmlgS021046@gndrsh.dnsmgr.net> Subject: Re: git: f4d987cd137c - main - mk: WITH_FOO=no now generates a warning In-Reply-To: To: Warner Losh Date: Thu, 10 Jun 2021 12:48:47 -0700 (PDT) CC: "Rodney W. Grimes" , Warner Losh , src-committers , "" , dev-commits-src-main@freebsd.org Reply-To: rgrimes@freebsd.org X-Mailer: ELM [version 2.4ME+ PL121h (25)] MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset=US-ASCII X-Rspamd-Queue-Id: 4G1F0N697yz4VKV X-Spamd-Bar: ---- Authentication-Results: mx1.freebsd.org; none X-Spamd-Result: default: False [-4.00 / 15.00]; REPLY(-4.00)[] X-BeenThere: dev-commits-src-main@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for the main branch of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 10 Jun 2021 19:48:53 -0000 > On Thu, Jun 10, 2021 at 5:46 AM Rodney W. Grimes > wrote: > > > > The branch main has been updated by imp: > > > > > > URL: > > https://cgit.FreeBSD.org/src/commit/?id=f4d987cd137cb2d0d54a3e35d9258ca7c175d291 > > > > > > commit f4d987cd137cb2d0d54a3e35d9258ca7c175d291 > > > Author: Warner Losh > > > AuthorDate: 2021-06-10 00:10:12 +0000 > > > Commit: Warner Losh > > > CommitDate: 2021-06-10 00:10:52 +0000 > > > > > > mk: WITH_FOO=no now generates a warning > > > > First off thank you, this may stop some head scratching! > > > > But what about WITHOUT_foo=no the symetrical mistake? > > I see bdrewey raised this in the review, but it was dismissed > > using the argument that some languages, spanish specifically, > > allow double negatives. This is computers engineering, > > and in that field of science double negatives are clearly > > defined and understood, so using an argument of a language > > that simply does not apply to the field, IMHO, is an arguement > > of low standing. > > > > It's not the same, and I'm not solving that error because the mapping > is ambiguous. I've seen a lot more instances of people using > WITHOUT_FOO=no unironically because it makes sense to the > person doing it. I disagree it's not a language issue, because > language is involved here: how do we assign semantic meaning > is unclear and I have no desire to get involved in what I clearly > view as a quagmire. > > > > Also I do not believe == is a case insensitive operation > > so this code fails for NO, No, and nO(sic). > > > > Also true. Again, this isn't perfect. I have no desire to make it > perfect, because the list isn't finite. > > If you'd like to own this issue, feel free, but it's not something I > wish to pursue further. You touched it, you own it. > Warner > > > > Regards, > > Rod > > > > > > Many people are used to gnu configure's behavior of changing > > > --with-foo=no to --without-foo. At the same time, several folks have > > > WITH_FOO=no in their config files to enable this ironic form of the > > > option because of an old meme from IRC, a mailing list or the forums > > (I > > > forget which). Add a warning to allow to alert people w/o breaking > > POLA. > > > > > > Reviewed by: allanjude, bdrewery, manu > > > MFC After: 2 weeks > > > Sponsored by: Netflix > > > Differential Revision: https://reviews.freebsd.org/D30684 > > > --- > > > share/mk/bsd.mkopt.mk | 6 ++++++ > > > 1 file changed, 6 insertions(+) > > > > > > diff --git a/share/mk/bsd.mkopt.mk b/share/mk/bsd.mkopt.mk > > > index 5a9cf1b2f1be..98d23dd46c2a 100644 > > > --- a/share/mk/bsd.mkopt.mk > > > +++ b/share/mk/bsd.mkopt.mk > > > @@ -36,6 +36,9 @@ > > > # > > > .for var in ${__DEFAULT_YES_OPTIONS} > > > .if !defined(MK_${var}) > > > +.if defined(WITH_${var}) && ${WITH_${var}} == "no" > > > +.warning "Use WITHOUT_${var}=1 insetad of WITH_${var}=no" > > > +.endif > > > .if defined(WITHOUT_${var}) # WITHOUT always wins > > > MK_${var}:= no > > > .else > > > @@ -54,6 +57,9 @@ MK_${var}:= yes > > > # > > > .for var in ${__DEFAULT_NO_OPTIONS} > > > .if !defined(MK_${var}) > > > +.if defined(WITH_${var}) && ${WITH_${var}} == "no" > > > +.warning "Use WITHOUT_${var}=1 insetad of WITH_${var}=no" > > > +.endif > > > .if defined(WITH_${var}) && !defined(WITHOUT_${var}) # WITHOUT always > > wins > > > MK_${var}:= yes > > > .else > > > > > > > -- > > Rod Grimes > > rgrimes@freebsd.org > > -- Rod Grimes rgrimes@freebsd.org