diff mbox

[LEDE-DEV] build: add V=e option for extended build info

Message ID 20170616185817.18119-1-msm-oss@mcclintock.net
State Changes Requested
Headers show

Commit Message

Matthew McClintock June 16, 2017, 6:58 p.m. UTC
This will output when a job starts and stops:

$ make -j24 V=e
[ snip ]
 make[3] -C package/network/config/firewall compile
 make -r -C package/network/config/firewall BUILD_SUBDIR=package/network/config/firewall BUILD_VARIANT= compile finished

It's quite useful for debugging parallel builds to see what actually
failed without having to re-run -j1 V=s when the issue may not occur at
all.

Signed-off-by: Matthew McClintock <msm-oss@mcclintock.net>
---
 include/verbose.mk | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

Comments

Felix Fietkau June 17, 2017, 12:35 p.m. UTC | #1
On 2017-06-16 20:58, Matthew McClintock wrote:
> This will output when a job starts and stops:
> 
> $ make -j24 V=e
> [ snip ]
>  make[3] -C package/network/config/firewall compile
>  make -r -C package/network/config/firewall BUILD_SUBDIR=package/network/config/firewall BUILD_VARIANT= compile finished
> 
> It's quite useful for debugging parallel builds to see what actually
> failed without having to re-run -j1 V=s when the issue may not occur at
> all.
> 
> Signed-off-by: Matthew McClintock <msm-oss@mcclintock.net>
I think this is a good idea. Could you please make the following changes
to it:

- clean up the "make ... finished" part to look like the earlier msg
that indicated the start of the build. Preferably both should indicate
which build variant is being used (where present).

- print the "make ... failed" message by default

Thanks,

- Felix
Matthew McClintock June 18, 2017, 7:06 p.m. UTC | #2
On Sat, Jun 17, 2017 at 7:35 AM, Felix Fietkau <nbd@nbd.name> wrote:
> On 2017-06-16 20:58, Matthew McClintock wrote:
>> This will output when a job starts and stops:
>>
>> $ make -j24 V=e
>> [ snip ]
>>  make[3] -C package/network/config/firewall compile
>>  make -r -C package/network/config/firewall BUILD_SUBDIR=package/network/config/firewall BUILD_VARIANT= compile finished
>>
>> It's quite useful for debugging parallel builds to see what actually
>> failed without having to re-run -j1 V=s when the issue may not occur at
>> all.
>>
>> Signed-off-by: Matthew McClintock <msm-oss@mcclintock.net>
> I think this is a good idea. Could you please make the following changes
> to it:
>
> - clean up the "make ... finished" part to look like the earlier msg
> that indicated the start of the build. Preferably both should indicate
> which build variant is being used (where present).
>
> - print the "make ... failed" message by default

How about this? Print a started, and always print the finished message.

 make -r -C package/network/config/firewall
BUILD_SUBDIR=package/network/config/firewall BUILD_VARIANT= compile
started
 make[3] -C package/network/config/firewall compile
 make -r -C package/network/config/firewall
BUILD_SUBDIR=package/network/config/firewall BUILD_VARIANT= compile
finished

SUBMAKE:=cmd() { printf "$(_Y) make $$* started$(_N)\n" >&8; $(MAKE)
$$* || { printf "$(_Y) make $$* failed$(_N)\n" >&8; false; }; printf
"$(_Y) make $$* finished$(_N)\n" >&8; }; cmd

Getting a bit ugly ;)

-M
Felix Fietkau June 19, 2017, 6:30 p.m. UTC | #3
On 2017-06-18 21:06, Matthew McClintock wrote:
> On Sat, Jun 17, 2017 at 7:35 AM, Felix Fietkau <nbd@nbd.name> wrote:
>> On 2017-06-16 20:58, Matthew McClintock wrote:
>>> This will output when a job starts and stops:
>>>
>>> $ make -j24 V=e
>>> [ snip ]
>>>  make[3] -C package/network/config/firewall compile
>>>  make -r -C package/network/config/firewall BUILD_SUBDIR=package/network/config/firewall BUILD_VARIANT= compile finished
>>>
>>> It's quite useful for debugging parallel builds to see what actually
>>> failed without having to re-run -j1 V=s when the issue may not occur at
>>> all.
>>>
>>> Signed-off-by: Matthew McClintock <msm-oss@mcclintock.net>
>> I think this is a good idea. Could you please make the following changes
>> to it:
>>
>> - clean up the "make ... finished" part to look like the earlier msg
>> that indicated the start of the build. Preferably both should indicate
>> which build variant is being used (where present).
>>
>> - print the "make ... failed" message by default
> 
> How about this? Print a started, and always print the finished message.
> 
>  make -r -C package/network/config/firewall
> BUILD_SUBDIR=package/network/config/firewall BUILD_VARIANT= compile
> started
>  make[3] -C package/network/config/firewall compile
>  make -r -C package/network/config/firewall
> BUILD_SUBDIR=package/network/config/firewall BUILD_VARIANT= compile
> finished
> 
> SUBMAKE:=cmd() { printf "$(_Y) make $$* started$(_N)\n" >&8; $(MAKE)
> $$* || { printf "$(_Y) make $$* failed$(_N)\n" >&8; false; }; printf
> "$(_Y) make $$* finished$(_N)\n" >&8; }; cmd
Looks a bit ugly. I'd prefer a filtered version that shows the essential
parts in a more concise way.

- Felix
diff mbox

Patch

diff --git a/include/verbose.mk b/include/verbose.mk
index b7e43f7430..fe5c425181 100644
--- a/include/verbose.mk
+++ b/include/verbose.mk
@@ -50,7 +50,11 @@  ifeq ($(findstring s,$(OPENWRT_VERBOSE)),)
     _NULL:=$(if $(MAKECMDGOALS),$(shell \
 		$(call MESSAGE, make[$(MAKELEVEL)]$(if $(_DIR), -C $(_DIR)) $(MAKECMDGOALS)); \
     ))
-    SUBMAKE=$(MAKE)
+    ifeq ($(findstring e,$(OPENWRT_VERBOSE)),)
+      SUBMAKE=$(MAKE)
+    else
+      SUBMAKE:=cmd() { $(MAKE) $$* && printf "$(_Y) make $$* finished$(_N)\n" >&8 || { printf "$(_Y) make $$* failed$(_N)\n" >&8; false; } }; cmd
+    endif
   else
     SILENT:=>/dev/null $(if $(findstring w,$(OPENWRT_VERBOSE)),,2>&1)
     export QUIET:=1