All of lore.kernel.org
 help / color / mirror / Atom feed
From: Eugen Hristev <eugen.hristev@microchip.com>
To: buildroot@busybox.net
Subject: [Buildroot] [PATCH] package/ninja: add dependency to host-cmake for host-ninja
Date: Fri, 6 Mar 2020 15:06:49 +0200	[thread overview]
Message-ID: <20200306130649.18989-1-eugen.hristev@microchip.com> (raw)

If we change the minimum CMAKE version in external,
buildroot will try to build host-cmake , but, host-cmake
is not built yet at the time of ninja build.
So, we need to add a dependency to host-cmake in host-ninja.
Otherwise, host-ninja will try to use the host-cmake but
'file not found' error.

Signed-off-by: Eugen Hristev <eugen.hristev@microchip.com>
---

Hello Thomas,

I am unsure about this patch, but this fixes the issue for me.
If we change the minimum CMAKE version in our external tree, we hit this
issue: the fact that the host-cmake is not yet built when it's needed.
How can we fix that ?
This patch makes host-cmake being built at the moment when ninja needs it.
It can happen that some other package may need it before, but I cannot know,
if it's not enabled in our config.

Actually, this all started from the fact that BR2_CMAKE_VERSION_MIN is hardcoded
in mk file in the support/dependencies.
How can this be hardcoded, when we can build buildroot with an external that
needs a newer CMAKE ?
So, to fix this I added in the external.mk:


BR2_CMAKE_VERSION_MIN = 3.13

BR2_CMAKE_CANDIDATES ?= cmake cmake3
BR2_CMAKE ?= $(call suitable-host-package,cmake,\
       $(BR2_CMAKE_VERSION_MIN) $(BR2_CMAKE_CANDIDATES))
ifeq ($(BR2_CMAKE),)
BR2_CMAKE = $(HOST_DIR)/bin/cmake
BR2_CMAKE_HOST_DEPENDENCY = host-cmake
endif


But now ninja fails because host-cmake does not exist yet. Not built yet.
So with this patch , all is fixed, but is this the right way, and can we
do it better from just the external ? To force the host-cmake to build
and ALL packets needing cmake to start using it.

Thanks,
Eugen

 package/ninja/ninja.mk | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/package/ninja/ninja.mk b/package/ninja/ninja.mk
index 060893d85f..998893f243 100644
--- a/package/ninja/ninja.mk
+++ b/package/ninja/ninja.mk
@@ -9,6 +9,9 @@ NINJA_SITE = $(call github,ninja-build,ninja,v$(NINJA_VERSION))
 NINJA_LICENSE = Apache-2.0
 NINJA_LICENSE_FILES = COPYING
 
+HOST_NINJA_DEPENDENCIES += \
+	host-cmake
+
 define HOST_NINJA_INSTALL_CMDS
 	$(INSTALL) -m 0755 -D $(@D)/ninja $(HOST_DIR)/bin/ninja
 endef
-- 
2.17.1

             reply	other threads:[~2020-03-06 13:06 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-03-06 13:06 Eugen Hristev [this message]
2020-03-06 13:38 ` [Buildroot] [PATCH] package/ninja: add dependency to host-cmake for host-ninja Thomas Petazzoni
2020-03-06 13:51   ` Eugen.Hristev at microchip.com

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20200306130649.18989-1-eugen.hristev@microchip.com \
    --to=eugen.hristev@microchip.com \
    --cc=buildroot@busybox.net \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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.