From owner-freebsd-current Wed Jan 28 08:21:04 1998 Return-Path: Received: (from majordom@localhost) by hub.freebsd.org (8.8.8/8.8.8) id IAA21044 for current-outgoing; Wed, 28 Jan 1998 08:21:04 -0800 (PST) (envelope-from owner-freebsd-current@FreeBSD.ORG) Received: from ns.mt.sri.com (sri-gw.MT.net [206.127.105.141]) by hub.freebsd.org (8.8.8/8.8.8) with ESMTP id IAA21037 for ; Wed, 28 Jan 1998 08:21:01 -0800 (PST) (envelope-from nate@mt.sri.com) Received: from mt.sri.com (rocky.mt.sri.com [206.127.76.100]) by ns.mt.sri.com (8.8.8/8.8.8) with SMTP id JAA01137; Wed, 28 Jan 1998 09:20:49 -0700 (MST) (envelope-from nate@rocky.mt.sri.com) Received: by mt.sri.com (SMI-8.6/SMI-SVR4) id JAA04669; Wed, 28 Jan 1998 09:20:48 -0700 Date: Wed, 28 Jan 1998 09:20:48 -0700 Message-Id: <199801281620.JAA04669@mt.sri.com> From: Nate Williams MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit To: shimon@simon-shapiro.org Cc: John Polstra , current@FreeBSD.ORG Subject: Re: gnu/usr.bin/cvs/libdiff In-Reply-To: References: <199801280255.SAA28113@austin.polstra.com> X-Mailer: VM 6.29 under 19.15 XEmacs Lucid Sender: owner-freebsd-current@FreeBSD.ORG Precedence: bulk > >> ===> gnu/usr.bin/cvs/libdiff > >> make: don't know how to make diff.c. Stop > >> *** Error code 2 > > > > It's because you have stale dependencies in your ".depend" file. Of > > course your "rm -rf /usr/obj" fixed that. But you could have fixed > > it a lot more quickly by just deleting the offending ".depend" file. > > When make(1) was born the intent was to allow a programmer to specify the > relationships between various software modules, and the steps needed to > satisfy these relationships. This is typically done in the form of > dependancies; ``To produce /usr/bin/vi, you need vi.o, and libc.a and this > dependancy is satisfied with ld -this -that. vi.o is dependant on vi.c and > stdio.c, and the dependancy is satisfied by eunning cc -something -and > -something_else''. Now, once these rules are specified, one step up to the > directory, type ``make'' and have their favorite complex product built just > right. And make continues to do that. But, if vi.c is removed and broken into vi1.c and vi2.c, and your .depend file says that it needs to build vi.o in order to build (cause your .depend file is from before the breakup), then it knows it needs vi.c in order to build, so it's doing the right thing. Automated tools *can't* be smart enough to know that you completely changed all your dependencies, and John was trying to be helpful and point out that it doesn't require blowing away the world. The *really* sad thing is that somehow you fail to understand how an automated tool can fail and require human intervention, and this is *really* scarey. *NO* (none, zero, zip, nada) automated build tool is completely idiot proof *AND* somewhat effecient. If you want idiot proof, then blow away everything *everytime* (sources, temporary stuff, .o, .depend, .c, .h) re-newfs your files system, and *most* of the time it will work. But, that's alot of (un-necessary) work. But, if you understand how make works (in particular BSD-Make), then you can also understand why some of it's optimizations don't work when the rug is pulled out from under it. > Somewhere along the line, we lost it. I am being told (NOT picking on you > John! :-) that if I remove this (unnamed) .depend file, then all will be > well. That's because you told it to build this (unnamed) .depend file when you built the tree. My point in this posting the original message was not to get the > build going, or get it going in the least amount of time, but to point out > that the automated, self contained dependenciies definition is broken. And will be when the build systems had the tree change so radically. It can't be both effecient *AND* get everything right all the time. You must sacrifice one for the other, and because building is a much more common step than doing dependencies (and dependencies change less often), then it makes sense to do the 'engineering solution' and optimize the common case. Other solution could make the build complete everytime, but it would require re-building files even though they don't need rebuilding, and that is much less acceptable than having to blow away .depend files occassionally. In short, if you're going to run -current, then understand the build system so that you can figure these sorts of problems out on your own, since cockpit error appears to be a pretty common problem, and we'd like the pilot to learn how to pull out of stalls on his own. :) Nate