NetBSD Problem Report #39619

From reed@reedmedia.net  Wed Sep 24 02:55:10 2008
Return-Path: <reed@reedmedia.net>
Received: from mail.netbsd.org (mail.netbsd.org [204.152.190.11])
	by narn.NetBSD.org (Postfix) with ESMTP id 8CB8D63BC83
	for <gnats-bugs@gnats.NetBSD.org>; Wed, 24 Sep 2008 02:55:10 +0000 (UTC)
Message-Id: <1265-1222221214@reedmedia.net>
Date: Tue, 23 Sep 2008 20:53:35 -0500
From: reed@reedmedia.net
Reply-To: reed@reedmedia.net
To: gnats-bugs@gnats.NetBSD.org
Subject: build.sh looks for nbmake in wrong place and rebuilds after was just built
X-Send-Pr-Version: 3.95

>Number:         39619
>Category:       bin
>Synopsis:       build.sh looks for nbmake in wrong place and rebuilds after was just built
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    lukem
>State:          feedback
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Wed Sep 24 03:00:00 +0000 2008
>Closed-Date:    
>Last-Modified:  Fri Jun 02 16:43:40 +0000 2023
>Originator:     reed@reedmedia.net
>Release:        NetBSD 4.99.62
>Organization:
  Jeremy C. Reed
>Environment:


System: NetBSD tx.reedmedia.net 4.99.62 NetBSD 4.99.62 (GENERIC) #13: Wed Aug 6 17:23:27 CDT 2008 reed@tx.reedmedia.net:/usr/src/sys/arch/amd64/compile/GENERIC amd64
Architecture: x86_64
Machine: amd64
>Description:
I built the distribution with ./build.sh -U distribution
which said:
...
         Bootstrapping nbmake
         TOOLDIR path:     /usr/src/tooldir.NetBSD-4.99.62-x86_64
         DESTDIR path:     /usr/src/destdir.amd64
         RELEASEDIR path:  /usr/src/releasedir
         Created /usr/src/tooldir.NetBSD-4.99.62-x86_64/bin/nbmake
         makewrapper:      /usr/src/tooldir.NetBSD-4.99.62-x86_64/bin/nbmake-amd64
         Updated /usr/src/tooldir.NetBSD-4.99.62-x86_64/bin/nbmake-amd64
         Successful make distribution
         build.sh ended:   Tue Sep 23 16:45:49 CDT 2008

and then immediately ran sudo ./build.sh -U install=/
which said:
===> No /usr/src/obj/tooldir.NetBSD-4.99.62-x86_64/bin/nbmake, needs building.
===> Bootstrapping nbmake
checking for sh... /bin/sh

Notice nbmake is at:

-rwxr-xr-x  1 reed  wsrc  166197 Sep 23 14:41 /usr/src/tooldir.NetBSD-4.99.62-x86_64/bin/nbmake
-rwxr-xr-x  1 reed  wsrc     925 Sep 23 14:41 /usr/src/tooldir.NetBSD-4.99.62-x86_64/bin/nbmake-amd64

But second run adds "obj" to directory it looks under.
>How-To-Repeat:
rm -rf /usr/obj/* /usr/src/obj
created /usr/obj and owned by me and then:
      time nice ./build.sh -U distribution
      time sudo ./build.sh -U install=/
>Fix:
Use same path as was previously installed. Don't rebuild.

(I understand that if I was to reboot with newer kernel
then I should use -T switch to point to previous tools directory.)

>Release-Note:

>Audit-Trail:

Responsible-Changed-From-To: bin-bug-people->lukem
Responsible-Changed-By: lukem@NetBSD.org
Responsible-Changed-When: Fri, 02 Jun 2023 16:43:40 +0000
Responsible-Changed-Why:


State-Changed-From-To: open->feedback
State-Changed-By: lukem@NetBSD.org
State-Changed-When: Fri, 02 Jun 2023 16:43:40 +0000
State-Changed-Why:
A couple of observations:

1. I speculate that your build was relying upon $TOOLDIR in your 
shell's environment (because you didn't show invoking build.sh with -T),
and your PR contains this:
         TOOLDIR path:     /usr/src/tooldir.NetBSD-4.99.62-x86_64

sudo(1) doesn't preserve environment by default (including $TOOLDIR), so
        sudo ./build.sh -U install=/
isn't going to inherit your $TOOLDIR (in the default sudo configuration).


2. build.sh was changed on 2009-09-27 (after this PR's submission) in
how it determines the $TOOLDIR, which may have improved the situation.


Is this still a problem?


>Unformatted:

NetBSD Home
NetBSD PR Database Search

(Contact us) $NetBSD: gnats-precook-prs,v 1.4 2018/12/21 14:20:20 maya Exp $
$NetBSD: gnats_config.sh,v 1.9 2014/08/02 14:16:04 spz Exp $
Copyright © 1994-2017 The NetBSD Foundation, Inc. ALL RIGHTS RESERVED.