From owner-freebsd-current@FreeBSD.ORG Wed Dec 12 18:52:54 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 2D4C1AA5; Wed, 12 Dec 2012 18:52:54 +0000 (UTC) (envelope-from kpaasial@gmail.com) Received: from mail-vc0-f182.google.com (mail-vc0-f182.google.com [209.85.220.182]) by mx1.freebsd.org (Postfix) with ESMTP id B453C8FC0A; Wed, 12 Dec 2012 18:52:53 +0000 (UTC) Received: by mail-vc0-f182.google.com with SMTP id fo14so1217458vcb.13 for ; Wed, 12 Dec 2012 10:52:53 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type; bh=cx4BzxB5npuRhh4zciM8Bj17kzmkfm86NirkakabwJA=; b=gYZBNer2xsNaRdvCMaZobZYL6/oe2Oa6gEN3hfxd3yc7lx+LpPvxbTooiseKn0Poge VAUWg158GcBWtz3/3YDQY/G1K0qMci8czDPcjO0CGSr/4lvdPYtGD/KoMgWmrw9LZCeE Yme3LsNancRKPl6GnNJTGyBDHv7UpHs2EN4Ffo4G5s1toLue7eLA1rsXD59Zht28Nk/p aeAj6mxD3DwXUeL0o1vdM0MdTt19ZuvI7fA3U/VC5wk3qu08EdWDiTAVUGcczNCycuhD NNfy6q4LuWRiLIPSRD5FZGlXM8g2Qyh8SmL46Aog83nV8AHCVpg4cjDtKDvC6tsrByF2 eZ3A== MIME-Version: 1.0 Received: by 10.52.33.228 with SMTP id u4mr940246vdi.4.1355338373048; Wed, 12 Dec 2012 10:52:53 -0800 (PST) Received: by 10.58.209.163 with HTTP; Wed, 12 Dec 2012 10:52:52 -0800 (PST) In-Reply-To: <1355331231.87661.461.camel@revolution.hippie.lan> References: <1355331231.87661.461.camel@revolution.hippie.lan> Date: Wed, 12 Dec 2012 20:52:52 +0200 Message-ID: Subject: Re: /usr/src/sys/conf/newvers.sh, SYSDIR set to wrong directory. From: Kimmo Paasiala To: Ian Lepore Content-Type: text/plain; charset=UTF-8 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: Wed, 12 Dec 2012 18:52:54 -0000 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