Subject: yet more parallel-make races
To: None <tech-install@netbsd.org, current-users@netbsd.org>
From: Chuck Silvers <chuq@chuq.com>
List: current-users
Date: 09/13/2005 08:15:02
--ikeVEW9yuYc//A+q
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline

hi,

I found a couple more problems with parallel makes.

(1) sys/arch/i386/stand

	there's trouble with the shared "lib" directories.  sometimes
	the "mkdir -p" from one of the subdirectories of lib will create
	a lib directory before the LIBOBJ stuff has a chance to make
	a lib symlink.  switching to using .BEGIN for these seems to
	work better.

(2) usr.bin/tn3270

	both tn3270/tn3270 and tn3270/mset want to depend on
	tools/mkastosc/mkastosc, and sometimes they both try to build it
	and collide.  or maybe they collide with the original SUBDIR
	processing.  either way adding a .WAIT to the SUBDIRS list
	after "tools" should take care of this.

both patches are attached, anyone have any objections to me applying them?

-Chuck

--ikeVEW9yuYc//A+q
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment; filename="diff.i386stand-race"

? src/sys/arch/i386/stand/z
Index: src/sys/arch/i386/stand/Makefile.booters
===================================================================
RCS file: /cvsroot/src/sys/arch/i386/stand/Makefile.booters,v
retrieving revision 1.60
diff -u -p -r1.60 Makefile.booters
--- src/sys/arch/i386/stand/Makefile.booters	5 May 2005 18:03:04 -0000	1.60
+++ src/sys/arch/i386/stand/Makefile.booters	13 Sep 2005 15:06:20 -0000
@@ -49,30 +49,16 @@ KERNMISCMAKEFLAGS="LIBKERN_ARCH=i386"
 CLEANFILES+= ${STARTFILE} vers.c ${BASE}.list
 SRCS+=	vers.c
 
-.if !make(obj) && !make(clean) && !make(cleandir)
-.NOPATH: machine x86
-.endif
-
-depend dependall realdepend realall: machine x86 lib
 CLEANFILES+= machine x86
 
-machine:: x86
-	-rm -f $@
-	ln -s $S/arch/i386/include $@
-
-x86::
-	-rm -f $@
-	ln -s $S/arch/x86/include $@
-
-${OBJS} ${ROMSTART} ${DOSSTART} ${PXESTART}: machine x86 lib
-
-lib:
+.if !make(obj) && !make(clean) && !make(cleandir)
+.BEGIN:
+	-rm -f machine && ln -s $S/arch/i386/include machine
+	-rm -f x86 && ln -s $S/arch/x86/include x86
 .ifdef LIBOBJ
-	-rm -f $@
-	ln -s ${LIBOBJ}/lib .
-	[ -d ${LIBOBJ}/lib ] || mkdir ${LIBOBJ}/lib
-.else
-	mkdir lib
+	-rm -f lib && ln -s ${LIBOBJ}/lib lib
+	mkdir -p ${LIBOBJ}/lib
+.endif
 .endif
 
 ### find out what to use for libkern
Index: src/sys/arch/i386/stand/boot/Makefile.boot
===================================================================
RCS file: /cvsroot/src/sys/arch/i386/stand/boot/Makefile.boot,v
retrieving revision 1.23
diff -u -p -r1.23 Makefile.boot
--- src/sys/arch/i386/stand/boot/Makefile.boot	22 Jun 2005 06:06:34 -0000	1.23
+++ src/sys/arch/i386/stand/boot/Makefile.boot	13 Sep 2005 15:06:20 -0000
@@ -82,30 +82,16 @@ SAMISCMAKEFLAGS+= SA_INCLUDE_NET=no	# Ne
 
 I386_STAND_DIR?= $S/arch/i386/stand
 
-.if !make(obj) && !make(clean) && !make(cleandir)
-.NOPATH: machine x86
-.endif
-
-depend dependall realdepend realall: machine x86 lib
 CLEANFILES+= machine x86
 
-machine::
-	-rm -f $@
-	ln -s $S/arch/i386/include $@
-
-x86::
-	-rm -f $@
-	ln -s $S/arch/x86/include $@
-
-${OBJS}: machine x86 lib
-
-lib:
+.if !make(obj) && !make(clean) && !make(cleandir)
+.BEGIN:
+	-rm -f machine && ln -s $S/arch/i386/include machine
+	-rm -f x86 && ln -s $S/arch/x86/include x86
 .ifdef LIBOBJ
-	-rm -f $@
-	ln -s ${LIBOBJ}/lib .
-	[ -d ${LIBOBJ}/lib ] || mkdir ${LIBOBJ}/lib
-.else
-	mkdir lib
+	-rm -f lib && ln -s ${LIBOBJ}/lib lib
+	mkdir -p ${LIBOBJ}/lib
+.endif
 .endif
 
 ### find out what to use for libi386
Index: src/sys/arch/i386/stand/bootxx/Makefile.bootxx
===================================================================
RCS file: /cvsroot/src/sys/arch/i386/stand/bootxx/Makefile.bootxx,v
retrieving revision 1.17
diff -u -p -r1.17 Makefile.bootxx
--- src/sys/arch/i386/stand/bootxx/Makefile.bootxx	5 May 2005 18:03:04 -0000	1.17
+++ src/sys/arch/i386/stand/bootxx/Makefile.bootxx	13 Sep 2005 15:06:20 -0000
@@ -86,30 +86,16 @@ CPPFLAGS+= -DLIBSA_SINGLE_FILESYSTEM=xxf
 
 I386_STAND_DIR?= $S/arch/i386/stand
 
-.if !make(obj) && !make(clean) && !make(cleandir)
-.NOPATH: machine x86
-.endif
-
-depend dependall realdepend realall: machine x86 lib
 CLEANFILES+= machine x86
 
-machine::
-	-rm -f $@
-	ln -s $S/arch/i386/include $@
-
-x86::
-	-rm -f $@
-	ln -s $S/arch/x86/include $@
-
-${OBJS}: machine x86 lib
-
-lib:
+.if !make(obj) && !make(clean) && !make(cleandir)
+.BEGIN:
+	-rm -f machine && ln -s $S/arch/i386/include machine
+	-rm -f x86 && ln -s $S/arch/x86/include x86
 .ifdef LIBOBJ
-	-rm -f $@
-	ln -s ${LIBOBJ}/lib .
-	[ -d ${LIBOBJ}/lib ] || mkdir ${LIBOBJ}/lib
-.else
-	mkdir lib
+	-rm -f lib && ln -s ${LIBOBJ}/lib lib
+	mkdir -p ${LIBOBJ}/lib
+.endif
 .endif
 
 ### find out what to use for libi386

--ikeVEW9yuYc//A+q
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment; filename="diff.tn3270-race"

Index: src/usr.bin/tn3270/Makefile
===================================================================
RCS file: /cvsroot/src/usr.bin/tn3270/Makefile,v
retrieving revision 1.7
diff -u -p -r1.7 Makefile
--- src/usr.bin/tn3270/Makefile	5 Sep 1998 14:58:51 -0000	1.7
+++ src/usr.bin/tn3270/Makefile	13 Sep 2005 15:10:17 -0000
@@ -2,7 +2,7 @@
 
 .if make(clean) || make(cleandir) || make(distclean) || make(depend) || \
 	make(obj) || make(lint)
-SUBDIR += tools
+SUBDIR += tools .WAIT
 .endif
 SUBDIR += tn3270 mset
 

--ikeVEW9yuYc//A+q--