From patchwork Mon May 13 21:53:37 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?J=C3=B6rg_Krause?= X-Patchwork-Id: 1099129 Return-Path: X-Original-To: incoming-buildroot@patchwork.ozlabs.org Delivered-To: patchwork-incoming-buildroot@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (mailfrom) smtp.mailfrom=busybox.net (client-ip=140.211.166.133; helo=hemlock.osuosl.org; envelope-from=buildroot-bounces@busybox.net; receiver=) Authentication-Results: ozlabs.org; dmarc=none (p=none dis=none) header.from=embedded.rocks Received: from hemlock.osuosl.org (smtp2.osuosl.org [140.211.166.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 452vj85nwZz9sBV for ; Tue, 14 May 2019 07:54:04 +1000 (AEST) Received: from localhost (localhost [127.0.0.1]) by hemlock.osuosl.org (Postfix) with ESMTP id 5EB2E87118; Mon, 13 May 2019 21:54:00 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org Received: from hemlock.osuosl.org ([127.0.0.1]) by localhost (.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id jAlda+QJCmPv; Mon, 13 May 2019 21:53:59 +0000 (UTC) Received: from ash.osuosl.org (ash.osuosl.org [140.211.166.34]) by hemlock.osuosl.org (Postfix) with ESMTP id E6212875CB; Mon, 13 May 2019 21:53:58 +0000 (UTC) X-Original-To: buildroot@lists.busybox.net Delivered-To: buildroot@osuosl.org Received: from fraxinus.osuosl.org (smtp4.osuosl.org [140.211.166.137]) by ash.osuosl.org (Postfix) with ESMTP id 6B4411BF3D2 for ; Mon, 13 May 2019 21:53:57 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by fraxinus.osuosl.org (Postfix) with ESMTP id 684BF85C4C for ; Mon, 13 May 2019 21:53:57 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org Received: from fraxinus.osuosl.org ([127.0.0.1]) by localhost (.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id BrsaoiXQgnfA for ; Mon, 13 May 2019 21:53:56 +0000 (UTC) X-Greylist: from auto-whitelisted by SQLgrey-1.7.6 Received: from mout02.posteo.de (mout02.posteo.de [185.67.36.142]) by fraxinus.osuosl.org (Postfix) with ESMTPS id 1129985C47 for ; Mon, 13 May 2019 21:53:56 +0000 (UTC) Received: from submission (posteo.de [89.146.220.130]) by mout02.posteo.de (Postfix) with ESMTPS id E96C42400E5 for ; Mon, 13 May 2019 23:53:52 +0200 (CEST) Received: from customer (localhost [127.0.0.1]) by submission (posteo.de) with ESMTPSA id 452vhw0h1Wz9rxQ; Mon, 13 May 2019 23:53:51 +0200 (CEST) Received: from mail.embedded.rocks ([127.0.0.1]) by localhost (mail.embedded.rocks [127.0.0.1]) (amavisd-new, port 10025) with ESMTP id TQ8R14GLglpE; Mon, 13 May 2019 23:53:49 +0200 (CEST) Received: from nzxt.fritz.box (port-92-195-49-231.dynamic.qsc.de [92.195.49.231]) (Authenticated sender: joerg.krause@embedded.rocks) by mail.embedded.rocks (Postfix) with ESMTPSA; Mon, 13 May 2019 23:53:49 +0200 (CEST) From: =?utf-8?q?J=C3=B6rg_Krause?= To: buildroot@buildroot.org Date: Mon, 13 May 2019 23:53:37 +0200 Message-Id: <20190513215337.10400-1-joerg.krause@embedded.rocks> X-Mailer: git-send-email 2.21.0 MIME-Version: 1.0 Subject: [Buildroot] [PATCH v2] package/ninja: enforce Python3 on the host X-BeenThere: buildroot@busybox.net X-Mailman-Version: 2.1.29 Precedence: list List-Id: Discussion and development of buildroot List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Adam Duskett , Thomas Petazzoni Errors-To: buildroot-bounces@busybox.net Sender: "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 --- v2: * fix setting the dependency, as _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)