* [LTP] [PATCH] libs: fix sporadic out-of-tree build failures related to libs
@ 2019-03-20 10:07 Jan Stancek
2019-03-20 16:25 ` Cyril Hrubis
0 siblings, 1 reply; 4+ messages in thread
From: Jan Stancek @ 2019-03-20 10:07 UTC (permalink / raw)
To: ltp
Petr reported that out-of-tree builds are sporadically failing:
make[4]: Entering directory '/usr/src/ltp-build/testcases/kernel/syscalls/set_mempolicy'
make -C "/usr/src/ltp-build/libs/libltpnuma" -f "/usr/src/ltp-build/libs/libltpnuma/Makefile" all
make[5]: Entering directory '/usr/src/ltp-build/libs/libltpnuma'
make[5]: /usr/src/ltp-build/libs/libltpnuma/Makefile: No such file or directory
make[5]: *** No rule to make target '/usr/src/ltp-build/libs/libltpnuma/Makefile'. Stop.
It can be triggered reliably by:
make -C $(pwd)/../ltp-build/testcases/kernel/syscalls/set_mempolicy/ \
-f $(pwd)/testcases/kernel/syscalls/set_mempolicy/Makefile \
top_srcdir=$(pwd) top_builddir=$(pwd)/../ltp-build
This happens when libltpnuma is pulled in as dependency and it's not built yet.
Make rules construct path for Makefile based on abs_top_builddir rather
than abs_top_srcdir:
$(LTPLIBS_FILES): $(LTPLIBS_DIRS)
$(MAKE) -C "$^" -f "$^/Makefile" all
Fix that by making LTPLIBS_DIRS relative, and add top_{build/src}dir
prefix where appropriate. This also moves LTPLIBS_DIRS mkdir target
into 'ifdef LTPLIBS' block.
Reported-by: Petr Vorel <pvorel@suse.cz>
Cc: Cyril Hrubis <chrubis@suse.cz>
Signed-off-by: Jan Stancek <jstancek@redhat.com>
---
include/mk/testcases.mk | 8 +++++---
1 file changed, 5 insertions(+), 3 deletions(-)
diff --git a/include/mk/testcases.mk b/include/mk/testcases.mk
index 131854ec7346..4cbb37640687 100644
--- a/include/mk/testcases.mk
+++ b/include/mk/testcases.mk
@@ -43,17 +43,19 @@ LDLIBS += -lltp
ifdef LTPLIBS
-LTPLIBS_DIRS = $(addprefix $(abs_top_builddir)/libs/lib, $(LTPLIBS))
+LTPLIBS_DIRS = $(addprefix libs/lib, $(LTPLIBS))
LTPLIBS_FILES = $(addsuffix .a, $(addprefix $(abs_top_builddir)/libs/, $(foreach LIB,$(LTPLIBS),lib$(LIB)/lib$(LIB))))
MAKE_DEPS += $(LTPLIBS_FILES)
$(LTPLIBS_FILES): $(LTPLIBS_DIRS)
- $(MAKE) -C "$^" -f "$^/Makefile" all
+ $(MAKE) -C "$(abs_top_builddir)/$^" -f "$(abs_top_srcdir)/$^/Makefile" all
LDFLAGS += $(addprefix -L$(top_builddir)/libs/lib, $(LTPLIBS))
+$(LTPLIBS_DIRS): %:
+ mkdir -p "$(abs_top_builddir)/$@"
endif
-$(LTPLIBS_DIRS) $(APICMDS_DIR) $(LIBLTP_DIR): %:
+$(APICMDS_DIR) $(LIBLTP_DIR): %:
mkdir -p "$@"
--
1.8.3.1
^ permalink raw reply related [flat|nested] 4+ messages in thread
* [LTP] [PATCH] libs: fix sporadic out-of-tree build failures related to libs
2019-03-20 10:07 [LTP] [PATCH] libs: fix sporadic out-of-tree build failures related to libs Jan Stancek
@ 2019-03-20 16:25 ` Cyril Hrubis
2019-03-20 19:55 ` Enji Cooper
0 siblings, 1 reply; 4+ messages in thread
From: Cyril Hrubis @ 2019-03-20 16:25 UTC (permalink / raw)
To: ltp
Hi!
> Reported-by: Petr Vorel <pvorel@suse.cz>
> Cc: Cyril Hrubis <chrubis@suse.cz>
> Signed-off-by: Jan Stancek <jstancek@redhat.com>
> ---
> include/mk/testcases.mk | 8 +++++---
> 1 file changed, 5 insertions(+), 3 deletions(-)
>
> diff --git a/include/mk/testcases.mk b/include/mk/testcases.mk
> index 131854ec7346..4cbb37640687 100644
> --- a/include/mk/testcases.mk
> +++ b/include/mk/testcases.mk
> @@ -43,17 +43,19 @@ LDLIBS += -lltp
>
> ifdef LTPLIBS
>
> -LTPLIBS_DIRS = $(addprefix $(abs_top_builddir)/libs/lib, $(LTPLIBS))
> +LTPLIBS_DIRS = $(addprefix libs/lib, $(LTPLIBS))
> LTPLIBS_FILES = $(addsuffix .a, $(addprefix $(abs_top_builddir)/libs/, $(foreach LIB,$(LTPLIBS),lib$(LIB)/lib$(LIB))))
>
> MAKE_DEPS += $(LTPLIBS_FILES)
>
> $(LTPLIBS_FILES): $(LTPLIBS_DIRS)
> - $(MAKE) -C "$^" -f "$^/Makefile" all
> + $(MAKE) -C "$(abs_top_builddir)/$^" -f "$(abs_top_srcdir)/$^/Makefile" all
>
> LDFLAGS += $(addprefix -L$(top_builddir)/libs/lib, $(LTPLIBS))
>
> +$(LTPLIBS_DIRS): %:
> + mkdir -p "$(abs_top_builddir)/$@"
The problem here is that unless the paths in LTPLIBS_DIRS match existing
files the mkdir -p is executed every time LTPLIBS is defined in
Makefile. I guess that we can put the absolute paths back to the
LTPLIBS_DIRS variable and use $(subst ..) to replace the builddir with
srcdir but I wonder if there is a better solution.
--
Cyril Hrubis
chrubis@suse.cz
^ permalink raw reply [flat|nested] 4+ messages in thread
* [LTP] [PATCH] libs: fix sporadic out-of-tree build failures related to libs
2019-03-20 16:25 ` Cyril Hrubis
@ 2019-03-20 19:55 ` Enji Cooper
2019-03-26 13:02 ` Petr Vorel
0 siblings, 1 reply; 4+ messages in thread
From: Enji Cooper @ 2019-03-20 19:55 UTC (permalink / raw)
To: ltp
> On Mar 20, 2019, at 09:25, Cyril Hrubis <chrubis@suse.cz> wrote:
>
> Hi!
>> Reported-by: Petr Vorel <pvorel@suse.cz>
>> Cc: Cyril Hrubis <chrubis@suse.cz>
>> Signed-off-by: Jan Stancek <jstancek@redhat.com>
>> ---
>> include/mk/testcases.mk | 8 +++++---
>> 1 file changed, 5 insertions(+), 3 deletions(-)
>>
>> diff --git a/include/mk/testcases.mk b/include/mk/testcases.mk
>> index 131854ec7346..4cbb37640687 100644
>> --- a/include/mk/testcases.mk
>> +++ b/include/mk/testcases.mk
>> @@ -43,17 +43,19 @@ LDLIBS += -lltp
>>
>> ifdef LTPLIBS
>>
>> -LTPLIBS_DIRS = $(addprefix $(abs_top_builddir)/libs/lib, $(LTPLIBS))
>> +LTPLIBS_DIRS = $(addprefix libs/lib, $(LTPLIBS))
>> LTPLIBS_FILES = $(addsuffix .a, $(addprefix $(abs_top_builddir)/libs/, $(foreach LIB,$(LTPLIBS),lib$(LIB)/lib$(LIB))))
>>
>> MAKE_DEPS += $(LTPLIBS_FILES)
>>
>> $(LTPLIBS_FILES): $(LTPLIBS_DIRS)
>> - $(MAKE) -C "$^" -f "$^/Makefile" all
>> + $(MAKE) -C "$(abs_top_builddir)/$^" -f "$(abs_top_srcdir)/$^/Makefile" all
>>
>> LDFLAGS += $(addprefix -L$(top_builddir)/libs/lib, $(LTPLIBS))
>>
>> +$(LTPLIBS_DIRS): %:
>> + mkdir -p "$(abs_top_builddir)/$@"
>
> The problem here is that unless the paths in LTPLIBS_DIRS match existing
> files the mkdir -p is executed every time LTPLIBS is defined in
> Makefile. I guess that we can put the absolute paths back to the
> LTPLIBS_DIRS variable and use $(subst ..) to replace the builddir with
> srcdir but I wonder if there is a better solution.
I don’t think this isn’t the right way. Memory serves me correctly (it’s been almost a decade), the glue code in …/Makefile is incorrect. This is where the directory needs to be created.
Let me try implementing a fix.
Cheers,
-Enji
^ permalink raw reply [flat|nested] 4+ messages in thread
* [LTP] [PATCH] libs: fix sporadic out-of-tree build failures related to libs
2019-03-20 19:55 ` Enji Cooper
@ 2019-03-26 13:02 ` Petr Vorel
0 siblings, 0 replies; 4+ messages in thread
From: Petr Vorel @ 2019-03-26 13:02 UTC (permalink / raw)
To: ltp
Hi Enji,
> > The problem here is that unless the paths in LTPLIBS_DIRS match existing
> > files the mkdir -p is executed every time LTPLIBS is defined in
> > Makefile. I guess that we can put the absolute paths back to the
> > LTPLIBS_DIRS variable and use $(subst ..) to replace the builddir with
> > srcdir but I wonder if there is a better solution.
> I don’t think this isn’t the right way. Memory serves me correctly (it’s been almost a decade), the glue code in …/Makefile is incorrect. This is where the directory needs to be created.
> Let me try implementing a fix.
Any progress on this, please?
> Cheers,
> -Enji
Kind regards,
Petr
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2019-03-26 13:02 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-03-20 10:07 [LTP] [PATCH] libs: fix sporadic out-of-tree build failures related to libs Jan Stancek
2019-03-20 16:25 ` Cyril Hrubis
2019-03-20 19:55 ` Enji Cooper
2019-03-26 13:02 ` Petr Vorel
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.