mirror of
https://github.com/gnustep/tools-make.git
synced 2025-04-23 22:33:28 +00:00
Install and uninstall in non-parallel mode even in parallel-subdirectories.make to root out race conditions for end-users. Updated documentation.
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/tools/make/trunk@29612 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
parent
8275342570
commit
7136d310d2
4 changed files with 40 additions and 22 deletions
|
@ -1,3 +1,11 @@
|
|||
2010-02-13 Nicola Pero <nicola.pero@meta-innovation.com>
|
||||
|
||||
* Master/parallel-subdirectories.make (internal-install
|
||||
internal-uninstall): Install and uninstall in non-parallel mode to
|
||||
avoid any race conditions when installing or uninstalling.
|
||||
* Documentation/releasenotes.texi: Updated.
|
||||
* RELEASENOTES: Regenerated.
|
||||
|
||||
2010-02-12 Nicola Pero <nicola.pero@meta-innovation.com>
|
||||
|
||||
Implemented new API to build subdirectories. aggregate.make is
|
||||
|
|
|
@ -26,14 +26,11 @@ Using parallel-subdirectories.make often produces massively faster
|
|||
builds (or installs or cleans) during a parallel build on a multicore
|
||||
machine. But if you use parallel-subdirectories.make, you need to
|
||||
make sure the different subdirectories are completely independent of
|
||||
each other. One non-obvious race condition that you may to consider
|
||||
is the creation of installation directories. If you have two
|
||||
subdirectories, built in parallel, which install into the same custom
|
||||
installation directory, there may be a race condition (ie, a
|
||||
concurrency problem) when you install as they both try to create the
|
||||
installation directory. In that case, you should manually create the
|
||||
directory in your top-level GNUmakefile using a 'before-install::'
|
||||
rule.
|
||||
each other. The operations that are executed in parallel are 'all',
|
||||
'clean', 'distclean', 'check' and 'strings'. 'install' and
|
||||
'uninstall' are still executed in serial order to prevent any
|
||||
concurrency problems when creating (or removing) common installation
|
||||
directories.
|
||||
|
||||
aggregate.make is still available if you want or need to be
|
||||
backwards-compatible with older versions of gnustep-make. It is
|
||||
|
|
|
@ -50,8 +50,7 @@ ifneq ($(PARALLEL_SUBDIRECTORIES),)
|
|||
# submake invocation will be able to build its
|
||||
# 'internal-master-subdirectories-xxx' target in parallel. If the
|
||||
# build is not parallel, that submake will simply build normally.
|
||||
internal-all internal-install internal-uninstall \
|
||||
internal-clean internal-distclean \
|
||||
internal-all internal-clean internal-distclean \
|
||||
internal-check internal-strings::
|
||||
$(ECHO_NOTHING)operation=$(subst internal-,,$@); \
|
||||
$(MAKE) -f $(MAKEFILE_NAME) --no-print-directory --no-keep-going \
|
||||
|
@ -61,16 +60,12 @@ ifneq ($(PARALLEL_SUBDIRECTORIES),)
|
|||
|
||||
.PHONY: \
|
||||
internal-master-subdirectories-all \
|
||||
internal-master-subdirectories-install \
|
||||
internal-master-subdirectories-uninstall \
|
||||
internal-master-subdirectories-clean \
|
||||
internal-master-subdirectories-distclean \
|
||||
internal-master-subdirectories-check \
|
||||
internal-master-subdirectories-strings
|
||||
|
||||
internal-master-subdirectories-all: $(PARALLEL_SUBDIRECTORIES:=.all.subdirectories)
|
||||
internal-master-subdirectories-install: $(PARALLEL_SUBDIRECTORIES:=.install.subdirectories)
|
||||
internal-master-subdirectories-uninstall: $(PARALLEL_SUBDIRECTORIES:=.uninstall.subdirectories)
|
||||
internal-master-subdirectories-clean: $(PARALLEL_SUBDIRECTORIES:=.clean.subdirectories)
|
||||
internal-master-subdirectories-distclean: $(PARALLEL_SUBDIRECTORIES:=.distclean.subdirectories)
|
||||
internal-master-subdirectories-check: $(PARALLEL_SUBDIRECTORIES:=.check.subdirectories)
|
||||
|
@ -96,4 +91,25 @@ ifneq ($(PARALLEL_SUBDIRECTORIES),)
|
|||
:; else exit $$?; \
|
||||
fi$(END_ECHO)
|
||||
|
||||
# We still do 'install' and 'uninstall' in non-parallel mode, to
|
||||
# prevent any race conditions with the creation of installation
|
||||
# directories. TODO: It would be cool to make this configurable
|
||||
# so you could make it parallel if you so wish.
|
||||
internal-install internal-uninstall::
|
||||
$(ECHO_NOTHING)operation=$(subst internal-,,$@); \
|
||||
abs_build_dir="$(ABS_GNUSTEP_BUILD_DIR)"; \
|
||||
for directory in $(PARALLEL_SUBDIRECTORIES); do \
|
||||
$(ECHO_MAKING_OPERATION_IN_DIRECTORY) \
|
||||
if [ "$${abs_build_dir}" = "." ]; then \
|
||||
gsbuild="."; \
|
||||
else \
|
||||
gsbuild="$${abs_build_dir}/$$directory"; \
|
||||
fi; \
|
||||
if $(MAKE) -C $$directory -f $(MAKEFILE_NAME) $(GNUSTEP_MAKE_NO_PRINT_DIRECTORY_FLAG) --no-keep-going \
|
||||
$$operation \
|
||||
GNUSTEP_BUILD_DIR="$$gsbuild" _GNUSTEP_MAKE_PARALLEL=no; then \
|
||||
:; else exit $$?; \
|
||||
fi; \
|
||||
done$(END_ECHO)
|
||||
|
||||
endif
|
13
RELEASENOTES
13
RELEASENOTES
|
@ -27,14 +27,11 @@ using a newer version of the make system.
|
|||
builds (or installs or cleans) during a parallel build on a
|
||||
multicore machine. But if you use parallel-subdirectories.make,
|
||||
you need to make sure the different subdirectories are completely
|
||||
independent of each other. One non-obvious race condition that
|
||||
you may to consider is the creation of installation directories.
|
||||
If you have two subdirectories, built in parallel, which install
|
||||
into the same custom installation directory, there may be a race
|
||||
condition (ie, a concurrency problem) when you install as they
|
||||
both try to create the installation directory. In that case, you
|
||||
should manually create the directory in your top-level GNUmakefile
|
||||
using a 'before-install::' rule.
|
||||
independent of each other. The operations that are executed in
|
||||
parallel are 'all', 'clean', 'distclean', 'check' and 'strings'.
|
||||
'install' and 'uninstall' are still executed in serial order to
|
||||
prevent any concurrency problems when creating (or removing)
|
||||
common installation directories.
|
||||
|
||||
aggregate.make is still available if you want or need to be
|
||||
backwards-compatible with older versions of gnustep-make. It is
|
||||
|
|
Loading…
Reference in a new issue