Skip to contentSkip to conversation

package/canfestival: don't build in parallel

PATCH New Yann E. MORIN 2 participants 5 messages Aug 22, 2015 – Aug 25, 2015

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 package/canfestival: don't build in parallel

The Makefiles for canfestival are not correctly written, which leads to multiple warnings such as:

make[4]: warning: jobserver unavailable: using -j1. Add `+' to parent make rule.

Since canfestival is relatively small, it builds in less than 6s here when not in parallell, while a parallel build takes 5s.

Just disable parallel build to avoid future surprises.

---
 package/canfestival/canfestival.mk | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)
package/canfestival/canfestival.mk +3 -3
index e929c5e..61578d3 100644
@@ -36,13 +36,13 @@ define CANFESTIVAL_CONFIGURE_CMDS
 endef
 
 define CANFESTIVAL_BUILD_CMDS
-	$(TARGET_MAKE_ENV) $(MAKE) -C $(@D) all \
+	$(TARGET_MAKE_ENV) $(MAKE1) -C $(@D) all \
 		PYTHON=$(HOST_DIR)/usr/bin/python2
 endef
 
 define CANFESTIVAL_INSTALL_TARGET_CMDS
 	for d in $(CANFESTIVAL_INSTALLED-y) ; do \
-		$(TARGET_MAKE_ENV) $(MAKE) -C $(@D)/$$d install \
+		$(TARGET_MAKE_ENV) $(MAKE1) -C $(@D)/$$d install \
 			PYTHON=$(HOST_DIR)/usr/bin/python2 \
 			DESTDIR=$(TARGET_DIR) || exit 1 ; \
 	done
@@ -50,7 +50,7 @@ endef
 
 define CANFESTIVAL_INSTALL_STAGING_CMDS
 	for d in $(CANFESTIVAL_INSTALLED-y) ; do \
-		$(TARGET_MAKE_ENV) $(MAKE) -C $(@D)/$$d install \
+		$(TARGET_MAKE_ENV) $(MAKE1) -C $(@D)/$$d install \
 			PYTHON=$(HOST_DIR)/usr/bin/python2 \
 			DESTDIR=$(STAGING_DIR) || exit 1 ; \
 	done
Signature · 1 line
1.9.1
#1 lore raw

PATCH 1/1 package/canfestival: don't build in parallel

Yann,

Quoted 11 lines · Yann E. MORIN

The Makefiles for canfestival are not correctly written, which leads to multiple warnings such as:

make[4]: warning: jobserver unavailable: using -j1. Add `+' to parent make rule.

Since canfestival is relatively small, it builds in less than 6s here when not in parallell, while a parallel build takes 5s.

Just disable parallel build to avoid future surprises.

Do you actually understand why make is displaying those warning messages in the first place? From what I understood from the make manual, it typically happens when you call "make" directly for a subdirectory instead of using $(MAKE). A quick test on a simple example seems to confirm that.

However, I see that canfestival seems to be using $(MAKE) everywhere, so I don't see why make decides that the jobserver is not available.

Thanks,

Thomas

Signature · 3 lines
Thomas Petazzoni, CTO, Free Electrons
Embedded Linux, Kernel and Android engineering
http://free-electrons.com
#2 lore raw

PATCH 1/1 package/canfestival: don't build in parallel

Thomas, All,

On 2015-08-25 12:17 +0200, Thomas Petazzoni spake thusly:

Quoted 9 lines · Yann E. MORIN
Quoted 8 lines

The Makefiles for canfestival are not correctly written, which leads to multiple warnings such as:

make[4]: warning: jobserver unavailable: using -j1. Add `+' to parent make rule.

Since canfestival is relatively small, it builds in less than 6s here when not in parallell, while a parallel build takes 5s.

Quoted 6 lines
Quoted 3 lines

Just disable parallel build to avoid future surprises.

Do you actually understand why make is displaying those warning messages in the first place?

Yes, and it's a bit tricky.

canfestival indeed uses $(MAKE) everywhere. However, it is using it in a variable, like so:

    define build_cmds
        $(MAKE) foo
        $(MAKE) bar
    endef

    all:
        $(build_cmds)

Since $(MAKE) is not directly in the rule body, it looses its magic behaviour. This is explicited said so in the make manual:

This special feature is only enabled if the MAKE variable appears directly in the recipe: it does not apply if the MAKE variable is referenced through expansion of another variable.

Ergo.

Regards,
Yann E. MORIN.

Signature · 6 lines
.-----------------.--------------------.------------------.--------------------.
|  Yann E. MORIN  | Real-Time Embedded | /"\ ASCII RIBBON | Erics' conspiracy: |
| +33 662 376 056 | Software  Designer | \ / CAMPAIGN     |  ___               |
| +33 223 225 172 `------------.-------:  X  AGAINST      |  \e/  There is no  |
| http://ymorin.is-a-geek.org/ | _/*\_ | / \ HTML MAIL    |   v   conspiracy.  |
'------------------------------^-------^------------------^--------------------'
#3 lore raw

PATCH 1/1 package/canfestival: don't build in parallel

Yann,

Quoted 16 lines · Yann E. MORIN
Quoted 2 lines

Do you actually understand why make is displaying those warning messages in the first place?

Yes, and it's a bit tricky.

canfestival indeed uses $(MAKE) everywhere. However, it is using it in a variable, like so:

    define build_cmds
        $(MAKE) foo
        $(MAKE) bar
    endef

    all:
        $(build_cmds)
Quoted 8 lines

Since $(MAKE) is not directly in the rule body, it looses its magic behaviour. This is explicited said so in the make manual:

This special feature is only enabled if the MAKE variable appears directly in the recipe: it does not apply if the MAKE variable is referenced through expansion of another variable.

Ergo.

I have to say I really like working on Buildroot with smart people, because I learn things every day. Thanks for pointing me to this part of the documentation I overlooked! I will apply your patch.

Thanks,

Thomas

Signature · 3 lines
Thomas Petazzoni, CTO, Free Electrons
Embedded Linux, Kernel and Android engineering
http://free-electrons.com
#4 lore raw

PATCH 1/1 package/canfestival: don't build in parallel

In reply to Yann E. MORIN

Dear Yann E. MORIN,

Quoted 8 lines · Yann E. MORIN

The Makefiles for canfestival are not correctly written, which leads to multiple warnings such as:

make[4]: warning: jobserver unavailable: using -j1. Add `+' to parent make rule.

Since canfestival is relatively small, it builds in less than 6s here when not in parallell, while a parallel build takes 5s.

Quoted 6 lines

Just disable parallel build to avoid future surprises.

---
 package/canfestival/canfestival.mk | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

Applied, thanks.

Thomas

Signature · 3 lines
Thomas Petazzoni, CTO, Free Electrons
Embedded Linux, Kernel and Android engineering
http://free-electrons.com