Subject: Re: make release abends with "*** Error code 1"
To: None <netbsd-help@NetBSD.org>
From: Woodchuck <djv@bedford.net>
List: netbsd-help
Date: 01/21/2007 08:06:45
Well, scrubbing obj and using "build.sh" didn't work.
Abend in the same place.

Error messages are changing, though.  Somewhat more information about
the higher levels in Make that have branched down to the erring level.

Anyway, the Makefile that is resulting in the error is
/usr/src/distrib/common/Makefile.image

The target is:

.if !target(${WORKBUILT})                                       # {
${WORKBUILT}: ${IMAGEDEPENDS} ${WORKSPEC} ${PARSELISTDEP} ${LISTS}
#       There is a .PHONY ${CRUNCHBIN}, so check if out of date by hand
#       Default to `.' if ${CRUNCHBIN} isn't set, to always force a rebuild.
        [ "${.OODATE}" = ${CRUNCHBIN:U.} -a -f ${WORKBUILT} -a ${WORKBUILT} -nt 
${CRUNCHBIN:U.} ]  || { \
        ${_MKSHMSG} "  build " ${.CURDIR:T}/${WORKDIR}; \
        rm -rf ${WORKDIR} ${WORKBUILT}; \
        mkdir -m 755 ${WORKDIR} &&  \
        ${TOOL_MTREE} -def ${WORKSPEC} -p ${WORKDIR}/ -UW && \
        ${PARSELIST} -v mode=populate ${LISTS} | \
        ${HOST_SH} -e ${POPULATE_DEBUG} \
        && touch ${WORKBUILT} ; \
        }

(This was found by fgrepping for "mode=populate" through /usr/src/distrib,
Grep is the hacker's friend.  A tip for any aspiring youth in
attendance -- look for stuff that isn't the result of an expanded
variable.

In the interests of satisfying my curiosity, this was changed to include
some instrumentation, as suggested by Mr Laight, thusly

--- Makefile.image.orig 2007-01-21 07:39:45.000000000 -0500
+++ Makefile.image      2007-01-21 07:45:08.000000000 -0500
@@ -49,7 +49,8 @@
        mkdir -m 755 ${WORKDIR} &&  \
        ${TOOL_MTREE} -def ${WORKSPEC} -p ${WORKDIR}/ -UW && \
        ${PARSELIST} -v mode=populate ${LISTS} | \
-       ${HOST_SH} -e ${POPULATE_DEBUG} \
+       /usr/bin/tee /home/awk-out.bug | \
+       ${HOST_SH} -evx ${POPULATE_DEBUG} \
        && touch ${WORKBUILT} ; \
        }

Without any other changes to /usr/src/*, /usr/obj, RELEASEDIR or
DESTDIR,  I repeat the build.sh command, which is

./build.sh -u -U -D /home/destdir -R /home/release release 
	| tee /home/build.release.out 

Stay tuned to this thread for the exciting results!

Dave the Patient