From: Andrew Deason Date: Sun, 5 Apr 2020 21:29:52 +0000 (-0500) Subject: libafs: Serialize INSTDIRS/DESTDIRS and COMPDIRS X-Git-Tag: openafs-devel-1_9_0~114 X-Git-Url: http://git.openafs.org/?p=openafs.git;a=commitdiff_plain;h=3db8c37e8ef6bea0f03ef6b8f82ed93d52937d7d libafs: Serialize INSTDIRS/DESTDIRS and COMPDIRS Our libafs build logic involves a few targets that 'cd' into a per-kernel subdir: notably INSTDIRS and DESTDIRS (the targets to 'make install' or 'make dest' our kernel modules) and COMPDIRS (the target to setup/build the kernel module). Both of these potentially 'cd' into a subdirectory (e.g. MODLOAD64), and run some make rules. Since INSTDIRS and COMPDIRS are different targets and don't depend on each other for many platforms, running those rules can happen in parallel. After they 'cd' into the relevant dir, they run a new 'make' in a subshell, and so underlying rules for building e.g. AFS_component_version_number.c are not serialized. So for a parallel build on, say, Solaris, we can encounter errors when two sub-makes try to make AFS_component_version_number.c at the same time, which looks something like this (with various lines output from other sub-processes mixed in): cd src && cd sys && gmake install gmake[3]: Leaving directory '/[...]/src/libuafs' rm -f AFS_component_version_number.c.NEW /opt/developerstudio12.6/bin/cc [...] -D_KERNEL -DSYSV -dn -m64 -xmodel=kernel -xvector=%none -xregs=no%float -Wu,-save_args -o AFS_component_version_number.o -c AFS_component_version_number.c mv: cannot access AFS_component_version_number.c.NEW gmake[4]: *** [/[...]/src/config/Makefile.version:13: AFS_component_version_number.c] Error 2 gmake[4]: Leaving directory '/[...]/src/libafs/MODLOAD64' gmake[3]: *** [Makefile:85: solaris_instdirs] Error 2 gmake[3]: *** Waiting for unfinished jobs.... To avoid this, just make INSTDIRS and DESTDIRS depend on COMPDIRS, so we can make sure they don't run at the same time. Change-Id: I2510e1894c44dd0864cf2eab5613b805342b6718 Reviewed-on: https://gerrit.openafs.org/14137 Tested-by: BuildBot Reviewed-by: Benjamin Kaduk --- diff --git a/src/libafs/Makefile.common.in b/src/libafs/Makefile.common.in index 1a958f1..03e0374 100644 --- a/src/libafs/Makefile.common.in +++ b/src/libafs/Makefile.common.in @@ -52,6 +52,11 @@ system: all install: all $(INSTDIRS) dest: all $(DESTDIRS) +# Don't let INSTDIRS or DESTDIRS run in parallel with COMPDIRS. They both do +# some work in sub-makes in the same directory that may conflict with each +# other (e.g. generating AFS_component_version_number.c). +$(INSTDIRS) $(DESTDIRS): $(COMPDIRS) + all: setup $(COMPDIRS) single_compdir single_instdir single_destdir: setup