Skip to contentSkip to conversation

tools/vtpm: fix version.h error during parallel build

PATCH In review Olaf Hering 2 participants 5 messages Jul 12, 2012 – Jul 31, 2012

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 tools/vtpm: fix version.h error during parallel build

# HG changeset patch
# User Olaf Hering <[email protected]>
# Date 1342105705 -7200
# Node ID 51506c407f3ef3e238a4154c7f72ac61093e0bce # Parent 42f76d536b116d2ebad1b6705ae51ecd171d2581 tools/vtpm: fix version.h error during parallel build

Generating the tpm_version.h is not make -j safe:

In file included from ../tpm/tpm_emulator.h:25:0,

                 from ../tpm/tpm_startup.c:18:

../tpm/tpm_version.h:1:0: error: unterminated #ifndef make[5]: *** [tpm_startup.o] Error 1

Add another patch which adds proper dependencies in the tpm_manager Makefile. (all-recursive needs to depend on version)

tools/vtpm/Makefile +2 -1
diff -r 42f76d536b11 -r 51506c407f3e tools/vtpm/Makefile
@@ -51,7 +51,8 @@ mrproper:
 
 	set -e; cd $(VTPM_DIR); \
 	patch -p1 < ../vtpm-0.5.1.patch; \
-	patch -p1 < ../vtpm-0.5.1-LDLIBS.patch
+	patch -p1 < ../vtpm-0.5.1-LDLIBS.patch; \
+	patch -p1 < ../vtpm-0.5.1-version.h.patch
 
 orig: $(TPM_EMULATOR_TARFILE)
 	mkdir $(ORIG_DIR);
tools/vtpm/vtpm-0.5.1-version.h.patch new file +53 -0

53 lines not on this page · raw message

#1 lore raw

Olaf Hering writes ("[Xen-devel] [PATCH] tools/vtpm: fix version.h error during parallel build"):

Quoted 3 lines

tools/vtpm: fix version.h error during parallel build

Generating the tpm_version.h is not make -j safe:

Thanks for tracking this down. However, wouldn't it be possible to fix this entirely in our Makefile, somehow ? The patch to the upstream Makefile risks getting conflicts in the future with changes to the upstream code.

Thanks,
Ian.

#2 lore raw
Quoted 9 lines · Ian Jackson

Olaf Hering writes ("[Xen-devel] [PATCH] tools/vtpm: fix version.h error during parallel build"):

Quoted 3 lines

tools/vtpm: fix version.h error during parallel build

Generating the tpm_version.h is not make -j safe:

Thanks for tracking this down. However, wouldn't it be possible to fix this entirely in our Makefile, somehow ? The patch to the upstream Makefile risks getting conflicts in the future with changes to the upstream code.

The build_sub rule in tools/vtpm/Makefile could be changed to $(MAKE) -C $(VTPM_DIR) version && $(MAKE) -C $(VTPM_DIR) all-recursive; \

And the install rule in that Makefile perhaps to
$(MAKE) -C $(VTPM_DIR) install-recursive

I will see how that works, the failure happens rarely.

Olaf

#3 lore raw

Olaf Hering writes ("Re: [Xen-devel] [PATCH] tools/vtpm: fix version.h error during parallel build"):

Quoted 12 lines · Ian Jackson
Quoted 10 lines

Olaf Hering writes ("[Xen-devel] [PATCH] tools/vtpm: fix version.h error during parallel build"):

Quoted 3 lines

tools/vtpm: fix version.h error during parallel build

Generating the tpm_version.h is not make -j safe:

Thanks for tracking this down. However, wouldn't it be possible to fix this entirely in our Makefile, somehow ? The patch to the upstream Makefile risks getting conflicts in the future with changes to the upstream code.

Quoted 5 lines

The build_sub rule in tools/vtpm/Makefile could be changed to $(MAKE) -C $(VTPM_DIR) version && $(MAKE) -C $(VTPM_DIR) all-recursive; \

And the install rule in that Makefile perhaps to
$(MAKE) -C $(VTPM_DIR) install-recursive

Right, something like that.

Quoted 1 line

I will see how that works, the failure happens rarely.

I find that adding sleeps can help repro these kind of problems.

Ian.

#4 lore raw
Quoted 8 lines · Ian Jackson

Olaf Hering writes ("Re: [Xen-devel] [PATCH] tools/vtpm: fix version.h error during parallel build"):

Quoted 5 lines

The build_sub rule in tools/vtpm/Makefile could be changed to $(MAKE) -C $(VTPM_DIR) version && $(MAKE) -C $(VTPM_DIR) all-recursive; \

And the install rule in that Makefile perhaps to
$(MAKE) -C $(VTPM_DIR) install-recursive

Right, something like that.

I just sent a new patch which does that.

Olaf