]> Git Repo - qemu.git/commitdiff
build: Fix dtc-checkout race condition in Makefile
authorAaron Lindsay <[email protected]>
Wed, 18 Oct 2017 18:40:23 +0000 (14:40 -0400)
committerPeter Maydell <[email protected]>
Thu, 19 Oct 2017 15:48:16 +0000 (16:48 +0100)
This was introduced by:
    commit aef45d51d1204f3335fb99de6658e0c5612c2b67
    Author: Daniel P. Berrange <[email protected]>
    Date:   Fri Sep 29 11:11:56 2017 +0100

build: automatically handle GIT submodule checkout for dtc

On my system, I see the following with a fresh clone:

% ./configure --disable-gtk --target-list=aarch64-softmmu
% make -j8
  GEN     aarch64-softmmu/config-devices.mak.tmp
  GEN     config-host.h
mkdir -p dtc/libfdt
  GIT     ui/keycodemapdb dtc
mkdir -p dtc/tests
  GEN     qemu-options.def
[snip]
  GEN     migration/trace.h
make: *** [git-submodule-update] Error 1
make: *** Waiting for unfinished jobs....

Upon closer inspection, the root cause of the error is:

% git submodule update --init ui/keycodemapdb dtc
fatal: destination path 'dtc' already exists and is not an empty directory.
Clone of 'git://git.qemu-project.org/dtc.git' into submodule path 'dtc' failed

This patch fixes this race condition by forcing the 'dtc/%' rule which caused
'dtc' to be non-empty to wait on '.git-submodule-status'.

Signed-off-by: Aaron Lindsay <[email protected]>
Reviewed-by: Daniel P. Berrange <[email protected]>
Acked-by: Philippe Mathieu-Daudé <[email protected]>
Message-id: 1508352023[email protected]
Signed-off-by: Peter Maydell <[email protected]>
Makefile

index 062745f3ba3f98ad4af94323c0e511835c7fa0b9..9372742f86fb7999ed2c59f474c70940e66d2dec 100644 (file)
--- a/Makefile
+++ b/Makefile
@@ -380,7 +380,7 @@ DTC_CPPFLAGS=-I$(BUILD_DIR)/dtc -I$(SRC_PATH)/dtc -I$(SRC_PATH)/dtc/libfdt
 subdir-dtc: .git-submodule-status dtc/libfdt dtc/tests
        $(call quiet-command,$(MAKE) $(DTC_MAKE_ARGS) CPPFLAGS="$(DTC_CPPFLAGS)" CFLAGS="$(DTC_CFLAGS)" LDFLAGS="$(LDFLAGS)" ARFLAGS="$(ARFLAGS)" CC="$(CC)" AR="$(AR)" LD="$(LD)" $(SUBDIR_MAKEFLAGS) libfdt/libfdt.a,)
 
-dtc/%:
+dtc/%: .git-submodule-status
        mkdir -p $@
 
 $(SUBDIR_RULES): libqemuutil.a $(common-obj-y) $(chardev-obj-y) \
This page took 0.033076 seconds and 4 git commands to generate.