All of lore.kernel.org
 help / color / mirror / Atom feed
* [Buildroot] [PATCH v2] package/ninja: enforce Python3 on the host
@ 2019-05-13 21:53 Jörg Krause
  2019-05-14 16:39 ` Thomas Petazzoni
  0 siblings, 1 reply; 2+ messages in thread
From: Jörg Krause @ 2019-05-13 21:53 UTC (permalink / raw)
  To: buildroot

The current logic selects Python3 for the host only if Python3 is
selected for the target, otherwise it selects Python2.

As Meson, the only package infrastructure using ninja, needs Python3, it is
desirable to also depend on Python3 on the host for the ninja host
package.

Otherwise, if no Python interpreter is selected for the target, both
Python2 and Python3 are build for the host, which is time consuming
without any benefit.

For example when building libmpdclient (and all its target and host
dependencies) the actual elapsed time for is reduced from around 286s to 207s
as reported by `time -p make clean all`.

Signed-off-by: J?rg Krause <joerg.krause@embedded.rocks>
---
v2:
 * fix setting the dependency, as <pkg>_NEEDS_HOST_PYTHON
   only makes sense for packages using the python-package infrastructure,
   but Ninja is using the generic-package infrastructure (Thomas
   Petazzoni)
---
 package/ninja/ninja.mk | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

diff --git a/package/ninja/ninja.mk b/package/ninja/ninja.mk
index 9d6f30e9fe..6ae32d5ca3 100644
--- a/package/ninja/ninja.mk
+++ b/package/ninja/ninja.mk
@@ -9,7 +9,11 @@ NINJA_SITE = $(call github,ninja-build,ninja,$(NINJA_VERSION))
 NINJA_LICENSE = Apache-2.0
 NINJA_LICENSE_FILES = COPYING
 
-HOST_NINJA_DEPENDENCIES = $(if $(BR2_PACKAGE_PYTHON3),host-python3,host-python)
+# Although Ninja supports both Python2 and Python3, we enforce Python3 on the
+# host for the following reason: Meson is the only package using Ninja so far
+# and Meson requires Python3. In this way, we prevent both Python2 and Python3
+# from being created on the host, which is time consuming and without benefit.
+HOST_NINJA_DEPENDENCIES = host-python3
 
 define HOST_NINJA_BUILD_CMDS
 	(cd $(@D); ./configure.py --bootstrap)
-- 
2.21.0

^ permalink raw reply related	[flat|nested] 2+ messages in thread

* [Buildroot] [PATCH v2] package/ninja: enforce Python3 on the host
  2019-05-13 21:53 [Buildroot] [PATCH v2] package/ninja: enforce Python3 on the host Jörg Krause
@ 2019-05-14 16:39 ` Thomas Petazzoni
  0 siblings, 0 replies; 2+ messages in thread
From: Thomas Petazzoni @ 2019-05-14 16:39 UTC (permalink / raw)
  To: buildroot

On Mon, 13 May 2019 23:53:37 +0200
J?rg Krause <joerg.krause@embedded.rocks> wrote:

> The current logic selects Python3 for the host only if Python3 is
> selected for the target, otherwise it selects Python2.
> 
> As Meson, the only package infrastructure using ninja, needs Python3, it is
> desirable to also depend on Python3 on the host for the ninja host
> package.
> 
> Otherwise, if no Python interpreter is selected for the target, both
> Python2 and Python3 are build for the host, which is time consuming
> without any benefit.
> 
> For example when building libmpdclient (and all its target and host
> dependencies) the actual elapsed time for is reduced from around 286s to 207s
> as reported by `time -p make clean all`.
> 
> Signed-off-by: J?rg Krause <joerg.krause@embedded.rocks>
> ---
> v2:
>  * fix setting the dependency, as <pkg>_NEEDS_HOST_PYTHON
>    only makes sense for packages using the python-package infrastructure,
>    but Ninja is using the generic-package infrastructure (Thomas
>    Petazzoni)
> ---
>  package/ninja/ninja.mk | 6 +++++-
>  1 file changed, 5 insertions(+), 1 deletion(-)

Applied to next, thanks.

Thomas
-- 
Thomas Petazzoni, CTO, Bootlin
Embedded Linux and Kernel engineering
https://bootlin.com

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2019-05-14 16:39 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-05-13 21:53 [Buildroot] [PATCH v2] package/ninja: enforce Python3 on the host Jörg Krause
2019-05-14 16:39 ` Thomas Petazzoni

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.