From owner-freebsd-arch@FreeBSD.ORG Mon Oct 26 15:45:17 2009 Return-Path: Delivered-To: freebsd-arch@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 7BAA5106568B for ; Mon, 26 Oct 2009 15:45:17 +0000 (UTC) (envelope-from jhb@freebsd.org) Received: from cyrus.watson.org (cyrus.watson.org [65.122.17.42]) by mx1.freebsd.org (Postfix) with ESMTP id 4CAA28FC08 for ; Mon, 26 Oct 2009 15:45:17 +0000 (UTC) Received: from bigwig.baldwin.cx (66.111.2.69.static.nyinternet.net [66.111.2.69]) by cyrus.watson.org (Postfix) with ESMTPSA id DA6EA46B0C; Mon, 26 Oct 2009 11:45:16 -0400 (EDT) Received: from jhbbsd.hudson-trading.com (unknown [209.249.190.8]) by bigwig.baldwin.cx (Postfix) with ESMTPA id ED5448A01D; Mon, 26 Oct 2009 11:45:15 -0400 (EDT) From: John Baldwin To: freebsd-arch@freebsd.org Date: Mon, 26 Oct 2009 08:30:24 -0400 User-Agent: KMail/1.9.7 References: <20091025134226.Q91695@maildrop.int.zabbadoz.net> In-Reply-To: <20091025134226.Q91695@maildrop.int.zabbadoz.net> MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit Content-Disposition: inline Message-Id: <200910260830.25168.jhb@freebsd.org> X-Greylist: Sender succeeded SMTP AUTH, not delayed by milter-greylist-4.0.1 (bigwig.baldwin.cx); Mon, 26 Oct 2009 11:45:15 -0400 (EDT) X-Virus-Scanned: clamav-milter 0.95.1 at bigwig.baldwin.cx X-Virus-Status: Clean X-Spam-Status: No, score=-2.5 required=4.2 tests=AWL,BAYES_00, DATE_IN_PAST_03_06,RDNS_NONE autolearn=no version=3.2.5 X-Spam-Checker-Version: SpamAssassin 3.2.5 (2008-06-10) on bigwig.baldwin.cx Cc: "Bjoern A. Zeeb" Subject: Re: src/Makefile, universe, LINT, VIMAGE, .. X-BeenThere: freebsd-arch@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Discussion related to FreeBSD architecture List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 26 Oct 2009 15:45:17 -0000 On Sunday 25 October 2009 9:56:59 am Bjoern A. Zeeb wrote: > Hi, > > since the advent of VIMAGE in FreeBSD HEAD we've had a way to compile > the network stack in multiple ways. Unfortunately LINT can always only > test one of the options. > > In addition I, for quite a while, had other combinations I tested like > nooptions INET6 > or > nooptions INET > nooptions INET6 > etc. > > > We need a solution to be able to test those things and make sure to not > break those combinations (atm at least VIMAGE). > > Unfortunately our build system and kernel configurations are not there > yet. I had been pondering whether to just commit a LINT-VIMAGE file > that would include LINT and just fail if that wasn't there but then > realized that this will not fix the real problem. Some archs do not > even have a LINT file, btw. > > The information attached to the diff will tell you more about what I > did. I am not yet convinced that the solution presented further > down is the right thing to do (and would do the right thing in all > cases though I tested the obvious ones). > > Thus I'd like to solicit feedback, comments, improved version, ..;) > > You can also fetch the diff temporary from: > http://people.freebsd.org/~bz/20091025-01-make-LINT-VIMAGE.diff > > Thanks, > /bz > > -- > Bjoern A. Zeeb It will not break if you know what you are doing. > > ! > ! In sys//conf/Makefile set TARGET to . That allows > ! sys/conf/makeLINT.mk to only do certain things for certain > ! architectures. > ! > ! Generate a second LINT configuration for i386 and amd64 in > ! sys/conf/makeLINT.mk, which includes LINT and sets options VIMAGE > ! so that we will have VIMAGE LINT builds[1]. > ! > ! To avoid hardcoding further kernel configuration names for > ! make universe, split the logic into two parts: > ! - 1st to build worlds and generate kernel configs like LINT. > ! - 2nd to build kernels for a given TARGET architecture correctly > ! finding all newly generated configs, not knowing anything about > ! LINT anymore. (*) > ! > ! (*) If you know better/cleaner/... ways to do this, let me know. > ! > ! Annotation: this also allows one to add more such kernel configs > ! like LINT-NOINET, LINT-NOINET6, .. that I have had for ages now > ! to generate and maintain in a single place. > ! > ! > ! Requested by: jhb [1] > ! Discussed with: jhb, rwatson [1] > ! Reviewed by: > ! MFC After: > ! > Index: Makefile > =================================================================== > --- Makefile (revision 198467) > +++ Makefile (working copy) > @@ -297,10 +297,6 @@ > rm -f ${FAILFILE} > .endif > .for target in ${TARGETS} > -KERNCONFS!= cd ${.CURDIR}/sys/${target}/conf && \ > - find [A-Z0-9]*[A-Z0-9] -type f -maxdepth 0 \ > - ! -name DEFAULTS ! -name LINT > -KERNCONFS:= ${KERNCONFS:S/^NOTES$/LINT/} > universe: universe_${target} > .ORDER: universe_prologue universe_${target} universe_epilogue > universe_${target}: > @@ -320,15 +316,7 @@ > (echo "${target} 'make LINT' failed," \ > "check _.${target}.makeLINT for details"| ${MAKEFAIL})) > .endif > -.for kernel in ${KERNCONFS} > - @(cd ${.CURDIR} && env __MAKE_CONF=/dev/null \ > - ${MAKE} ${JFLAG} buildkernel \ > - TARGET=${target} \ > - KERNCONF=${kernel} \ > - > _.${target}.${kernel} 2>&1 || \ > - (echo "${target} ${kernel} kernel failed," \ > - "check _.${target}.${kernel} for details"| ${MAKEFAIL})) > -.endfor > + cd ${.CURDIR} && ${MAKE} ${.MAKEFLAGS} TARGET=${target} universe_kernels > @echo ">> ${target} completed on `LC_ALL=C date`" > .endfor > universe: universe_epilogue > @@ -345,3 +333,18 @@ > fi > .endif > .endif > + > +universe_kernels: universe_kernels_foo > +TARGET?= ${BUILD_ARCH} > +KERNCONFS!= cd ${.CURDIR}/sys/${TARGET}/conf && \ > + find [A-Z0-9]*[A-Z0-9] -type f -maxdepth 0 \ > + ! -name DEFAULTS ! -name NOTES > +KERNCONFS:= ${KERNCONFS} > +universe_kernels_foo: > +.for kernel in ${KERNCONFS} > + @(cd ${.CURDIR} && env __MAKE_CONF=/dev/null \ > + ${MAKE} ${JFLAG} buildkernel TARGET=${TARGET} KERNCONF=${kernel} \ > + > _.${TARGET}.${kernel} 2>&1 || \ > + (echo "${TARGET} ${kernel} kernel failed," \ > + "check _.${TARGET}.${kernel} for details"| ${MAKEFAIL})) > +.endfor Hmm, I'm not sure why you need a universe_kernels_foo target that universe_kernels depends on? Also, I would probably prefer to have universe_kernels come after universe_$target and before universe_epilogue. > Index: sys/conf/makeLINT.mk > =================================================================== > --- sys/conf/makeLINT.mk (revision 198467) > +++ sys/conf/makeLINT.mk (working copy) > @@ -5,7 +5,15 @@ > > clean: > rm -f LINT > +.if ${TARGET} == "amd64" || ${TARGET} == "i386" > + rm -f LINT=VIMAGE > +.endif s/=/-/ BTW, I'm not sure why you would only enable VIMAGE for these two archs rather than doing it for all archs that have a LINT? -- John Baldwin