Date: Fri, 17 Jun 2011 14:43:21 +0000 From: "b. f." <bf1783@googlemail.com> To: Sahil Tandon <sahil@tandon.net> Cc: Alexey Dokuchaev <danfe@freebsd.org>, Sahil Tandon <sahil@freebsd.org>, Wen Heping <wen@freebsd.org>, "cvs-all@freebsd.org" <cvs-all@freebsd.org>, "ports-committers@freebsd.org" <ports-committers@freebsd.org>, "cvs-ports@freebsd.org" <cvs-ports@freebsd.org> Subject: Re: cvs commit: ports/sysutils/tmux Makefile Message-ID: <BANLkTinsy9QqgFJ7kBHfMsQ77OnohM0O2w@mail.gmail.com> In-Reply-To: <0C0893AE-B699-4DAB-AD58-C6075349DC2F@tandon.net> References: <201106160842.p5G8gS6T054738@repoman.freebsd.org> <20110616164733.GA40181@FreeBSD.org> <20110617004742.GD19139@magic.hamla.org> <BANLkTik344RMoiKtSejSxmEa14WNAR1x4Q@mail.gmail.com> <0C0893AE-B699-4DAB-AD58-C6075349DC2F@tandon.net>
next in thread | previous in thread | raw e-mail | index | archive | help
On 6/17/11, Sahil Tandon <sahil@tandon.net> wrote: > On Jun 16, 2011, at 11:57 PM, "b. f." <bf1783@googlemail.com> wrote: > >> On 6/17/11, Sahil Tandon <sahil@freebsd.org> wrote: >>> On Thu, 2011-06-16 at 16:47:33 +0000, Alexey Dokuchaev wrote: >>> >>>> On Thu, Jun 16, 2011 at 08:42:28AM +0000, Wen Heping wrote: >>>>> wen 2011-06-16 08:42:28 UTC >>>>> >>>>> Modified files: >>>>> sysutils/tmux Makefile >>>>> Log: >>>>> - Fix build when CFLAGS is set in /etc/make.conf >>>> >>>> Hmm, default CPPFLAGS is empty. Judging just from the diff, instead of >>>> introducing EXTRA_CPPFLAGS, setting CPPFLAGS instead of CFLAGS (which is >>>> bogus in the first place: -I is preprocessor flag) should be enough (no >>>> MAKE_ENV adjustment and extra REINPLACE_CMD hack would be required in >>>> this >>>> case as well). I am missing something obvious here? >>> >>> Because of the way upstream Makefile handles CPPFLAGS, it is not so >>> straightforward. This was discussed on freebsd-ports: >>> >>> http://lists.freebsd.org/pipermail/freebsd-ports/2011-June/068218.html >>> http://lists.freebsd.org/pipermail/freebsd-ports/2011-May/067930.html >> >> But this does not seem so different from the many other ports that set >> or alter variables in the port Makefile. If a user overrides these >> changes in an automatically and recursively-included Makefile like >> __MAKE_CONF, or on the command-line, it it the user's problem. Users >> should not pollute their port builds by unconditionally defining >> variables in __MAKE_CONF, and I don't think that we should add >> elaborations to ports to avoid such mistakes. > > Yes and I think we get that and I personally agree with your sentiment; > however, I'm not sure that means maintainers need to revert commits that > were done to prevent users from shooting their own foot. Yes, but the proper anti-foot-shooting measure, is not to make sysutils/tmux and the thousands of other ports that may be affected by this blunder unnecessarily complicated, but, since we keep running into this problem, to add comments to the Handbook and to src/share/examples/etc/make.conf, to explain that users should not _unconditionally_ define variables that may affect a port build in __MAKE_CONF, even CFLAGS, because the file may be automatically included several times when make is called recursively, clobbering changes made to those variables in Makefiles that are not last in a chain of recursions. If we were to follow your argument to it's logical conclusion, we would have to remove CPPFLAGS+= and CPPFLAGS= statements in every port that uses them and replace them with a variable that we think is less likely to be defined in a user's __MAKE_CONF, and then manually patch all distfile Makefiles where appropriate. The amount of work involved would be enormous, and it still wouldn't be completely foolproof. There is no point in putting 50 kg. of armor on every user's arms and legs to prevent any user from shooting himself, if a number of users are just as likely to direct the gun to their unarmored heads. I say keep the choice of variables in port Makefiles simple and uniform, and the patching to a minimum. b.
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?BANLkTinsy9QqgFJ7kBHfMsQ77OnohM0O2w>