From patchwork Mon Nov 30 15:26:50 2026 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Purdie X-Patchwork-Id: 106501 Received: from mail-wm1-f51.google.com (mail-wm1-f51.google.com [209.85.128.51]) by mx.groups.io with SMTP id smtpd.msgproc01-g2.34554.1796052429637859470 for ; Mon, 30 Nov 2026 07:27:10 -0800 Authentication-Results: mx.groups.io; dkim=pass header.i=@linuxfoundation.org header.s=google header.b=A7n/3b+r; spf=pass (domain: linuxfoundation.org, ip: 209.85.128.51, mailfrom: richard.purdie@linuxfoundation.org) Received: by mail-wm1-f51.google.com with SMTP id 5b1f17b1804b1-4bb6c7b6dbdso97971805e9.0 for ; Mon, 30 Nov 2026 07:27:09 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linuxfoundation.org; s=google; t=1796052428; x=1796657228; darn=lists.openembedded.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:to:from:from:to:cc:subject:date:message-id :reply-to:content-type; bh=rqZrARN5ton5k2wYOqMrPYB/6rGVFdTaRNGrJq5C4e8=; b=A7n/3b+rHyJMaQsVK5vFEv+bB8QoyZyLY63BXstVYteIqXpe3ogWka6Rf3W5MDTTqN C/90IP9wzht3Ps4l9gUwM4723zHxYdk1AOcdgWt6vWE7rLXdDTHizuRPKaJpwy6pVBNM 2/Rd2khXC5tWOLSf9PxLx6fUbJDtWzsUdSMjM= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20260707; t=1796052428; x=1796657228; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:to:from:x-gm-gg:x-gm-message-state:from:to :cc:subject:date:message-id:reply-to:content-type; bh=rqZrARN5ton5k2wYOqMrPYB/6rGVFdTaRNGrJq5C4e8=; b=gOrC6znaEZkVLHmdwzkBBgi3d3wKSM5HB//ZuHszSE1UJNezhPYaREdosVAdYrWrys uEqF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y4W519LPGM5JwSlTvm48h8/I3JSbMK9mK842I9sL9 KVpI= X-Received: by 2002:a05:600c:8884:b0:4bb:c9f8:adc with SMTP id 5b1f17b1804b1-4bbc9f80be9mr26617885e9.1.1796052427849; Mon, 30 Nov 2026 07:27:07 -0800 (PST) Return-Path: Received: from max.int.rpsys.net ([2001:8b0:aba:5f3c:2444:81bb:2aff:8d84]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-4bb8538b09bsm1704014155e9.4.2026.11.30.07.27.06 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 30 Nov 2026 07:27:07 -0800 (PST) From: Richard Purdie To: openembedded-core@lists.openembedded.org Subject: [PATCH 02/16] bitbake.conf/base: Add recipe hosttools warning to the start of builds Date: Mon, 30 Nov 2026 15:26:50 +0000 Message-ID: <20261130152704.3471590-2-richard.purdie@linuxfoundation.org> X-Mailer: git-send-email 2.55.0 In-Reply-To: <20261130152704.3471590-1-richard.purdie@linuxfoundation.org> References: <20261130152704.3471590-1-richard.purdie@linuxfoundation.org> MIME-Version: 1.0 List-Id: X-Webhook-Received: from 45-33-107-173.ip.linodeusercontent.com [45.33.107.173] by lin-tor-korg-lkml-alma10-1 with HTTPS for ; Mon, 30 Nov 2026 15:27:20 -0000 X-Groupsio-URL: https://lists.openembedded.org/g/openembedded-core/message/251611 Using the new bitbake event, check through RECIPE_HOSTOOLS from the recipes that are due to be built and error if any of the needed tools are not present. Signed-off-by: Richard Purdie --- meta/classes-global/base.bbclass | 27 +++++++++++++++++++++++++++ meta/conf/bitbake.conf | 1 + 2 files changed, 28 insertions(+) diff --git a/meta/classes-global/base.bbclass b/meta/classes-global/base.bbclass index 5aaa63ce505..f814f7fec47 100644 --- a/meta/classes-global/base.bbclass +++ b/meta/classes-global/base.bbclass @@ -298,6 +298,33 @@ python base_task_eventhandler() { setup_hosttools_dir(toolsdir, 'RECIPE_HOSTTOOLS', d) } +addhandler base_recipetools_eventhandler +base_recipetools_eventhandler[eventmask] = "bb.runqueue.RecipeCheckEvent" +python base_recipetools_eventhandler() { + recipedata = e.recipedata + needed = set() + for recipe in recipedata: + tools = recipedata[recipe]["RECIPE_HOSTTOOLS"].split() + for tool in tools: + needed.add(tool) + + origbbenv = d.getVar("BB_ORIGENV", False) + path = origbbenv.getVar("PATH") + # Need to ignore our own scripts directories to avoid circular links + for p in path.split(":"): + if p.endswith("/scripts"): + path = path.replace(p, "/ignoreme") + notfound = set() + for tool in needed: + # Prefer gnu-prefixed binaries, if available + srctool = (bb.utils.which(path, "gnu" + tool, executable=True) or + bb.utils.which(path, tool, executable=True)) + if not srctool: + notfound.add(tool) + if notfound: + bb.fatal("Tool(s) '%s' are needed by recipes due to be built but are not available on this system. Please add them first." % (" ".join(notfound))) +} + addhandler base_eventhandler base_eventhandler[eventmask] = "bb.event.ConfigParsed bb.event.MultiConfigParsed bb.event.BuildStarted bb.event.RecipePreFinalise bb.event.RecipeParsed bb.event.RecipePreDeferredInherits" python base_eventhandler() { diff --git a/meta/conf/bitbake.conf b/meta/conf/bitbake.conf index 99e76b704dc..795c220a8e5 100644 --- a/meta/conf/bitbake.conf +++ b/meta/conf/bitbake.conf @@ -522,6 +522,7 @@ export PATH # Build utility info. ################################################################## +BB_CACHE_EXTRAVARS += "RECIPE_HOSTTOOLS" # Directory with symlinks to host tools used by build HOSTTOOLS_DIR = "${TMPDIR}/hosttools" RECIPE_HOSTTOOLS_DIR = "${WORKDIR}/recipe-hosttools"