NetBSD Problem Report #39619

From  Wed Sep 24 02:55:10 2008
Return-Path: <>
Received: from ( [])
	by (Postfix) with ESMTP id 8CB8D63BC83
	for <>; Wed, 24 Sep 2008 02:55:10 +0000 (UTC)
Message-Id: <>
Date: Tue, 23 Sep 2008 20:53:35 -0500
Subject: looks for nbmake in wrong place and rebuilds after was just built
X-Send-Pr-Version: 3.95

>Number:         39619
>Category:       bin
>Synopsis: 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
>Last-Modified:  Fri Jun 02 16:43:40 +0000 2023
>Release:        NetBSD 4.99.62
  Jeremy C. Reed

System: NetBSD 4.99.62 NetBSD 4.99.62 (GENERIC) #13: Wed Aug 6 17:23:27 CDT 2008 amd64
Architecture: x86_64
Machine: amd64
I built the distribution with ./ -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 ended:   Tue Sep 23 16:45:49 CDT 2008

and then immediately ran sudo ./ -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.
rm -rf /usr/obj/* /usr/src/obj
created /usr/obj and owned by me and then:
      time nice ./ -U distribution
      time sudo ./ -U install=/
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.)



Responsible-Changed-From-To: bin-bug-people->lukem
Responsible-Changed-When: Fri, 02 Jun 2023 16:43:40 +0000

State-Changed-From-To: open->feedback
State-Changed-When: Fri, 02 Jun 2023 16:43:40 +0000
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 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 ./ -U install=/
isn't going to inherit your $TOOLDIR (in the default sudo configuration).

2. 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?


NetBSD Home
NetBSD PR Database Search

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