diff mbox

[U-Boot,1/2] kbuild: Fix a false error of generic board support

Message ID alpine.DEB.2.02.1412161444400.6205@tthayer-HP-Z620-Ubuntu
State Not Applicable
Delegated to: Masahiro Yamada
Headers show

Commit Message

mgerlach Dec. 16, 2014, 8:56 p.m. UTC
Hello Masahiro Yamada,

Even the with this patch, we encountered a false error of generic board
support.  The problem was very interrmittent for us, but we were able 
to debug the problem to performing builds on EXT3 file systems which
have a time stamp resolution of one second.  To reproduce the problem,
touch ./include/config/auto.conf and .config on a configured uboot tree on
an EXT3 file system.

The patch below fixes the problem for us.  

Thanks,

Matthew Gerlach

---
 Makefile | 8 ++++++--
 1 file changed, 6 insertions(+), 2 deletions(-)

+autoconf_is_current := $(if $(wildcard $(KCONFIG_CONFIG)),\
+		$(if $(shell find . -path ./include/config/auto.conf \
+		\! -newer $(KCONFIG_CONFIG)),,./include/config/auto.conf))
+
 ifneq ($(autoconf_is_current),)
 include $(srctree)/config.mk
 endif

Comments

Tom Rini Dec. 16, 2014, 11:56 p.m. UTC | #1
On Tue, Dec 16, 2014 at 02:56:44PM -0600, mgerlach wrote:

> Hello Masahiro Yamada,
> 
> Even the with this patch, we encountered a false error of generic board
> support.  The problem was very interrmittent for us, but we were able 
> to debug the problem to performing builds on EXT3 file systems which
> have a time stamp resolution of one second.  To reproduce the problem,
> touch ./include/config/auto.conf and .config on a configured uboot tree on
> an EXT3 file system.
> 
> The patch below fixes the problem for us.  

This makes an odd race condition problem I run into when doing massively
paralell builds worse :(  With MAKEALL no ARM boards build (ARCH wasn't
set in time so it tried arch//Makefile for something) and buildman was
also broken in a bunch of places.
Marek Vasut Dec. 17, 2014, 1:04 a.m. UTC | #2
On Wednesday, December 17, 2014 at 12:56:46 AM, Tom Rini wrote:
> On Tue, Dec 16, 2014 at 02:56:44PM -0600, mgerlach wrote:
> > Hello Masahiro Yamada,
> > 
> > Even the with this patch, we encountered a false error of generic board
> > support.  The problem was very interrmittent for us, but we were able
> > to debug the problem to performing builds on EXT3 file systems which
> > have a time stamp resolution of one second.  To reproduce the problem,
> > touch ./include/config/auto.conf and .config on a configured uboot tree
> > on an EXT3 file system.
> > 
> > The patch below fixes the problem for us.
> 
> This makes an odd race condition problem I run into when doing massively
> paralell builds worse :(  With MAKEALL no ARM boards build (ARCH wasn't
> set in time so it tried arch//Makefile for something) and buildman was
> also broken in a bunch of places.

Let me just chime in, I recall I did report something possibly similar some time 
ago [1]. I did not manage to put a finger on this issue though and I can no 
longer trigger it.

[1] http://lists.denx.de/pipermail/u-boot/2013-June/157481.html

Best regards,
Marek Vasut
Tom Rini Dec. 17, 2014, 3:52 p.m. UTC | #3
On Wed, Dec 17, 2014 at 02:04:32AM +0100, Marek Vasut wrote:
> On Wednesday, December 17, 2014 at 12:56:46 AM, Tom Rini wrote:
> > On Tue, Dec 16, 2014 at 02:56:44PM -0600, mgerlach wrote:
> > > Hello Masahiro Yamada,
> > > 
> > > Even the with this patch, we encountered a false error of generic board
> > > support.  The problem was very interrmittent for us, but we were able
> > > to debug the problem to performing builds on EXT3 file systems which
> > > have a time stamp resolution of one second.  To reproduce the problem,
> > > touch ./include/config/auto.conf and .config on a configured uboot tree
> > > on an EXT3 file system.
> > > 
> > > The patch below fixes the problem for us.
> > 
> > This makes an odd race condition problem I run into when doing massively
> > paralell builds worse :(  With MAKEALL no ARM boards build (ARCH wasn't
> > set in time so it tried arch//Makefile for something) and buildman was
> > also broken in a bunch of places.
> 
> Let me just chime in, I recall I did report something possibly similar some time 
> ago [1]. I did not manage to put a finger on this issue though and I can no 
> longer trigger it.
> 
> [1] http://lists.denx.de/pipermail/u-boot/2013-June/157481.html

No, my problem was introduced with the switch to Kbuild itself.
Masahiro Yamada Dec. 18, 2014, 10:42 a.m. UTC | #4
Hi Matthew, Tom,



On Tue, 16 Dec 2014 18:56:46 -0500
Tom Rini <trini@ti.com> wrote:

> On Tue, Dec 16, 2014 at 02:56:44PM -0600, mgerlach wrote:
> 
> > Hello Masahiro Yamada,
> > 
> > Even the with this patch, we encountered a false error of generic board
> > support.  The problem was very interrmittent for us, but we were able 
> > to debug the problem to performing builds on EXT3 file systems which
> > have a time stamp resolution of one second.  To reproduce the problem,
> > touch ./include/config/auto.conf and .config on a configured uboot tree on
> > an EXT3 file system.
> > 
> > The patch below fixes the problem for us.  
> 
> This makes an odd race condition problem I run into when doing massively
> paralell builds worse :(  With MAKEALL no ARM boards build (ARCH wasn't
> set in time so it tried arch//Makefile for something) and buildman was
> also broken in a bunch of places.
> 

Me too.

Although I do not know why, Methew's patch makes it worse.
Without MAKEALL or buildman, I hit the same error every time.


$ LANG=C make -j8 CROSS_COMPILE=arm-linux-gnueabi-  ph1_ld4_defconfig all
  HOSTCC  scripts/basic/fixdep
  HOSTCC  scripts/kconfig/conf.o
  SHIPPED scripts/kconfig/zconf.tab.c
  SHIPPED scripts/kconfig/zconf.lex.c
  SHIPPED scripts/kconfig/zconf.hash.c
  HOSTCC  scripts/kconfig/zconf.tab.o
  HOSTLD  scripts/kconfig/conf
#
# configuration written to .config
#
#
# configuration written to spl/.config
#
./Makefile:511: arch//Makefile: No such file or directory
make[1]: *** No rule to make target `arch//Makefile'.  Stop.
make: *** [__build_one_by_one] Error 2


Best Regards
Masahiro Yamada
Masahiro Yamada Dec. 18, 2014, 10:54 a.m. UTC | #5
Hi Marek, Tom,


On Wed, 17 Dec 2014 10:52:32 -0500
Tom Rini <trini@ti.com> wrote:

> On Wed, Dec 17, 2014 at 02:04:32AM +0100, Marek Vasut wrote:
> > On Wednesday, December 17, 2014 at 12:56:46 AM, Tom Rini wrote:
> > > On Tue, Dec 16, 2014 at 02:56:44PM -0600, mgerlach wrote:
> > > > Hello Masahiro Yamada,
> > > > 
> > > > Even the with this patch, we encountered a false error of generic board
> > > > support.  The problem was very interrmittent for us, but we were able
> > > > to debug the problem to performing builds on EXT3 file systems which
> > > > have a time stamp resolution of one second.  To reproduce the problem,
> > > > touch ./include/config/auto.conf and .config on a configured uboot tree
> > > > on an EXT3 file system.
> > > > 
> > > > The patch below fixes the problem for us.
> > > 
> > > This makes an odd race condition problem I run into when doing massively
> > > paralell builds worse :(  With MAKEALL no ARM boards build (ARCH wasn't
> > > set in time so it tried arch//Makefile for something) and buildman was
> > > also broken in a bunch of places.
> > 
> > Let me just chime in, I recall I did report something possibly similar some time 
> > ago [1]. I did not manage to put a finger on this issue though and I can no 
> > longer trigger it.
> > 
> > [1] http://lists.denx.de/pipermail/u-boot/2013-June/157481.html
> 
> No, my problem was introduced with the switch to Kbuild itself.


Marek's problem is unrelated to this issue.  (2013-June is before Kbuild)


York Sun also reported the similar build error in this thread.
http://thread.gmane.org/gmane.comp.boot-loaders.u-boot/203331/focus=203468

This is really related to what Mathew saw, I think.


Some bug reports imply "autoconf_is_current" is not working on some cases
although I have never been able to reproduce the problem on my box.

I guess it is almost time for further build-system refactoring.


Best Regards
Masahiro Yamada
mgerlach Dec. 19, 2014, 8:32 p.m. UTC | #6
Hi Tom and Masahiro,

Neither my collegue nor I could reproduce the problem you encountered with 
our patch and the build line, "LANG=C make -j8 
CROSS_COMPILE=arm-linux-gnueabi-  ph1_ld4_defconfig all". Any
suggestions on other ways to fix the false error and not break paralell 
builds would be extremely appreciated.

Thanks,

Matthew Gerlach

On Thu, 18 Dec 2014, Masahiro Yamada wrote:

> Hi Matthew, Tom,
> 
> 
> 
> On Tue, 16 Dec 2014 18:56:46 -0500
> Tom Rini <trini@ti.com> wrote:
> 
> > On Tue, Dec 16, 2014 at 02:56:44PM -0600, mgerlach wrote:
> > 
> > > Hello Masahiro Yamada,
> > > 
> > > Even the with this patch, we encountered a false error of generic board
> > > support.  The problem was very interrmittent for us, but we were able 
> > > to debug the problem to performing builds on EXT3 file systems which
> > > have a time stamp resolution of one second.  To reproduce the problem,
> > > touch ./include/config/auto.conf and .config on a configured uboot tree on
> > > an EXT3 file system.
> > > 
> > > The patch below fixes the problem for us.  
> > 
> > This makes an odd race condition problem I run into when doing massively
> > paralell builds worse :(  With MAKEALL no ARM boards build (ARCH wasn't
> > set in time so it tried arch//Makefile for something) and buildman was
> > also broken in a bunch of places.
> > 
> 
> Me too.
> 
> Although I do not know why, Methew's patch makes it worse.
> Without MAKEALL or buildman, I hit the same error every time.
> 
> 
> $ LANG=C make -j8 CROSS_COMPILE=arm-linux-gnueabi-  ph1_ld4_defconfig all
>   HOSTCC  scripts/basic/fixdep
>   HOSTCC  scripts/kconfig/conf.o
>   SHIPPED scripts/kconfig/zconf.tab.c
>   SHIPPED scripts/kconfig/zconf.lex.c
>   SHIPPED scripts/kconfig/zconf.hash.c
>   HOSTCC  scripts/kconfig/zconf.tab.o
>   HOSTLD  scripts/kconfig/conf
> #
> # configuration written to .config
> #
> #
> # configuration written to spl/.config
> #
> ./Makefile:511: arch//Makefile: No such file or directory
> make[1]: *** No rule to make target `arch//Makefile'.  Stop.
> make: *** [__build_one_by_one] Error 2
> 
> 
> Best Regards
> Masahiro Yamada
> 
>
diff mbox

Patch

diff --git a/Makefile b/Makefile
index 99097e1..84de2f9 100644
--- a/Makefile
+++ b/Makefile
@@ -493,8 +493,12 @@  include/config/%.conf: $(KCONFIG_CONFIG) 
include/config/auto.conf.cmd
 # is up-to-date. When we switch to a different board configuration, old 
CONFIG
 # macros are still remaining in include/config/auto.conf. Without the 
following
 # gimmick, wrong config.mk would be included leading nasty 
warnings/errors.
-autoconf_is_current := $(if $(wildcard $(KCONFIG_CONFIG)),$(shell find . 
\
-		-path ./include/config/auto.conf -newer 
$(KCONFIG_CONFIG)))
+# We use if not (not -newer) so that we include config.mk in the event 
that the
+# file timestamps are exacty equal which can happen on EXT3 filesystems.