svn commit: r204824 - head/sys/conf

David O'Brien obrien at freebsd.org
Wed Mar 10 04:34:43 UTC 2010


On Mon, Mar 08, 2010 at 09:06:59AM -0700, M. Warner Losh wrote:
> In message: <20100308010125.GA6387 at dragon.NUXI.org>
>             "David O'Brien" <obrien at FreeBSD.org> writes:
> : On Sun, Mar 07, 2010 at 02:36:19PM -0700, M. Warner Losh wrote:
> : > Please back out this change.  It is unwise, I think.
> : 
> : Instead I'd rather fix it for the use case you mention.
> 
> I'd still rather you back it out because it introduces a significant
> regression in speed, see below...

Can you please apply this diff:

Index: conf/kern.post.mk
===================================================================
--- conf/kern.post.mk	(revision 204912)
+++ conf/kern.post.mk	(working copy)
@@ -247 +247 @@ vers.c: $S/conf/newvers.sh $S/sys/param.
-	MAKE=${MAKE} sh $S/conf/newvers.sh ${KERN_IDENT}
+	MAKE=${MAKE} sh -x $S/conf/newvers.sh ${KERN_IDENT}

and send me the output of:
    rm /usr/obj/MM/test/sys/GENERIC/vers*
    make -DNOCLEAN buildkernel

I would like to understand and fix how my patch causes you longer build
times than r197433.

Attached are my typescripts for r197433 and the patch I sent you.  The
diff of which is:


--- typescript,r197433	2010-03-09 20:11:35.000000000 -0800
+++ typescript,new	2010-03-09 20:11:50.000000000 -0800
@@ -104,17 +104,16 @@ MAKE=make sh -x /MM/test/sys/conf/newver
 + cat version
 + pwd
 + date
-+ v=1 u=rootk d=/usr/obj/MM/test/sys/GENERIC h=dragon t='Tue Mar  9 20:06:11 PST 2010'
++ v=6 u=rootk d=/usr/obj/MM/test/sys/GENERIC h=dragon t='Tue Mar  9 20:20:33 PST 2010'
 + make -V KERN_IDENT
 + i=GENERIC
-+ SRCDIR=/MM/test/sys/GENERIC
-+ [ -n i386 ]
-+ SRCDIR=/MM/test/sys/GENERIC
-+ SRCDIR=/MM/test
++ dirname /MM/test/sys/conf/newvers.sh
++ realpath /MM/test/sys/conf/..
++ SRCDIR=/MM/test/sys
 + [ -d /MM/test/sys/.svn -a -x /bin/svnversion ]
-+ [ -d /MM/test/.git -a -x /bin/git ]
++ [ -d /MM/test/sys/.git -a -x /bin/git ]
 + [ -d /MM/test/sys/.svn -a -x /usr/bin/svnversion ]
-+ [ -d /MM/test/.git -a -x /usr/bin/git ]
++ [ -d /MM/test/sys/.git -a -x /usr/bin/git ]
 + [ -d /MM/test/sys/.svn -a -x /usr/local/bin/svnversion ]
 + svnversion=/usr/local/bin/svnversion
 + break

As you can see, the same .svn/ directory is used in my patch as in
r197433.

I think looking for .git/ in the same directory as .svn/ make sense, but
I'm not a heavy git user.  Assuming you disagree, the attached patch will
look above the kernel directory.  If it bothers you to run realpath(1)
twice, I can save its output in a shell var and use that.



> : Index: newvers.sh
..
> : -	SRCDIR=${d##*obj}
..

> : +	SRCDIR=$(realpath $(dirname $0)/..)

Is your newver.sh script in the normal place within 'conf/'?



> : Do you get the subversion revision in your vers.c file with this patch?
> 
> Well, except that you get the revision for the whole tree, instead of
> just for the kernel.  And this takes a *LOT* longer to compute.  The
> whole reason we did the sys hack was to make build times not suck...

Please send me the typescript output from with conf/kern.post.mk
patch.  I need to see how "SRCDIR" is getting set to "/usr/src" for you
and not "/usr/src/sys".

-- 
-- David  (obrien at FreeBSD.org)
-------------- next part --------------
MAKE=make sh -x /MM/test/sys/conf/newvers.sh GENERIC
+ TYPE=FreeBSD
+ REVISION=9.0
+ BRANCH=CURRENT
+ [ X != X ]
+ RELEASE=9.0-CURRENT
+ VERSION='FreeBSD 9.0-CURRENT'
+ [ X != X ]
+ dirname /MM/test/sys/conf/newvers.sh
+ awk '/__FreeBSD_version.*propagated to newvers/ {print $3}' /MM/test/sys/conf/../sys/param.h
+ RELDATE=900009
+ b=share/examples/etc/bsd-style-copyright
+ date +%Y
+ year=2010
+ [ -r ../share/examples/etc/bsd-style-copyright ]
+ [ -r ../../share/examples/etc/bsd-style-copyright ]
+ [ -r ../../../share/examples/etc/bsd-style-copyright ]
+ [ -r /usr/src/share/examples/etc/bsd-style-copyright ]
+ sed -e 's/\[year\]/1992-2010/' -e 's/\[your name here\]\.* /The FreeBSD Project./' -e 's/\[your name\]\.*/The FreeBSD Project./' -e '/\[id for your version control system, if any\]/d' /usr/src/share/examples/etc/bsd-style-copyright
+ COPYRIGHT='/*-
 * Copyright (c) 1992-2010 The FreeBSD Project.
 * All rights reserved.
 *
 * Redistribution and use in source and binary forms, with or without
 * modification, are permitted provided that the following conditions
 * are met:
 * 1. Redistributions of source code must retain the above copyright
 *    notice, this list of conditions and the following disclaimer.
 * 2. Redistributions in binary form must reproduce the above copyright
 *    notice, this list of conditions and the following disclaimer in the
 *    documentation and/or other materials provided with the distribution.
 *
 * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'\'\'' AND
 * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
 * ARE DISCLAIMED.  IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
 * SUCH DAMAGE.
 *
 */'
+ break
+ [ 'X/*-
 * Copyright (c) 1992-2010 The FreeBSD Project.
 * All rights reserved.
 *
 * Redistribution and use in source and binary forms, with or without
 * modification, are permitted provided that the following conditions
 * are met:
 * 1. Redistributions of source code must retain the above copyright
 *    notice, this list of conditions and the following disclaimer.
 * 2. Redistributions in binary form must reproduce the above copyright
 *    notice, this list of conditions and the following disclaimer in the
 *    documentation and/or other materials provided with the distribution.
 *
 * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'\'\'' AND
 * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
 * ARE DISCLAIMED.  IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
 * SUCH DAMAGE.
 *
 */' = X ]
+ COPYRIGHT='/*-
 * Copyright (c) 1992-2010 The FreeBSD Project.
 * All rights reserved.
 *
 * Redistribution and use in source and binary forms, with or without
 * modification, are permitted provided that the following conditions
 * are met:
 * 1. Redistributions of source code must retain the above copyright
 *    notice, this list of conditions and the following disclaimer.
 * 2. Redistributions in binary form must reproduce the above copyright
 *    notice, this list of conditions and the following disclaimer in the
 *    documentation and/or other materials provided with the distribution.
 *
 * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'\'\'' AND
 * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
 * ARE DISCLAIMED.  IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
 * SUCH DAMAGE.
 *
 */
'
+ LC_ALL=C
+ export LC_ALL
+ [ ! -r version ]
+ touch version
+ cat version
+ pwd
+ date
+ v=1 u=rootk d=/usr/obj/MM/test/sys/GENERIC h=dragon t='Tue Mar  9 19:06:11 PST 2010'
+ make -V KERN_IDENT
+ i=GENERIC
+ SRCDIR=/MM/test/sys/GENERIC
+ [ -n i386 ]
+ SRCDIR=/MM/test/sys/GENERIC
+ SRCDIR=/MM/test
+ [ -d /MM/test/sys/.svn -a -x /bin/svnversion ]
+ [ -d /MM/test/.git -a -x /bin/git ]
+ [ -d /MM/test/sys/.svn -a -x /usr/bin/svnversion ]
+ [ -d /MM/test/.git -a -x /usr/bin/git ]
+ [ -d /MM/test/sys/.svn -a -x /usr/local/bin/svnversion ]
+ svnversion=/usr/local/bin/svnversion
+ break
+ [ -n /usr/local/bin/svnversion ]
+ cd /MM/test/sys
+ /usr/local/bin/svnversion
+ svn=' r204912M'
+ [ -n '' ]
+ cat
+ expr 1 + 1
+ echo 2
-------------- next part --------------
MAKE=make sh -x /MM/test/sys/conf/newvers.sh GENERIC
+ TYPE=FreeBSD
+ REVISION=9.0
+ BRANCH=CURRENT
+ [ X != X ]
+ RELEASE=9.0-CURRENT
+ VERSION='FreeBSD 9.0-CURRENT'
+ [ X != X ]
+ dirname /MM/test/sys/conf/newvers.sh
+ awk '/__FreeBSD_version.*propagated to newvers/ {print $3}' /MM/test/sys/conf/../sys/param.h
+ RELDATE=900009
+ b=share/examples/etc/bsd-style-copyright
+ date +%Y
+ year=2010
+ [ -r ../share/examples/etc/bsd-style-copyright ]
+ [ -r ../../share/examples/etc/bsd-style-copyright ]
+ [ -r ../../../share/examples/etc/bsd-style-copyright ]
+ [ -r /usr/src/share/examples/etc/bsd-style-copyright ]
+ sed -e 's/\[year\]/1992-2010/' -e 's/\[your name here\]\.* /The FreeBSD Project./' -e 's/\[your name\]\.*/The FreeBSD Project./' -e '/\[id for your version control system, if any\]/d' /usr/src/share/examples/etc/bsd-style-copyright
+ COPYRIGHT='/*-
 * Copyright (c) 1992-2010 The FreeBSD Project.
 * All rights reserved.
 *
 * Redistribution and use in source and binary forms, with or without
 * modification, are permitted provided that the following conditions
 * are met:
 * 1. Redistributions of source code must retain the above copyright
 *    notice, this list of conditions and the following disclaimer.
 * 2. Redistributions in binary form must reproduce the above copyright
 *    notice, this list of conditions and the following disclaimer in the
 *    documentation and/or other materials provided with the distribution.
 *
 * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'\'\'' AND
 * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
 * ARE DISCLAIMED.  IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
 * SUCH DAMAGE.
 *
 */'
+ break
+ [ 'X/*-
 * Copyright (c) 1992-2010 The FreeBSD Project.
 * All rights reserved.
 *
 * Redistribution and use in source and binary forms, with or without
 * modification, are permitted provided that the following conditions
 * are met:
 * 1. Redistributions of source code must retain the above copyright
 *    notice, this list of conditions and the following disclaimer.
 * 2. Redistributions in binary form must reproduce the above copyright
 *    notice, this list of conditions and the following disclaimer in the
 *    documentation and/or other materials provided with the distribution.
 *
 * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'\'\'' AND
 * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
 * ARE DISCLAIMED.  IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
 * SUCH DAMAGE.
 *
 */' = X ]
+ COPYRIGHT='/*-
 * Copyright (c) 1992-2010 The FreeBSD Project.
 * All rights reserved.
 *
 * Redistribution and use in source and binary forms, with or without
 * modification, are permitted provided that the following conditions
 * are met:
 * 1. Redistributions of source code must retain the above copyright
 *    notice, this list of conditions and the following disclaimer.
 * 2. Redistributions in binary form must reproduce the above copyright
 *    notice, this list of conditions and the following disclaimer in the
 *    documentation and/or other materials provided with the distribution.
 *
 * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'\'\'' AND
 * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
 * ARE DISCLAIMED.  IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
 * SUCH DAMAGE.
 *
 */
'
+ LC_ALL=C
+ export LC_ALL
+ [ ! -r version ]
+ touch version
+ cat version
+ pwd
+ date
+ v=6 u=rootk d=/usr/obj/MM/test/sys/GENERIC h=dragon t='Tue Mar  9 19:40:33 PST 2010'
+ make -V KERN_IDENT
+ i=GENERIC
+ dirname /MM/test/sys/conf/newvers.sh
+ realpath /MM/test/sys/conf/..
+ SRCDIR=/MM/test/sys
+ [ -d /MM/test/sys/.svn -a -x /bin/svnversion ]
+ [ -d /MM/test/sys/.git -a -x /bin/git ]
+ [ -d /MM/test/sys/.svn -a -x /usr/bin/svnversion ]
+ [ -d /MM/test/sys/.git -a -x /usr/bin/git ]
+ [ -d /MM/test/sys/.svn -a -x /usr/local/bin/svnversion ]
+ svnversion=/usr/local/bin/svnversion
+ break
+ [ -n /usr/local/bin/svnversion ]
+ cd /MM/test/sys
+ /usr/local/bin/svnversion
+ svn=' r204912M'
+ [ -n '' ]
+ cat
+ expr 1 + 1
+ echo 2
-------------- next part --------------
A non-text attachment was scrubbed...
Name: srcgit.patch
Type: text/x-diff
Size: 1068 bytes
Desc: not available
Url : http://lists.freebsd.org/pipermail/svn-src-all/attachments/20100310/5084208f/srcgit.bin


More information about the svn-src-all mailing list