testcases.mk: Fix libs/ path for out-of-tree build
PATCH 1/2 testcases.mk: Fix libs/ path for out-of-tree build
The path to the Makefile was not correct for the out-of-tree build because it was pointing to the build directory rather than to the source directory.
Apparently this also caused random failures for out-of-tree build. For some reason when building syscalls/set_mempolicy/ testcases the rebuild of the libltpnuma.a library is triggered for out-of-tree build for about 10% of the cases on massively parallel build. Which as far as I can tell shouldn't happen since we build everything in the libs/ directory as a prerequisite of the testcases/ directory. So there is likely some strange race condition happening and while this does not fix the actual race it makes it quite harmless since the target was already build and the make in the libs/libltpnuma/ directory will be no-op.
--- include/mk/testcases.mk | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
include/mk/testcases.mk +1 -1
@@ -49,7 +49,7 @@ LTPLIBS_FILES = $(addsuffix .a, $(addprefix $(abs_top_builddir)/libs/, $(foreach MAKE_DEPS += $(LTPLIBS_FILES) $(LTPLIBS_FILES): $(LTPLIBS_DIRS) - $(MAKE) -C "$^" -f "$^/Makefile" all + $(MAKE) -C "$^" -f "$(subst $(abs_top_builddir),$(abs_top_srcdir),$^)/Makefile" all LDFLAGS += $(addprefix -L$(top_builddir)/libs/lib, $(LTPLIBS))
Signature · 1 line
2.19.2
PATCH 1/2 testcases.mk: Fix libs/ path for out-of-tree build
Hi!
Both pushed, thanks.
Signature · 2 lines
Cyril Hrubis [email protected]
PATCH 1/2 testcases.mk: Fix libs/ path for out-of-tree build
Quoted 5 lines · Cyril Hrubis
Hi!
Both pushed, thanks.
Thank you for fixing this Cyril!
Take care,
-Enji
PATCH 1/2 testcases.mk: Fix libs/ path for out-of-tree build
In reply to Cyril Hrubis----- Original Message -----
Quoted 14 lines
The path to the
Makefilewas not correct for the out-of-tree build because it was pointing to the build directory rather than to the source directory.Apparently this also caused random failures for out-of-tree build. For some reason when building syscalls/set_mempolicy/ testcases the rebuild of the libltpnuma.a library is triggered for out-of-tree build for about 10% of the cases on massively parallel build. Which as far as I can tell shouldn't happen since we build everything in the libs/ directory as a prerequisite of the testcases/ directory. So there is likely some strange race condition happening and while this does not fix the actual race it makes it quite harmless since the target was already build and the make in the libs/libltpnuma/ directory will be no-op.
Quoted 3 lines
Signed-off-by Cyril Hrubis <[email protected]>CC Petr Vorel <[email protected]>CC Jan Stancek <[email protected]>
Quoted 23 lines
--- include/mk/testcases.mk | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)include/mk/testcases.mk +0
-0@@ -49,7 +49,7 @@ LTPLIBS_FILES = $(addsuffix .a, $(addprefix$(abs_top_builddir)/libs/, $(foreach
MAKE_DEPS+= $(LTPLIBS_FILES)$(LTPLIBS_FILES): $(LTPLIBS_DIRS)
include/mk/testcases.mk +1
-1- $(MAKE) -C "$^" -f "$^/Makefile" all + $(MAKE) -C "$^" -f "$(subst$(abs_top_builddir),$(abs_top_srcdir),$^)/Makefile" all
LDFLAGS += $(addprefix -L$(top_builddir)/libs/lib, $(LTPLIBS))
--
2.19.2
PATCH 1/2 testcases.mk: Fix libs/ path for out-of-tree build
In reply to Cyril HrubisHi,
Quoted 14 lines
The path to the
Makefilewas not correct for the out-of-tree build because it was pointing to the build directory rather than to the source directory.Apparently this also caused random failures for out-of-tree build. For some reason when building syscalls/set_mempolicy/ testcases the rebuild of the libltpnuma.a library is triggered for out-of-tree build for about 10% of the cases on massively parallel build. Which as far as I can tell shouldn't happen since we build everything in the libs/ directory as a prerequisite of the testcases/ directory. So there is likely some strange race condition happening and while this does not fix the actual race it makes it quite harmless since the target was already build and the make in the libs/libltpnuma/ directory will be no-op.
Quoted 4 lines
Signed-off-by Cyril Hrubis <[email protected]>CC Petr Vorel <[email protected]>CC Jan Stancek <[email protected]>---
On 32 core machine, running for several hours (now 66 builds without failure).
Kind regards,
Petr
Quoted 15 lines
include/mk/testcases.mk | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)include/mk/testcases.mk +1
-1@@ -49,7 +49,7 @@ LTPLIBS_FILES = $(addsuffix .a, $(addprefix $(abs_top_builddir)/libs/, $(foreach MAKE_DEPS += $(LTPLIBS_FILES) $(LTPLIBS_FILES): $(LTPLIBS_DIRS) - $(MAKE) -C "$^" -f "$^/Makefile" all + $(MAKE) -C "$^" -f "$(subst $(abs_top_builddir),$(abs_top_srcdir),$^)/Makefile" all LDFLAGS += $(addprefix -L$(top_builddir)/libs/lib, $(LTPLIBS))
PATCH 2/2 Makefile: Fix target redefinition
In reply to Cyril HrubisThere is no need to add a rule for the libs directory because there is a generic rule for directory creation already. All we need to do is to make the libs-all target depend on the directory path, which we do already so that the directory is created before we attempt to execute make there.
--- Makefile | 3 --- 1 file changed, 3 deletions(-)
Makefile +0 -3
@@ -102,9 +102,6 @@ $(sort $(addprefix $(abs_top_builddir)/,$(BOOTSTRAP_TARGETS)) $(INSTALL_DIR) $(D ## Pattern based subtarget rules. lib-install: lib-all -$(abs_top_builddir)/libs: - mkdir -m 00755 -p "$@" - libs-all: $(abs_top_builddir)/libs $(MAKE_TARGETS) include-all lib-all libs-all:
Signature · 1 line
2.19.2
PATCH 2/2 Makefile: Fix target redefinition
Hi,
Quoted 6 lines
There is no need to add a rule for the libs directory because there is a generic rule for directory creation already. All we need to do is to make the libs-all target depend on the directory path, which we do already so that the directory is created before we attempt to execute make there.
Quoted 6 lines
Fixes 17a5b0fb63bf65eff433bdee3bf5f73826a50e0fSigned-off-by Cyril Hrubis <[email protected]>CC Petr Vorel <[email protected]>CC Jan Stancek <[email protected]>---
The same as previous patch (testing both together).
Kind regards,
Petr
Quoted 17 lines
Makefile | 3 --- 1 file changed, 3 deletions(-)Makefile +0
-3@@ -102,9 +102,6 @@ $(sort $(addprefix $(abs_top_builddir)/,$(BOOTSTRAP_TARGETS)) $(INSTALL_DIR) $(D ## Pattern based subtarget rules. lib-install: lib-all -$(abs_top_builddir)/libs: - mkdir -m 00755 -p "$@" - libs-all: $(abs_top_builddir)/libs $(MAKE_TARGETS) include-all lib-all libs-all: