From owner-freebsd-current@FreeBSD.ORG Thu Dec 13 23:02:17 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 64CC03E9; Thu, 13 Dec 2012 23:02:17 +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 E524C8FC13; Thu, 13 Dec 2012 23:02:16 +0000 (UTC) Received: by mail-vc0-f182.google.com with SMTP id fy27so953129vcb.13 for ; Thu, 13 Dec 2012 15:02:15 -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=2WhDXU9I6UeHKeVCIgrfRRTIev7490qQixTgE47M/bw=; b=BS/wgXFoi37wQvZkZeWxJtst66S31xgvSuuEIOWZ0JFlh7LLc+vjHHiBeQSvTY+VI9 Whlr31Owg3ejGWnpmt7GkL4kyGPDID6Grx8oo1Y3GsgqTWjKpVbpu2/WGwWrzX8yoFxY nTSoWrUZ6NQ5xZ5EvIGEPaF6ZdNUhWkHNdqIH1Ud62tgVUzEc1+dk6WQy5GWllu4MLnP FUd7BDqp0RLoQs81Pr72YOqaOhhpvvB11JgQgHqD4YOxu5AtzmPCKT85ldd+WN/c5Icu MTk21U9YiDPcXTRTgxrtk7dBFXUoG3d8Tfez7n7+zQnPFkObZ7MTDIX/2G2DBlP7deLC Q99g== MIME-Version: 1.0 Received: by 10.58.65.105 with SMTP id w9mr6282155ves.54.1355439735705; Thu, 13 Dec 2012 15:02:15 -0800 (PST) Received: by 10.58.209.163 with HTTP; Thu, 13 Dec 2012 15:02:15 -0800 (PST) In-Reply-To: <1355408039.87661.491.camel@revolution.hippie.lan> References: <1355331231.87661.461.camel@revolution.hippie.lan> <1355408039.87661.491.camel@revolution.hippie.lan> Date: Fri, 14 Dec 2012 01:02:15 +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: Thu, 13 Dec 2012 23:02:17 -0000 On Thu, Dec 13, 2012 at 4:13 PM, Ian Lepore wrote: > 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 > > Submitted as misc/174422. -Kimmo