diff mbox

[OpenWrt-Devel] image.mk: Add NOTPARALLEL flag to fix parallel build breakage

Message ID 1445862409-9132-1-git-send-email-ynezz@true.cz
State Rejected
Headers show

Commit Message

Petr Štetiar Oct. 26, 2015, 12:26 p.m. UTC
Fixes following error:

	$ make -j8 V=s

	...snip...

	ar: .: file changed as we read it
	make[5]: *** [mkfs-targz] Error 1
	make[5]: *** Waiting for unfinished jobs....

	...snip...

	Build failed - please re-run with -j1 to see the real error message
	make: *** [world] Error 1

Signed-off-by: Petr Štetiar <ynezz@true.cz>
---
 include/image.mk |    2 ++
 1 file changed, 2 insertions(+)

Comments

Felix Fietkau Oct. 30, 2015, 3:14 p.m. UTC | #1
On 2015-10-26 13:26, Petr Štetiar wrote:
> Fixes following error:
> 
> 	$ make -j8 V=s
> 
> 	...snip...
> 
> 	ar: .: file changed as we read it
> 	make[5]: *** [mkfs-targz] Error 1
> 	make[5]: *** Waiting for unfinished jobs....
> 
> 	...snip...
> 
> 	Build failed - please re-run with -j1 to see the real error message
> 	make: *** [world] Error 1
> 
> Signed-off-by: Petr Štetiar <ynezz@true.cz>
The new image building code is designed to allow building in parallel,
so this patch is just a workaround, not a real fix.

I'd like to find out where the real bug is - what target are you
building where you hit this error?

- Felix
Petr Štetiar Oct. 30, 2015, 9:20 p.m. UTC | #2
Felix Fietkau <nbd@openwrt.org> [2015-10-30 16:14:49]:

Hi,

> I'd like to find out where the real bug is - what target are you
> building where you hit this error?

it's imx6 target, but probably kirkwood, lantiq, mxs and oxnas are affected
also (just by guessing by output from 'git grep Image/InstallKernel/Template').

I think, that the problem is lying in include/image.mk:

556   kernel_prepare: mkfs_prepare
557         $(call Image/BuildKernel)
558         $(if $(CONFIG_TARGET_ROOTFS_INITRAMFS),$(if $(IB),,$(call Image/BuildKernel/Initramfs)))
559         $(call Image/InstallKernel)
560 
561   $(foreach device,$(TARGET_DEVICES),$(call Device,$(device)))
562   $(foreach fs,$(TARGET_FILESYSTEMS) $(fs-subtypes-y),$(call BuildImage/mkfs,$(fs)))

where probably Image/InstallKernel is run in parallel with BuildImage/mkfs and
Image/InstallKernel then touches $(TARGET_DIR)/boot which Image/mkfs/targz is
compressing in another job.

-- ynezz
diff mbox

Patch

diff --git a/include/image.mk b/include/image.mk
index c59222e..2554171 100644
--- a/include/image.mk
+++ b/include/image.mk
@@ -558,6 +558,8 @@  define BuildImage
 	$(if $(CONFIG_TARGET_ROOTFS_INITRAMFS),$(if $(IB),,$(call Image/BuildKernel/Initramfs)))
 	$(call Image/InstallKernel)
 
+  .NOTPARALLEL :
+
   $(foreach device,$(TARGET_DEVICES),$(call Device,$(device)))
   $(foreach fs,$(TARGET_FILESYSTEMS) $(fs-subtypes-y),$(call BuildImage/mkfs,$(fs)))