From owner-freebsd-current@freebsd.org Wed May 24 08:57:21 2017 Return-Path: Delivered-To: freebsd-current@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 886F1D7B172 for ; Wed, 24 May 2017 08:57:21 +0000 (UTC) (envelope-from mueller6722@twc.com) Received: from dnvrco-oedge-vip.email.rr.com (dnvrco-outbound-snat.email.rr.com [107.14.73.230]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "dnvrco-oedge-vip.email.rr.com", Issuer "dnvrco-oedge-vip.email.rr.com" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id 66F1D1A20 for ; Wed, 24 May 2017 08:57:20 +0000 (UTC) (envelope-from mueller6722@twc.com) Received: from [74.134.208.22] ([74.134.208.22:35893] helo=localhost) by dnvrco-omsmta03 (envelope-from ) (ecelerity 3.6.9.48312 r(Core:3.6.9.0)) with ESMTP id BF/E8-25473-8AA45295; Wed, 24 May 2017 08:56:08 +0000 Date: Wed, 24 May 2017 08:56:08 +0000 Message-ID: From: "Thomas Mueller" To: freebsd-current@freebsd.org CC: Ngie Cooper , "Simon J. Gerraty" Subject: Re: Bug in make setting wrong MAKESYSPATH References: <4E.66.25473.9D551295@dnvrco-omsmta03> <81057.1495500066@kaos.jnpr.net> <95058.1495555282@kaos.jnpr.net> X-RR-Connecting-IP: 107.14.64.88:25 X-BeenThere: freebsd-current@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: Discussions about the use of FreeBSD-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 24 May 2017 08:57:21 -0000 >From Simon J. Gerraty: > Thomas Mueller wrote: > > It seems to me that MAKESYSPATH should match the host building system > > FreeBSD version. > Which would only be correct if building the same version of FreeBSD as > is running on the host. > Many folk work on multiple branches on the same machine. I have even built FreeBSD i386 from FreeBSD amd64, and vice versa. Even when the user tracks only one branch, such as HEAD, one or more /usr/share/mk files may have been updated since the last build, and therefore not in sync with the build host's /usr/share/mk . For building the system, MAKESYSPATH should be $SRCDIR/share/mk , to be in sync. I tried "make -V MAKESYSPATH" from several SRCDIRs, and that's what happened. Like this: $ make -C /usr/src -V MAKESYSPATH /usr/src/share/mk $ make -C /freebsd-base-graphics -V MAKESYSPATH /freebsd-base-graphics/share/mk > Thus for anyone working on src/ there is no guarantee that /usr/share/mk > is even remotely correct. > So you either buy into the idea of using a wrapper script and canned > .env file for each tree (that's what I do; > http://www.crufty.net/sjg/docs/sb-tools.htm) to ensure correct > settings per tree (whether FreeBSD, NetBSD, ...), or you compromise and > have 'make' itself try to find the "correct" share/mk for whereever it is. > This is why the default MAKESYSPATH starts with .../share/mk > > Now I believe the correct syntax for setting MAKESYSPATH in .cshrc and .profile would be > > export MAKESYSPATH=/usr/share/mk # for .profile, or > > setenv MAKESYSPATH /usr/share/mk # for .cshrc Something like that might be appropriate for ports but not for building the system. So maybe I have to set MAKESYSPATH every time I am in ports, don't know if this would work from /etc/make.conf (need to experiment). I wonder what would happen if there is no FreeBSD installation at all on partition where ports tree is located. > Yes, but requires you to keep /usr/share/mk in sync with whatever you a > building, tricky if you build head, stable/10 and stable/11 on the > same box. I don't think you have to do that, since I find that MAKESYSPATH becomes $SRCDIR/share/mk . > sjg Tom