From 7ec7deaa9c02f07ed624a18310eef4f36b587564 Mon Sep 17 00:00:00 2001 From: MoonlightSentinel Date: Wed, 5 Aug 2020 17:06:45 +0200 Subject: [PATCH] Use `.NOTPARALLEL` in posix.mak instead of lockfiles in `build.d` They achieve the same behaviour as `posix.mak` simply forwards to build.d. This is a workaround for https://issues.dlang.org/show_bug.cgi?id=20999 which seems to be caused by some local library based on these observations: - the failure is restricted to the macair host, no failures on D-Autotester.local - the failure happens upon the second invocation of build.d - removing `--called-from-make` makes the errror disappear. This switch enables a lockfile (`generated/build.lock`) which ensures that mutliple instances of build.d are run mutually exclusive (this was required during the `make` -> build.d transition but is obsolete now) --- posix.mak | 5 +++++ src/posix.mak | 8 ++++++-- 2 files changed, 11 insertions(+), 2 deletions(-) diff --git a/posix.mak b/posix.mak index d8deb9a8eb..1491587988 100644 --- a/posix.mak +++ b/posix.mak @@ -76,3 +76,8 @@ style: $(QUIET)$(MAKE) -C src -f posix.mak style .DELETE_ON_ERROR: # GNU Make directive (delete output files on error) + +# Dont run targets in parallel because this makefile is just a thin wrapper +# for build.d and multiple invocations might stomp on each other. +# (build.d employs it's own parallelization) +.NOTPARALLEL: diff --git a/src/posix.mak b/src/posix.mak index f51c8145a2..96495b8354 100644 --- a/src/posix.mak +++ b/src/posix.mak @@ -92,8 +92,7 @@ ifeq (,$(HOST_DMD_PATH)) endif HOST_DMD_RUN:=$(HOST_DMD) -RUN_BUILD = $(GENERATED)/build HOST_DMD="$(HOST_DMD)" CXX="$(HOST_CXX)" OS=$(OS) BUILD=$(BUILD) MODEL=$(MODEL) AUTO_BOOTSTRAP="$(AUTO_BOOTSTRAP)" DOCDIR="$(DOCDIR)" STDDOC="$(STDDOC)" DOC_OUTPUT_DIR="$(DOC_OUTPUT_DIR)" MAKE="$(MAKE)" --called-from-make - +RUN_BUILD = $(GENERATED)/build HOST_DMD="$(HOST_DMD)" CXX="$(HOST_CXX)" OS=$(OS) BUILD=$(BUILD) MODEL=$(MODEL) AUTO_BOOTSTRAP="$(AUTO_BOOTSTRAP)" DOCDIR="$(DOCDIR)" STDDOC="$(STDDOC)" DOC_OUTPUT_DIR="$(DOC_OUTPUT_DIR)" MAKE="$(MAKE)" ######## Begin build targets all: dmd @@ -200,4 +199,9 @@ endif .DELETE_ON_ERROR: # GNU Make directive (delete output files on error) +# Dont run targets in parallel because this makefile is just a thin wrapper +# for build.d and multiple invocations might stomp on each other. +# (build.d employs it's own parallelization) +.NOTPARALLEL: + endif