From owner-freebsd-current@FreeBSD.ORG Thu Dec 13 14:14:03 2012 Return-Path: Delivered-To: freebsd-current@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id D671FA2C; Thu, 13 Dec 2012 14:14:03 +0000 (UTC) (envelope-from freebsd@damnhippie.dyndns.org) Received: from duck.symmetricom.us (duck.symmetricom.us [206.168.13.214]) by mx1.freebsd.org (Postfix) with ESMTP id 6FB5B8FC17; Thu, 13 Dec 2012 14:14:03 +0000 (UTC) Received: from damnhippie.dyndns.org (daffy.symmetricom.us [206.168.13.218]) by duck.symmetricom.us (8.14.5/8.14.5) with ESMTP id qBDEE2oD068957; Thu, 13 Dec 2012 07:14:02 -0700 (MST) (envelope-from freebsd@damnhippie.dyndns.org) Received: from [172.22.42.240] (revolution.hippie.lan [172.22.42.240]) by damnhippie.dyndns.org (8.14.3/8.14.3) with ESMTP id qBDEDxYF057893; Thu, 13 Dec 2012 07:13:59 -0700 (MST) (envelope-from freebsd@damnhippie.dyndns.org) Subject: Re: /usr/src/sys/conf/newvers.sh, SYSDIR set to wrong directory. From: Ian Lepore To: Kimmo Paasiala In-Reply-To: References: <1355331231.87661.461.camel@revolution.hippie.lan> Content-Type: text/plain; charset="us-ascii" Date: Thu, 13 Dec 2012 07:13:59 -0700 Message-ID: <1355408039.87661.491.camel@revolution.hippie.lan> Mime-Version: 1.0 X-Mailer: Evolution 2.32.1 FreeBSD GNOME Team Port Content-Transfer-Encoding: 7bit Cc: freebsd-current@freebsd.org, freebsd-stable@freebsd.org X-BeenThere: freebsd-current@freebsd.org X-Mailman-Version: 2.1.14 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: Thu, 13 Dec 2012 14:14:03 -0000 On Wed, 2012-12-12 at 20:52 +0200, Kimmo Paasiala wrote: > On Wed, Dec 12, 2012 at 6:53 PM, Ian Lepore > wrote: > > On Wed, 2012-12-12 at 18:14 +0200, Kimmo Paasiala wrote: > >> Hello, > >> > >> My 9-STABLE buildworld broke in a very inexplicable way, I was > >> getting an error on /usr/src/include/osreldate.h that I couldn't > >> figure out until I started looking at the sys/conf/newvers.sh and what > >> it does. It turned out that the thing that broke my buildworld was > >> having .git directory at the root directory of the system because I > >> recently started using GIT to track the configuration files. > >> > >> I added some debug echos to the newvers.sh and I found out it's > >> setting SYSDIR to /bin/.. which in turn causes the newvers.sh to set > >> the gitdir to /.git and that seems to break the logic in newvers.sh. > >> > >> Isn't SYSDIR supposed to be set to the sys -subdirectory of the source > >> tree (/usr/src/sys default)? > >> > >> I'm guessing the reason the SYSDIR gets set to /bin/.. is the line in > >> newvers.sh: > >> > >> SYSDIR=$(dirname $0)/.. > >> > >> $0 is actually /bin/sh and not the path to newver.sh because the > >> newvers.sh is sourced by the Makefile in /usr/src/include instead of > >> executing it: > >> > >> osreldate.h: ${.CURDIR}/../sys/conf/newvers.sh ${.CURDIR}/../sys/sys/param.h \ > >> ${.CURDIR}/Makefile > >> @${ECHO} creating osreldate.h from newvers.sh > >> @MAKE=${MAKE}; \ > >> PARAMFILE=${.CURDIR}/../sys/sys/param.h; \ > >> . ${.CURDIR}/../sys/conf/newvers.sh; \ > >> > >> Now the question is how to fix this? > >> > >> -Kimmo > > > > Perhaps it could be handled similar to PARAMFILE, something like this in > > the makefile: > > > > PARAMFILE=${.CURDIR}/../sys/sys/param.h; \ > > SYSDIR=${.CURDIR}/../sys; \ > > . ${.CURDIR}/../sys/conf/newvers.sh; \ > > > > I'm not sure if newvers.sh needs to work in ways that don't involve > > being invoked from that makefile rule, so to be safe it could have > > default handling, something like: > > > > : ${SYSDIR:=$(dirname $0)/..} > > > > -- Ian > > > > > > Thanks, that works. Should I file a PR about this? > > -Kimmo I think that would probably be a good idea, since no committer has chimed in on this thread saying they're about to commit a fix. -- Ian