NetBSD Problem Report #6810

Received: (qmail 29835 invoked from network); 14 Jan 1999 22:27:52 -0000
Message-Id: <19990114222434.27D6110@proven.weird.com>
Date: Thu, 14 Jan 1999 17:24:34 -0500 (EST)
From: woods@proven.weird.com
Reply-To: woods@weird.com
To: gnats-bugs@gnats.netbsd.org
Subject: 1.3.3 top-level Makefile does not work as it was apparently intended to
X-Send-Pr-Version: 3.95

>Number:         6810
>Category:       misc
>Synopsis:       1.3.3 top-level Makefile does not work as it was apparently intended to
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    misc-bug-people
>State:          closed
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Thu Jan 14 14:35:01 +0000 1999
>Closed-Date:    Mon Nov 13 19:01:48 +0000 2000
>Last-Modified:  Mon Nov 13 19:01:48 +0000 2000
>Originator:     Greg A. Woods
>Release:        1.3.3
>Organization:
Planix, Inc.; Toronto, Ontario; Canada
>Environment:

System: NetBSD becoming 1.3.3 NetBSD 1.3.3 (BECOMING) #1: Wed Dec 30 19:15:12 PST 1998     woods@becoming:/proven/work/woods/NetBSD-1.3/sys/arch/i386/compile/BECOMING i386

>Description:

	Building a "domestic" 1.3.3 system from source fails if the
	compilation system has not had the "security" set installed,
	though from the looks of the first-hack attempt in the top-level
	Makefile, this should not be the case.

	FYI this was the only glitch I encoutered when building on i386.

>How-To-Repeat:

	run something like "make DESTDIR=/not-the-root/directory build"
	in the 1.3.3 source directory on a 1.3.3 system that does not
	have the security "set" installed and observe the quick failure.

>Fix:

	There's probably a better way to build and use tools necessary
	as pre-requisites to building the rest of the system, but the
	following hack seems to do the trick.  Ideally "compile_et" and
	"mk_cmds" should be installed in all systems, not just
	"domestic" systems, and then this chicken&egg-like dilema would
	not rear its ugly head.  I'm not sure what approach the -current
	build system uses because I have yet to test it under these
	circumstances....

	The ultimate solution is to eliminate recursive makes..... ;-)

Index: Makefile
===================================================================
RCS file: /cvs/NetBSD-1.3/Makefile,v
retrieving revision 1.1.1.2
diff -u -r1.1.1.2 Makefile
--- Makefile	1998/12/24 07:13:37	1.1.1.2
+++ Makefile	1999/01/14 22:06:13
@@ -48,15 +48,17 @@
 	(cd ${.CURDIR}/share/mk && ${MAKE} install)
 	(cd ${.CURDIR}/share/tmac && ${MAKE} && ${MAKE} install)
 .if exists(domestic) && !defined (EXPORTABLE_SYSTEM)
+	# this is a quick hack to ensure these utilities are up-to-date
+	# in the host's compilation system (don't cross-compile them!)...
 .if exists(domestic/usr.bin/compile_et)
 	(cd ${.CURDIR}/domestic/usr.bin/compile_et && \
-	    ${MAKE} depend && ${MAKE} && \
-	    ${MAKE} install)
+	    ${MAKE} DESTDIR=/ depend && ${MAKE} DESTDIR=/ && \
+	    ${MAKE} DESTDIR=/ install-nodepend)
 .endif
 .if exists(domestic/usr.bin/make_cmds)
 	(cd ${.CURDIR}/domestic/usr.bin/make_cmds && \
-	    ${MAKE} depend && ${MAKE} && \
-	    ${MAKE} install)
+	    ${MAKE} DESTDIR=/ depend && ${MAKE} DESTDIR=/ && \
+	    ${MAKE} DESTDIR=/ install-nodepend)
 .endif
 .endif
 	${MAKE} includes
Index: domestic/usr.bin/compile_et/Makefile
===================================================================
RCS file: /cvs/NetBSD-1.3/domestic/usr.bin/compile_et/Makefile,v
retrieving revision 1.1.1.1
diff -u -r1.1.1.1 Makefile
--- domestic/usr.bin/compile_et/Makefile	1998/12/24 06:48:57	1.1.1.1
+++ domestic/usr.bin/compile_et/Makefile	1999/01/13 22:26:24
@@ -10,4 +10,7 @@
 DPADD+=	${LIBL}
 LDADD+=	-ll

+install-nodepend:
+	${INSTALL} ${PRESERVE} ${COPY} ${STRIPFLAG} -o ${BINOWN} -g ${BINGRP} -m ${BINMODE} ${PROG} ${DESTDIR}${BINDIR}/${PROGNAME}
+
 .include <bsd.prog.mk>
Index: domestic/usr.bin/make_cmds/Makefile
===================================================================
RCS file: /cvs/NetBSD-1.3/domestic/usr.bin/make_cmds/Makefile,v
retrieving revision 1.1.1.1
diff -u -r1.1.1.1 Makefile
--- domestic/usr.bin/make_cmds/Makefile	1998/12/24 06:48:58	1.1.1.1
+++ domestic/usr.bin/make_cmds/Makefile	1999/01/13 22:27:37
@@ -14,4 +14,7 @@
 LDADD+=	-ll
 DPADD+=	${LIBL}

+install-nodepend:
+	${INSTALL} ${PRESERVE} ${COPY} ${STRIPFLAG} -o ${BINOWN} -g ${BINGRP} -m ${BINMODE} ${PROG} ${DESTDIR}${BINDIR}/${PROGNAME}
+
 .include <bsd.prog.mk>
>Release-Note:
>Audit-Trail:
State-Changed-From-To: open->closed 
State-Changed-By: tv 
State-Changed-When: Thu Jan 14 17:30:49 PST 1999 
State-Changed-Why:  
This is fixed in -current, and is highly unlikely to be fixed on the 1.3.x 
branch. 

From: woods@most.weird.com (Greg A. Woods)
To: gnats-admin@netbsd.org
Cc: gnats-bugs@gnats.netbsd.org (NetBSD GNATS submissions and followups) 
Subject: Re: misc/6810
Date: Mon, 18 Jan 1999 11:07:00 -0500 (EST)

 [ On , January 15, 1999 at 01:31:19 (-0000), tv@netbsd.org wrote: ]
 > Subject: Re: misc/6810
 >
 > Synopsis: 1.3.3 top-level Makefile does not work as it was apparently intended to
 > 
 > State-Changed-From-To: open->closed
 > State-Changed-By: tv
 > State-Changed-When: Thu Jan 14 17:30:49 PST 1999
 > State-Changed-Why: 
 > This is fixed in -current, and is highly unlikely to be fixed on the 1.3.x
 > branch.

 1.3.4 is on the way I see....

 -- 
 							Greg.
State-Changed-From-To: closed->suspended 
State-Changed-By: scottr 
State-Changed-When: Fri Jan 29 06:44:06 PST 1999 
State-Changed-Why:  
This problem is not resolved in -current, though it's slightly less 
annoying than it used to be.  The solution presented here is unacceptable 
because it violates the principle of least astonishment -- people will 
not expect to have to install binaries into a running system if DESTDIR 
is set to a non-root path.  I'm suspending this PR until such time as an 
overhaul of the build system can be performed (since it can't really 
be closed). 

From: woods@most.weird.com (Greg A. Woods)
To: scottr@netbsd.org
Cc: gnats-bugs@gnats.netbsd.org (NetBSD GNATS submissions and followups),
    gnats-admin@netbsd.org
Subject: Re: misc/6810
Date: Fri, 29 Jan 1999 15:57:12 -0500 (EST)

 [ On , January 29, 1999 at 14:46:13 (-0000), scottr@netbsd.org wrote: ]
 > Subject: Re: misc/6810
 >
 > Synopsis: 1.3.3 top-level Makefile does not work as it was apparently intended to
 > 
 > State-Changed-From-To: closed->suspended
 > State-Changed-By: scottr
 > State-Changed-When: Fri Jan 29 06:44:06 PST 1999
 > State-Changed-Why: 
 > This problem is not resolved in -current, though it's slightly less
 > annoying than it used to be.  The solution presented here is unacceptable
 > because it violates the principle of least astonishment -- people will
 > not expect to have to install binaries into a running system if DESTDIR
 > is set to a non-root path.  I'm suspending this PR until such time as an
 > overhaul of the build system can be performed (since it can't really
 > be closed).

 I think you could close it, esp. so long as it keeps the 1.3.3 in the
 synopsis.  The hack it offers was just a quick&dirty one to get the
 build system t perform in a boot strapping fashion for my own system.  I
 certainly agree that most folks won't expect to install binaries into
 their running system during a build if DESTDIR is set.  I'd probably
 have been just as happy if the makefile had complained about the "secr"
 set not having been installed on the build-host, especially now that I
 think I understand the depedencies involved a bit better (I had intended
 to install that set, but when sysinst didn't do it automatically I
 simply forgot, and clearly it would make no difference to do so since I
 was building with /usr/src/domestic and without setting EXPORTABLE_SYSTEM.

 However before you close it I think it would be nice for 1.3.4 if
 *something* was changed to make the correct course of action a bit more
 obvious to people who want to re-build their 1.3.4 system from the
 release sources.  As it is it just fails miserably if you get yourself
 into a situation such as I was, DESTDIR or none.  I don't expect that
 pulling up enough of the -current build system will be easy to do
 correctly, so perhaps just a top-level check and a warning before diving
 in during the "make includes" phase would be sufficient.

 -- 
 							Greg A. Woods

 +1 416 218-0098      VE3TCP      <gwoods@acm.org>      <robohack!woods>
 Planix, Inc. <woods@planix.com>; Secrets of the Weird <woods@weird.com>

From: Frederick Bruckman <fb@enteract.com>
To: "Erik E. Fair" <fair@clock.org>
Cc: tech-toolchain@netbsd.org
Subject: Re: misc/6810
Date: Sun, 23 Apr 2000 12:07:13 -0700

 On Sun, 23 Apr 2000, Erik E. Fair wrote:

 > In looking over suspended PRs, I found this one. It's about our build 
 > system not updating the local environment to have all the tools 
 > needed to do the build. I agree that the build system should not do 
 > that (think "cross-compiles"), but we could go half-way: *check* the 
 > local environment to see if all the tools are there at the outset 
 > (e.g. make_cmds & compile_et for Kerberos) so that you don't waste 
 > half a day on an old m68k machine doing a build that fails.
 > 
 > The information is already in the build scripts (don't we have a 
 > variable for each command executed, e.g. YACC, CC, LD, STRIP, etc), 
 > so it shouldn't be too difficult to construct a check.

 I'd like to see a "toolchain" target, that could be used to update an
 older system from source. Of course you would never call it on a
 cross-compile run. You could set DESTDIR, though, and adjust your
 paths to get the behaviour desired by the filer of the PR.


From: Tim Rightnour <root@garbled.net>
To: Frederick Bruckman <fb@enteract.com>
Cc: tech-toolchain@netbsd.org, "Erik E. Fair" <fair@clock.org>
Subject: Re: misc/6810
Date: Wed, 28 Jun 2000 13:56:56 -0700

 On 23-Apr-00 Frederick Bruckman wrote:
 > I'd like to see a "toolchain" target, that could be used to update an
 > older system from source. Of course you would never call it on a
 > cross-compile run. You could set DESTDIR, though, and adjust your
 > paths to get the behaviour desired by the filer of the PR.

 Actually..  I'm doing cross-compiling extensively.. and it would be *very*
 helpful to have a toolchain target.  Even moreso if there was an
 install-toolchain target, so I could:

 make toolchain
 make install-toolchain DESTDIR=/build/${ARCH}/tools
 make build DESTDIR=/build/${ARCH}/root

 Right now, I fake this by doing:
 TOOLDIRS="usr.bin/make gnu/lib/libbfd gnu/usr.bin/${AS} gnu/usr.bin/${LD} gnu/us
 r.bin/egcs gnu/usr.bin/binutils usr.bin/xinstall usr.sbin/config usr.bin/rpcgen 
 usr.bin/menuc usr.bin/msgc usr.bin/xlint crypto-us/usr.bin/compile_et"

 for subdir in   ${TOOLDIRS}
 do
 (make && make install)

 By building the tools like this before building the world, I have not had any
 problems which required a manual tool install in months.

 ---
 Tim Rightnour <root@garbled.net>
 NetBSD: Free multi-architecture OS http://www.netbsd.org/
 NetBSD Mailing lists on the web: http://mail-index.netbsd.org/
State-Changed-From-To: suspended->closed 
State-Changed-By: tv 
State-Changed-When: Mon Nov 13 11:01:20 PST 2000 
State-Changed-Why:  
The issue in this PR no longer exists (domestic build), and we are working 
separately on a cross tools system. 
>Unformatted:

NetBSD Home
NetBSD PR Database Search

(Contact us) $NetBSD: query-full-pr,v 1.51 2026/08/10 02:28:17 riastradh Exp $
$NetBSD: gnats_config.sh,v 1.10 2026/05/13 22:00:09 riastradh Exp $
Copyright © 1994-2026 The NetBSD Foundation, Inc. ALL RIGHTS RESERVED.