From patchwork Mon Nov 30 15:26:49 2026 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Purdie X-Patchwork-Id: 106496 Received: from mail-wm1-f48.google.com (mail-wm1-f48.google.com [209.85.128.48]) by mx.groups.io with SMTP id smtpd.msgproc02-g2.34823.1796052428917560839 for ; Mon, 30 Nov 2026 07:27:09 -0800 Authentication-Results: mx.groups.io; dkim=pass header.i=@linuxfoundation.org header.s=google header.b=bsNjVk9l; spf=pass (domain: linuxfoundation.org, ip: 209.85.128.48, mailfrom: richard.purdie@linuxfoundation.org) Received: by mail-wm1-f48.google.com with SMTP id 5b1f17b1804b1-4a214c5c4c0so103323775e9.3 for ; Mon, 30 Nov 2026 07:27:08 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linuxfoundation.org; s=google; t=1796052427; x=1796657227; darn=lists.openembedded.org; h=content-transfer-encoding:mime-version:message-id:date:subject:to :from:from:to:cc:subject:date:message-id:reply-to:content-type; bh=SnHnSM50l1mlrB6phSR8+vbbO0KRtYGZfZyEHCTqYh4=; b=bsNjVk9lk+Ya9qBERYjHGIGvGTsE6oBy0F6U1NWJJrTmFJTF8/bhiNMqPO3zUcNfk2 sDvgrt5KylbN4iAY61FnLlDEGBPuDRC64+wG4rO/nVBGfezdUiFD/XZT5/UF4xehXTFf IuLV97RmXnIuVwWhv5Y9KJvoe5GuCj0adhNtA= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20260707; t=1796052427; x=1796657227; h=content-transfer-encoding:mime-version: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=SnHnSM50l1mlrB6phSR8+vbbO0KRtYGZfZyEHCTqYh4=; b=1DWN9ja+GtLirClGf0rtMsQ/GR76Sdm9/Lt8+Y0RSsQXS2WxEOdHL991cABMzMIjhx KdeBm9siOzjF2P8EdRiE/daYREqufMXViiBCYQxLgkbaS+UOOETIS/px4ZmCfaxSGmo3 lJ85Sq+ob2lROQlM80G9K+RDqoRBArtJ3ZW6igHO85FEdUOJKpjacTifZIM1VuNds9/Q sYa8WuwAEm/KvJv0BI2Hm5UsDDQIafVXDp3odnE3fWWjF9ETgcE0lZ1/o2O6hn9f1Bri h32qjDXaErEo8+mTWElAiCZ0WS9bnV/WdCspJi20cl/N3qRsw17WyRSgOZ7Et4XjRdWS INjg== X-Gm-Message-State: APuU4Z89GheqNgr73XqKueP2RyJV4zZBlziM2IufJA2HYArlq+yUOsJj vsi7fPMfkcyAWOPQZAUP8iwY3AETeEMg82H868Ulue6yZI7twIn4pcqr2BZCDbcF4WZqCRU5mrj WRNaRV0Q= X-Gm-Gg: AZFdTZdc0kJ3l+m17xXksirW1XS+fRI6GjJ0D5WuSurdzkW1JZGA2obXjGaiY3V8h0r 3H+Vh7BW7o97I1M9IaJvFSgqkD2/b1CAqP435Zhw53AdKT0B522R4UyjobaL0mMVfSA+dzOuI9k E7ZMMMEfU2zo/o395GU5JAKv31DLIavi6Zp/MSEFt8oEVxcurUtkD2H4+2DInxmuTju1SBwvKmk PLm2P7GJxotkL0BwqMQiqi/I8+efwOMBXxZ3VQRSsuuQobUKOsMpsclge4oq/i6jA6q0rQm5wEH 8J9nOEpWAAIjNOWBgC/AW4LPNSF0I78EfQJbr2gE2Lgj24MLgAo4EcjzUMuFCSZAU09UbLD3jUj lfNRJrsUm2+6Y1duInNTKWu2vlTM6ItGTZv4+rY16SATo8fm7pnLTfMacJQYSElyUMJY4tvJJLv peqDnlLoCabbkbhWOFV4ZH0/BOzPcWGkWnRQDIRbZt11SixqX7QZP/nbRcnodFRrwJsG7t28b+y MwCUkXnAL2IRgYInmzwS6/PalQYTjm06JYfLh3dYwnzH+uU1IoR2JPzyeQGkQ066fZ77m/WRUbl EP18amKYrHQzH6MSII9EYuzfxc5LcP2pmHMmxBYISFp3+0IED30BafBvzg== X-Received: by 2002:a05:600c:8b2b:b0:4bb:c0b7:6cbf with SMTP id 5b1f17b1804b1-4bbc0b76e34mr118028385e9.2.1796052426672; Mon, 30 Nov 2026 07:27:06 -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.05 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 30 Nov 2026 07:27:05 -0800 (PST) From: Richard Purdie To: openembedded-core@lists.openembedded.org Subject: [PATCH 01/16] bitbake/base: Implement RECIPE_HOSTTOOLS Date: Mon, 30 Nov 2026 15:26:49 +0000 Message-ID: <20261130152704.3471590-1-richard.purdie@linuxfoundation.org> X-Mailer: git-send-email 2.55.0 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:19 -0000 X-Groupsio-URL: https://lists.openembedded.org/g/openembedded-core/message/251610 Being able to have hosttools added within specific recipes would be useful rather than always in the global hosttools directory. Add support for this, impementing it within the TaskStarted event. We need to use a lockfile to ensure the function doesn't race against other tasks also trying to create the same thing. This directory builds on top of HOSTTOOLS which is left as existing so that we don't have to do any work for recipes which don't need specific additional tools. Add a dependency on the HOSTTOOLS to do_configure, so when things change, things do get correctly rebuilt. Previously it was impractical to do this. Move the conditional tools define for testimage/testsdk into the classes as the first user. This also avoids a problematic dependency on BB_INCLUDED which would then have to be excluded. Signed-off-by: Richard Purdie --- meta/classes-global/base.bbclass | 12 +++++++++++- meta/classes-global/sstate.bbclass | 6 +++--- meta/classes-global/staging.bbclass | 2 +- meta/classes-recipe/testimage.bbclass | 2 ++ meta/classes-recipe/testsdk.bbclass | 2 ++ meta/conf/bitbake.conf | 4 +--- meta/conf/layer.conf | 2 +- 7 files changed, 21 insertions(+), 9 deletions(-) diff --git a/meta/classes-global/base.bbclass b/meta/classes-global/base.bbclass index 9553f004325..5aaa63ce505 100644 --- a/meta/classes-global/base.bbclass +++ b/meta/classes-global/base.bbclass @@ -153,7 +153,7 @@ def setup_hosttools_dir(dest, toolsvar, d, fatal=True): notfound.append(tool) if notfound and fatal: - bb.fatal("The following required tools (as specified by HOSTTOOLS) appear to be unavailable in PATH, please install them in order to proceed:\n %s" % " ".join(notfound)) + bb.fatal("The following required tools (as specified by %s) appear to be unavailable in PATH, please install them in order to proceed:\n %s" % (toolsvar, " ".join(notfound))) # We can't use vardepvalue against do_fetch directly since that would overwrite # the other task dependencies so we use an indirect function. @@ -289,6 +289,15 @@ def buildcfg_neededvars(d): if pesteruser: bb.fatal('The following variable(s) were not set: %s\nPlease set them directly, or choose a MACHINE or DISTRO that sets them.' % ', '.join(pesteruser)) +addhandler base_task_eventhandler +base_task_eventhandler[eventmask] = "bb.build.TaskStarted" +python base_task_eventhandler() { + if d.getVar('RECIPE_HOSTTOOLS'): + toolsdir = d.getVar('RECIPE_HOSTTOOLS_DIR') + with bb.utils.fileslocked([toolsdir + ".lock"]): + setup_hosttools_dir(toolsdir, 'RECIPE_HOSTTOOLS', d) +} + 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() { @@ -383,6 +392,7 @@ base_do_configure() { echo ${BB_TASKHASH} > ${CONFIGURESTAMPFILE} fi } +do_configure[vardeps] += "RECIPE_HOSTTOOLS HOSTTOOLS" addtask compile after do_configure do_compile[dirs] = "${B}" diff --git a/meta/classes-global/sstate.bbclass b/meta/classes-global/sstate.bbclass index c6d94591823..4f8128d3d4c 100644 --- a/meta/classes-global/sstate.bbclass +++ b/meta/classes-global/sstate.bbclass @@ -4,7 +4,7 @@ # SPDX-License-Identifier: MIT # -SSTATE_VERSION = "14" +SSTATE_VERSION = "15" SSTATE_ZSTD_CLEVEL ??= "8" @@ -69,7 +69,7 @@ SSTATE_ALLOW_OVERLAP_FILES += "${DEPLOY_DIR_IMAGE}/microcode" SSTATE_SCAN_FILES ?= "*.la *-config *_config postinst-*" SSTATE_SCAN_CMD ??= 'find ${SSTATE_BUILDDIR} \( -name "${@"\" -o -name \"".join(d.getVar("SSTATE_SCAN_FILES").split())}" \) -type f' -SSTATE_SCAN_CMD_NATIVE ??= 'grep -Irl -e ${RECIPE_SYSROOT} -e ${RECIPE_SYSROOT_NATIVE} -e ${HOSTTOOLS_DIR} ${SSTATE_BUILDDIR}' +SSTATE_SCAN_CMD_NATIVE ??= 'grep -Irl -e ${RECIPE_SYSROOT} -e ${RECIPE_SYSROOT_NATIVE} -e ${RECIPE_HOSTTOOLS_DIR} -e ${HOSTTOOLS_DIR} ${SSTATE_BUILDDIR}' SSTATE_HASHEQUIV_FILEMAP ?= " \ populate_sysroot:*/postinst-useradd-*:${TMPDIR} \ populate_sysroot:*/postinst-useradd-*:${COREBASE} \ @@ -99,7 +99,7 @@ SSTATECREATEFUNCS[vardeps] = "SSTATE_SCAN_FILES" SSTATEPOSTCREATEFUNCS = "" SSTATEPREINSTFUNCS = "" SSTATEPOSTUNPACKFUNCS = "sstate_hardcode_path_unpack" -EXTRA_STAGING_FIXMES ?= "HOSTTOOLS_DIR" +EXTRA_STAGING_FIXMES ?= "RECIPE_HOSTTOOLS_DIR HOSTTOOLS_DIR" # Check whether sstate exists for tasks that support sstate and are in the # locked signatures file. diff --git a/meta/classes-global/staging.bbclass b/meta/classes-global/staging.bbclass index 20340a16e1a..2d3edbb05ef 100644 --- a/meta/classes-global/staging.bbclass +++ b/meta/classes-global/staging.bbclass @@ -180,7 +180,7 @@ def staging_processfixme(fixme, target, recipesysroot, recipesysrootnative, d): if not fixme: return cmd = "sed -e 's:^[^/]*/:%s/:g' %s | xargs sed -i -e 's:FIXMESTAGINGDIRTARGET:%s:g; s:FIXMESTAGINGDIRHOST:%s:g'" % (target, " ".join(fixme), recipesysroot, recipesysrootnative) - for fixmevar in ['PSEUDO_SYSROOT', 'HOSTTOOLS_DIR', 'PKGDATA_DIR', 'PSEUDO_LOCALSTATEDIR', 'LOGFIFO']: + for fixmevar in ['PSEUDO_SYSROOT', 'RECIPE_HOSTTOOLS_DIR', 'HOSTTOOLS_DIR', 'PKGDATA_DIR', 'PSEUDO_LOCALSTATEDIR', 'LOGFIFO']: fixme_path = d.getVar(fixmevar) cmd += " -e 's:FIXME_%s:%s:g'" % (fixmevar, fixme_path) bb.debug(2, cmd) diff --git a/meta/classes-recipe/testimage.bbclass b/meta/classes-recipe/testimage.bbclass index 0c1a55a4c98..35eadef1f6d 100644 --- a/meta/classes-recipe/testimage.bbclass +++ b/meta/classes-recipe/testimage.bbclass @@ -95,6 +95,8 @@ DEFAULT_TEST_SUITES:remove:qemumips64 = "${MIPSREMOVE}" TEST_SUITES ?= "${DEFAULT_TEST_SUITES}" +RECIPE_HOSTTOOLS += "ip ping ps scp ssh stty" + QEMU_USE_KVM ?= "1" TEST_QEMUBOOT_TIMEOUT ?= "1000" TEST_OVERALL_TIMEOUT ?= "" diff --git a/meta/classes-recipe/testsdk.bbclass b/meta/classes-recipe/testsdk.bbclass index b1c4fa67e65..3cecdf63dab 100644 --- a/meta/classes-recipe/testsdk.bbclass +++ b/meta/classes-recipe/testsdk.bbclass @@ -21,6 +21,8 @@ TESTSDK_CLASS_NAME ?= "oeqa.sdk.testsdk.TestSDK" TESTSDKEXT_CLASS_NAME ?= "oeqa.sdkext.testsdk.TestSDKExt" TESTSDK_CASE_DIRS ?= "sdk" +RECIPE_HOSTTOOLS += "ip ping ps scp ssh stty" + def import_and_run(name, d): import importlib diff --git a/meta/conf/bitbake.conf b/meta/conf/bitbake.conf index d353a7cd2c3..99e76b704dc 100644 --- a/meta/conf/bitbake.conf +++ b/meta/conf/bitbake.conf @@ -524,6 +524,7 @@ export PATH # Directory with symlinks to host tools used by build HOSTTOOLS_DIR = "${TMPDIR}/hosttools" +RECIPE_HOSTTOOLS_DIR = "${WORKDIR}/recipe-hosttools" # Tools needed to run builds with OE-Core HOSTTOOLS += " \ @@ -538,9 +539,6 @@ HOSTTOOLS += " \ uniq unzstd wc wget which xargs zstd xz \ " -# Tools needed to run testimage runtime image testing -HOSTTOOLS += "${@'ip ping ps scp ssh stty' if (bb.utils.contains_any('IMAGE_CLASSES', 'testimage testsdk', True, False, d) or any(x in (d.getVar("BBINCLUDED") or "") for x in ["testimage.bbclass", "testsdk.bbclass"])) else ''}" - # Link to these if present HOSTTOOLS_NONFATAL += "aws gcc-ar gpg gpg-agent ld.bfd ld.gold nc pigz sftp socat ssh sudo" diff --git a/meta/conf/layer.conf b/meta/conf/layer.conf index 67fef791545..04bceadddee 100644 --- a/meta/conf/layer.conf +++ b/meta/conf/layer.conf @@ -138,7 +138,7 @@ DUMMY_PACKAGE_ARCHS_TARGET += "sdk-provides-dummy-target" # We need to keep bitbake tools in PATH # Avoid empty path entries BITBAKEPATH := "${@os.path.dirname(bb.utils.which(d.getVar('PATH'),'bitbake'))}" -PATH := "${@'${BITBAKEPATH}:' if '${BITBAKEPATH}' != '' else ''}${HOSTTOOLS_DIR}" +PATH := "${@'${BITBAKEPATH}:' if '${BITBAKEPATH}' != '' else ''}${RECIPE_HOSTTOOLS_DIR}:${HOSTTOOLS_DIR}" # Only OE-Core should set/change this BB_GLOBAL_PYMODULES = "os sys time" 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 uEqFiKk9bPt/DsPVP/yWD2sJwpTFTvEHGkRPj146CBfcRwE9gw+Iz8SsqWk+oC0TKZfk RMeS2sI+hQvbu7zAtmNZ3pBCBhHE40CB4OWUDWqP/nybDpf0X8SC7eJWNlRiEO5ve8tK 3jk/m7s1PToZ6Ihi+Ck8uNZ6z/uz8mKM/PrH+SX6MY7MT/N4OAQQTzcwJG86DbxrkpCl xUvQuQoddjQmCnzTTMDhqeO42musaoX9vOUzps9/oZgA5nip9TjsANp1VXb0HPe5nSUn 77FQ== X-Gm-Message-State: APuU4Z/D0JhR+24bMVKv9czWnuOpUadSZxXZu1yH15w1gqINVLbesr58 WByiVyr7DSwhFjSmuU7t8HD6cMBG0b0pEH2m4T71ydXr96nuRA1C4ZXwDf1g1dvWJVNCIZbC6gf 1w7FcwL8= X-Gm-Gg: AZFdTZeItCsxlrqfG8yauhw+PQYcANUCwYNHq874LEbeAsX7IcSgBn64T8O0OeBBOC7 SMK5lsJQfPZtXq8pCFlwIf1EKI5CI8jVrLbwBVXZUGF6PiG3ixlHpOwzZV1QLOpsZlxK/43qY+J r01G9MeKW+APFSUwI+S0u0JrXlpSHRUMbOV2eKYfSy8SoCuIzfe3irjWnPTbWpE/ipkjaI53SFZ K8vrD+zoVys01uTVMZ4JWV3eGvJCE1W6ihqUSkh3KObydvZhL1wx7+HjQ51vbLA8+ZOlc0LzvD0 jaxJiNrwm30X5KxesBJAVH1ysQV4Kn7YdXYzO7B9913+09M74tuX0GJeLm8SJX6EXqlNjKFHtNx 5+3W4xg/HHOtqioqjzMZZxzt+X/Y0r588+hX5y3PRD3XTH3MZxrHGbOpSS2z7jSDzXswNNLNb3c qZoWzRFSqjYuAmJxEvBMdpKRziAWDEiHYngTEjJrUOT7MmqC6mAy0tO9U7tpp6xLgu8iDVpRF0K m8/18mvxRW0Xj2CvRJZv1UYY34wLWK+hgrmjjQ7NR1wWC61R4M6M7fzq7AFadkLj+PsrYj4LI2J lK6GGMMNtCoTIsS94mAtoxztY3FnMSunFKy4W519LPGM5JwSlTvm48h8/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" From patchwork Mon Nov 30 15:26:51 2026 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Purdie X-Patchwork-Id: 106502 Received: from mail-wm1-f46.google.com (mail-wm1-f46.google.com [209.85.128.46]) by mx.groups.io with SMTP id smtpd.msgproc02-g2.34824.1796052431036029884 for ; Mon, 30 Nov 2026 07:27:11 -0800 Authentication-Results: mx.groups.io; dkim=pass header.i=@linuxfoundation.org header.s=google header.b=WwPEr3yc; spf=pass (domain: linuxfoundation.org, ip: 209.85.128.46, mailfrom: richard.purdie@linuxfoundation.org) Received: by mail-wm1-f46.google.com with SMTP id 5b1f17b1804b1-4bb6ba3b244so109226085e9.3 for ; Mon, 30 Nov 2026 07:27:10 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linuxfoundation.org; s=google; t=1796052429; x=1796657229; 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=54MVDpx7fm0e7uT6daJ/4dE7+kmLzZP7lvXK7thPzg8=; b=WwPEr3ycpfmVzUS8gTMLPf+Dac6YS0GPhs9Mr0YVtHw5KIrKTDYyxbrTZTVpD5XFLs 3qLXVQsYJb3KFVUtB2/+EbyGTwvJfBSx3VqRrNcGmOyINHN9x1diEFz2Qh18C7ht6MjH I9re+3cVGQJALG4KgPI5FAOQ/MTUSx6GT78Ww= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20260707; t=1796052429; x=1796657229; 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=54MVDpx7fm0e7uT6daJ/4dE7+kmLzZP7lvXK7thPzg8=; b=iiE6w3Jn4U2KjXS8vsISeN4vrncb8ZsqbHw3CDzBadm7yYUQWI/nYFtL0s0FZuPyDR T8xn/JX+gcOlGw4HZR3ekG0pKUNaY3cgxsFFNFIjXKljSfdSRO4JOliFEXgt/uiNVkzt 0EKZ8AlkXrqGwdFcVsLUDSFHpuZE0DpHEAh39BOHoYuR8RLVYEhuSEbTr6A1h5BtSPhJ jP0CfsoGZARiE9sZ60BW8iEd5qHQ8/NdTtaIxh1mr68htvC5CkhyvnECiNAt0+KknXdS Ogu5bRNzZP6r4uoT3BlzJ1DHyR+V9gt5R/BIOvQ5Vgsff5nTaEBJQ2LprvWO/dTAQsrM rXKQ== X-Gm-Message-State: APuU4Z8wpHS9R4EBf+Xc37nnTzlj6byMta0ScUbBx9HvhemXb4ySIc23 HwPDN8VfVpGXGJ1TyxkyiJraJDPgwHwx61B8RPWu/QoP7rV6t3dRiQG6x5h16CxbtZTMf8aW7pE oZM03DRU= X-Gm-Gg: AZFdTZcEtLjGHsjGL2eYAn/Q3g9y6fWJPHZRSVH/GE+fRW8oofG8Zq5lsIDxDZXIFYv bJ7oCBnG4nkZGzH36pAnyVM7PgVuF0oqiEQ8Tupws+Y7Im7bObHppZa5/hzmRvJgzbWw4xNNTxW nSbXNVJE+CnWG9K8iQQPEQERtVIUUmpqfRLhehwu9xbtVFG0uBOl+4KgR6aFTwy2lzXzRrU6nhc 4ETRSEld+Q93ao9QLXTCuS5gylByxfWKlsQeU9DOPAznzRvqYCR5siXXlpOmRLxEW2LxpAWwOlH vvwLerWhlGXGWDA7UlDRBsW6HcheLJg5a2+TUWKtHJTOdthbWoWDlDPcpTBEHa8QmHNoVdRzrY2 2cQCEfV5eySY2UDBhvTknk0ZF8JiJJkcqrOGJGinLJRX6PYNhVnLdBchffIwX9+b18XcQY1PZDS +7P3k8t2BCJBVr9NrgIdsfmsN9K9aZdoQYdvUSvmySeXK9PYYYUSJ9SVSHZAnIlySpo8x8vp2/J BUG5kmfMHQiL30g7IiuPK2YWqe/OGqy1DOiItg7KBk9OJw8wknH53/26H5sZ2bMqaAoWmqcaJeU 4XpNhqSx2mpvh6Cr1aQ22igtLYhChaI14wqmRep9T+nzgU3LoiWqhBK0vA== X-Received: by 2002:a05:600c:6383:b0:4bb:c483:ec9c with SMTP id 5b1f17b1804b1-4bbc483eda4mr76537795e9.1.1796052428904; Mon, 30 Nov 2026 07:27:08 -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.07 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 30 Nov 2026 07:27:08 -0800 (PST) From: Richard Purdie To: openembedded-core@lists.openembedded.org Subject: [PATCH 03/16] nfs-utils/bitbake.conf: Drop rpcgen from HOSTTOOLS Date: Mon, 30 Nov 2026 15:26:51 +0000 Message-ID: <20261130152704.3471590-3-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/251612 rpggen can be built and provided by rpcsvc-proto-native so we no longer need to have it from the host (where it used to be part of glibc). Drop from HOSTTOOLS, add a DEPENDS and switch to using it form the native sysroot. Signed-off-by: Richard Purdie --- meta/conf/bitbake.conf | 2 +- meta/recipes-connectivity/nfs-utils/nfs-utils_3.2.1.bb | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/meta/conf/bitbake.conf b/meta/conf/bitbake.conf index 795c220a8e5..6fce0bf41b6 100644 --- a/meta/conf/bitbake.conf +++ b/meta/conf/bitbake.conf @@ -534,7 +534,7 @@ HOSTTOOLS += " \ fgrep file find flock g++ gawk gcc getconf getopt git grep gunzip gzip \ head hostname iconv id install ld ldd ln ls make md5sum mkdir mkfifo mknod \ mktemp mv nm objcopy objdump od patch perl pr printf pwd \ - python3 pzstd ranlib readelf readlink realpath rm rmdir rpcgen sed seq sh \ + python3 pzstd ranlib readelf readlink realpath rm rmdir sed seq sh \ sha1sum sha224sum sha256sum sha384sum sha512sum \ sleep sort split stat strings strip tail tar tee test timeout touch tr true truncate uname \ uniq unzstd wc wget which xargs zstd xz \ diff --git a/meta/recipes-connectivity/nfs-utils/nfs-utils_3.2.1.bb b/meta/recipes-connectivity/nfs-utils/nfs-utils_3.2.1.bb index 63d68d63769..dbbd93eeda6 100644 --- a/meta/recipes-connectivity/nfs-utils/nfs-utils_3.2.1.bb +++ b/meta/recipes-connectivity/nfs-utils/nfs-utils_3.2.1.bb @@ -8,7 +8,7 @@ LICENSE = "BSD-3-Clause AND GPL-2.0-or-later AND MIT" LIC_FILES_CHKSUM = "file://COPYING;md5=95f3a93a5c3c7888de623b46ea085a84" # util-linux for libblkid -DEPENDS = "libcap libevent util-linux sqlite3 libtirpc libxml2 libnl" +DEPENDS = "libcap libevent util-linux sqlite3 libtirpc libxml2 libnl rpcsvc-proto-native" RDEPENDS:${PN} = "netbase ${PN}-client" RRECOMMENDS:${PN} = "kernel-module-nfsd" @@ -49,7 +49,7 @@ EXTRA_OECONF = "--with-statduser=rpcuser \ --enable-uuid \ --with-statdpath=/var/lib/nfs/statd \ --with-pluginpath=${libdir}/libnfsidmap \ - --with-rpcgen=${HOSTTOOLS_DIR}/rpcgen \ + --with-rpcgen=${STAGING_BINDIR_NATIVE}/rpcgen \ " LDFLAGS += "-lsqlite3 -levent" From patchwork Mon Nov 30 15:26:52 2026 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Purdie X-Patchwork-Id: 106503 Received: from mail-wm1-f41.google.com (mail-wm1-f41.google.com [209.85.128.41]) by mx.groups.io with SMTP id smtpd.msgproc02-g2.34825.1796052431854885108 for ; Mon, 30 Nov 2026 07:27:12 -0800 Authentication-Results: mx.groups.io; dkim=pass header.i=@linuxfoundation.org header.s=google header.b=dSSVmLmP; spf=pass (domain: linuxfoundation.org, ip: 209.85.128.41, mailfrom: richard.purdie@linuxfoundation.org) Received: by mail-wm1-f41.google.com with SMTP id 5b1f17b1804b1-4bb6ba3b244so109226355e9.3 for ; Mon, 30 Nov 2026 07:27:11 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linuxfoundation.org; s=google; t=1796052430; x=1796657230; 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=irfj7HHuWVM0l6EtUHw6Krbg+KczgXsAkd99N7N8DrA=; b=dSSVmLmP6j/cslDNOhBtkiOU5A/A8g/9O4RR+DMKx3s9x44Sftcyto8I/Ca8WSPQwu me3bI/2AYLi6PT3Hh2rOpe3FGz/MA+dIBxGr5+uOh+DB3RFk4Py1kuNVYspOamzBInO1 OFd6vikJJnE8Z6pEqrzRjPWA86y75ljDoKi6g= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20260707; t=1796052430; x=1796657230; 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=irfj7HHuWVM0l6EtUHw6Krbg+KczgXsAkd99N7N8DrA=; b=F9VbZrxnP2o0hwxdAZOqJ0qPeJCVvE8rV3r6LDyec+HH09GCw67kfnzQNhrn9np6+X kMvWzuXwC+njAdNkNUTDB8MNbbdmWS/qvjNILhxndSZU+zsBUbO7XyybcL0B/CWlg+ne gTYs23Efd2lNej7/OLWzInN3gvnU1+8TOgcHKNxTt8bEHXy173jeKdRqJr+FErXaXuGN vLEma2o1GXKVG2hVdxVInvRM5oHxKOeg6pvvyPEz/Ys/4953PN2XvDqsKhnQ8rPp5I3M LMEa8zglM/2Hmu0JMXdGWnh7of5Qf/vZwP1NeGpaEDsm0J4CVMPBiOuE4dJ+E2Ds7mMs A+Zg== X-Gm-Message-State: APuU4Z/kU5qZKuXd6e9pYvLV6X8z+Fg0RkZbQVzoKAKIOQ3EzLWXHKyI duZ4gDA0Mh4xu+PCwhv4Yy/ggfWob0BNIHiCjOch/ZK8S+LPvrnz4yZZYwL3NeytwQR+bEiGXDY Qj9KxV8M= X-Gm-Gg: AZFdTZebH2zGtWowIBuCbm5DreNbBzXMbP+Qr6q8g7aDJ6SJuf7iaChuY42+28UeJgh Sf5/QVzNf1XasZh0C46F8m7o0WWikpKC9/0yncblyBrIDL7RHfuoEnmJpKPA2ghbT7pGmn7Xg6L dbBAljtV+GgqW3BVNgruEWSBdke1xzYanx0b+xWXk/wEJLplKJshYPMyseJ5mHhiagbgYZmrZv2 pvjMF5DesYB73gMosqzo3wZL/7RXaqmwUExx0kwzUwN7eaXZN0mWBAUS++P1nDyRAgMkIivPgC8 VWPAs454L9wq6NwrlNzM6t9EsgSFkMrs6cQoDF72Ek9mHNYLwXALLVYpVb87NFKQjwXrgAlgaCj LVyEpyWOO1vh4rxnMMLRrG0at1A+KVisA4KhGRn3B0uhTvlwj840GeghBgR1FL3OMZT9UmBc0s/ im12h61pKLruoSztwLiv+GY4FxG8TrKLbZ8yLj7vat1F6bBQLQU6mQZIObc4unSSK3G6RjQDdHM Lkf2yF1wpy6naMSQwDLaMbMZfeUvOqOwJRm1v55yjwRZUzzuBQVnptTyewb2kH6Z1Y3Sw075qAS pAEY6r9geY8VpiPmcYDpf/e+7TBkas5it6s/Kpea447rI6LnjORihHiGWQ== X-Received: by 2002:a05:600c:4f0d:b0:4bb:5c97:f4b1 with SMTP id 5b1f17b1804b1-4bb8881941bmr733722345e9.24.1796052429932; Mon, 30 Nov 2026 07:27:09 -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.08 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 30 Nov 2026 07:27:09 -0800 (PST) From: Richard Purdie To: openembedded-core@lists.openembedded.org Subject: [PATCH 04/16] bitbake.conf: Merge basic HOSTTOOLS from coreutils/gzip Date: Mon, 30 Nov 2026 15:26:52 +0000 Message-ID: <20261130152704.3471590-4-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/251613 We may as well just list things from coreutils in HOSTTOOLS out the box. Since we have and need gzip, zcat is also effectively free too. Therefore merge the lists for cleanliness. Signed-off-by: Richard Purdie --- meta/conf/bitbake.conf | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-) diff --git a/meta/conf/bitbake.conf b/meta/conf/bitbake.conf index 6fce0bf41b6..4cb4f9f9c6e 100644 --- a/meta/conf/bitbake.conf +++ b/meta/conf/bitbake.conf @@ -532,20 +532,17 @@ HOSTTOOLS += " \ [ ar as awk basename bash bunzip2 bzip2 cat chgrp chmod chown chrpath cmp comm cp cpio \ cpp cut date dd diff diffstat dirname du echo egrep env expand expr false \ fgrep file find flock g++ gawk gcc getconf getopt git grep gunzip gzip \ - head hostname iconv id install ld ldd ln ls make md5sum mkdir mkfifo mknod \ - mktemp mv nm objcopy objdump od patch perl pr printf pwd \ - python3 pzstd ranlib readelf readlink realpath rm rmdir sed seq sh \ + head hostname iconv id install join ld ldd ln ls make md5sum mkdir mkfifo mknod \ + mktemp mv nl nm objcopy objdump od patch perl pr printf pwd \ + python3 pzstd ranlib readelf readlink realpath rm rmdir sed seq size sh \ sha1sum sha224sum sha256sum sha384sum sha512sum \ sleep sort split stat strings strip tail tar tee test timeout touch tr true truncate uname \ - uniq unzstd wc wget which xargs zstd xz \ + uniq unzstd wc wget which xargs xz yes zcat zstd \ " # Link to these if present HOSTTOOLS_NONFATAL += "aws gcc-ar gpg gpg-agent ld.bfd ld.gold nc pigz sftp socat ssh sudo" -# Temporary add few more detected in bitbake world -HOSTTOOLS_NONFATAL += "join nl size yes zcat" - # Used by bzr fetcher HOSTTOOLS_NONFATAL += "bzr" From patchwork Mon Nov 30 15:26:53 2026 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Purdie X-Patchwork-Id: 106497 Received: from mail-wr1-f46.google.com (mail-wr1-f46.google.com [209.85.221.46]) by mx.groups.io with SMTP id smtpd.msgproc01-g2.34555.1796052433500548585 for ; Mon, 30 Nov 2026 07:27:13 -0800 Authentication-Results: mx.groups.io; dkim=pass header.i=@linuxfoundation.org header.s=google header.b=A2ko5SHX; spf=pass (domain: linuxfoundation.org, ip: 209.85.221.46, mailfrom: richard.purdie@linuxfoundation.org) Received: by mail-wr1-f46.google.com with SMTP id ffacd0b85a97d-492fcbfaa88so7230711f8f.3 for ; Mon, 30 Nov 2026 07:27:13 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linuxfoundation.org; s=google; t=1796052431; x=1796657231; 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=j1wOnI/G9/vJu6K1Q3n2tqVCxvtC+TuQ6QueWjN8UFg=; b=A2ko5SHXhk3PnhelwNpQG1Ux5sEgMCD9oGtr9DVBCOYcGU4SKcl1WdvTxsCtMrMQIn t1hzoNC37CaVWGWZOKzQnWInkm/6Ic1s68B9KG9UVwQgXIX40w0b1gLgADSm1rlvVwRH oEifKdJ4sXqSq+5WbOsNwYNo1YvR7Rn5CV+lo= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20260707; t=1796052431; x=1796657231; 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=j1wOnI/G9/vJu6K1Q3n2tqVCxvtC+TuQ6QueWjN8UFg=; b=NooaqI6PyQCWpxlIpW38PN5TnvgPVxwsiuQhIw8+f2K/qzlc7pRkuIHMpczEc6GXYd fB2ALQeYP9XBPCbk14aT/UUlRwlqIpdmcCaNAt2rd2k/FLaQ20maKROumTzT0PzQHDf1 ujgF25K0MNKdZnM2u4QqFZKmwttKmIiaEUFFFXorVJHSuI7lhtDZdlI19gYQK+uv6IWc 1AFN/wGVdb/m6uf4gC8uabigsgjzM+wKllpNyYKyn9cDsMhiUlutui/5/2CV4nBcVeer WSk8hEcpTuts9uKjlHJ2J9nS6ObO1b4ItAThN+p8offN0HRPSdyrufDbybsVutObXFGM 9qOw== X-Gm-Message-State: APuU4Z9TEtnsZ2zS/b7VR0bkpjzyA5e83aOXc9BceNMw0ir+qtSXLMCc HZeYw/M8VeJyujmV3BEeFvHymsXyvk+x37FPZxW2zqnQb8nozd1X8I0RSSsKC0RntxvAr/W8Asp bOj3Z6Gg= X-Gm-Gg: AZFdTZdmyG68MzMYjgjr90U2ELeayq+hKh4DgdDXyitpCeyxPBDmM5ANoQy/CbKkPOm w5qrBuJ80WTjeafI5y3PD+zMSpDOlvI6PFph0S00EaFM1RxxynWcAYAeq3kvFRCxl39zNwPN6tG KjakqNYvAFqeJkzy/X0EqxooeWRYsKe1lAiU6Peqb7vf9XonmPveBgBUgHvVc52iHdAbNbzLYhe 2VbMvIEFYertPJWMZGs/LPjIgwq9egprBvdylCK9tNSx+ngNYPK6L5rzrwrH/YhlzM7YT4udtAu A0M+Lv3eOXbiibTrTUIM4YlW0lHVEvyECgRea4aKV9lgupRyZYc/TyTPt5h3+AQ6XW7kDg018r2 FbUTlaGRMD+rMwYtqYOqCARIO/KokdQlpg2jih/MvSoekQSo5eSByWEvIJZH4rOzDRWm+/yIYo6 IC5b/Z4hVXRcc75k+YBupURbsDXBR298MsU8YZTwh1xfShSlNUmV/H/qYQa2ku+7gM7pL6mJDka i9suaMX1ypT0GrrH3SifDFJKkjCAGB/0HrplGvJ9uifdP2LW4CuoBJI30dVVwgGEi3gO8xk8+Od EwULaGyxJ+icLSJVXcDM0mXM7hilgKWED+ikwVaJElCRQunLaTZ7bCfvWpE= X-Received: by 2002:a05:600c:a085:b0:4a2:526b:d410 with SMTP id 5b1f17b1804b1-4bb8881092bmr689628585e9.13.1796052431390; Mon, 30 Nov 2026 07:27:11 -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.10 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 30 Nov 2026 07:27:10 -0800 (PST) From: Richard Purdie To: openembedded-core@lists.openembedded.org Subject: [PATCH 05/16] bitbake.conf/base: Further HOSTTOOLS cleanup Date: Mon, 30 Nov 2026 15:26:53 +0000 Message-ID: <20261130152704.3471590-5-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:19 -0000 X-Groupsio-URL: https://lists.openembedded.org/g/openembedded-core/message/251614 Move several fetcher specific tools to become RECIPE_HOSTTOOLS (scp, ssh, sftp, aws, gsutil). This means errors are clearer, earlier for those with recipes that use them. It is assumed mercurial (hg) now comes from mecurial-native. ld.gold is being removed from binutils so we can drop. The bazaar fetcher (bzr) was dropped so the hosttool can be too. Signed-off-by: Richard Purdie --- meta/classes-global/base.bbclass | 12 ++++++++++++ meta/conf/bitbake.conf | 17 +---------------- 2 files changed, 13 insertions(+), 16 deletions(-) diff --git a/meta/classes-global/base.bbclass b/meta/classes-global/base.bbclass index f814f7fec47..1c8b5102639 100644 --- a/meta/classes-global/base.bbclass +++ b/meta/classes-global/base.bbclass @@ -670,6 +670,18 @@ python () { d.appendVar("EXTRANATIVEPATH", ' python3-native ') d.appendVarFlag('do_fetch', 'depends', ' mercurial-native:do_populate_sysroot ca-certificates-native:do_populate_sysroot') + elif uri.scheme == "gs": + d.appendVar("RECIPE_HOSTTOOLS", ' gsutil') + + elif uri.scheme == "sftp": + d.appendVar("RECIPE_HOSTTOOLS", ' sftp') + + elif uri.scheme == "ssh": + d.appendVar("RECIPE_HOSTTOOLS", ' ssh scp') + + elif uri.scheme == "s3": + d.appendVar("RECIPE_HOSTTOOLS", ' aws') + # OSC packages should DEPEND on osc-native elif uri.scheme == "osc": d.appendVarFlag('do_fetch', 'depends', ' osc-native:do_populate_sysroot') diff --git a/meta/conf/bitbake.conf b/meta/conf/bitbake.conf index 4cb4f9f9c6e..8ff14158d9a 100644 --- a/meta/conf/bitbake.conf +++ b/meta/conf/bitbake.conf @@ -541,22 +541,7 @@ HOSTTOOLS += " \ " # Link to these if present -HOSTTOOLS_NONFATAL += "aws gcc-ar gpg gpg-agent ld.bfd ld.gold nc pigz sftp socat ssh sudo" - -# Used by bzr fetcher -HOSTTOOLS_NONFATAL += "bzr" - -# Used by ssh fetcher -HOSTTOOLS_NONFATAL += "scp" - -# Used by Mercurial fetcher -HOSTTOOLS_NONFATAL += "hg" - -# Used by gcp fetcher -HOSTTOOLS_NONFATAL += "gsutil" - -# Link to git-lfs if present -HOSTTOOLS_NONFATAL += "git-lfs" +HOSTTOOLS_NONFATAL += "gcc-ar git-lfs gpg gpg-agent ld.bfd nc pigz socat sudo" CCACHE ??= "" From patchwork Mon Nov 30 15:26:54 2026 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Purdie X-Patchwork-Id: 106498 Received: from mail-wm1-f41.google.com (mail-wm1-f41.google.com [209.85.128.41]) by mx.groups.io with SMTP id smtpd.msgproc02-g2.34827.1796052435128889501 for ; Mon, 30 Nov 2026 07:27:15 -0800 Authentication-Results: mx.groups.io; dkim=pass header.i=@linuxfoundation.org header.s=google header.b=cED9uPie; spf=pass (domain: linuxfoundation.org, ip: 209.85.128.41, mailfrom: richard.purdie@linuxfoundation.org) Received: by mail-wm1-f41.google.com with SMTP id 5b1f17b1804b1-4bb6ba3b244so109227465e9.3 for ; Mon, 30 Nov 2026 07:27:14 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linuxfoundation.org; s=google; t=1796052433; x=1796657233; 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=CMgSJJRaW216e3tF3ylgFf1J1audkktc7mO5+6j5ZbU=; b=cED9uPien8t97s7XfECXIA29IozYO59sRRiULnirBYLskodWtfKga20vEGHRTjs2Ys 0IFBNZmPZPk2PBW8mLTX2YWF30Fqi6h1xJWxD8jayO21kQyyZ5ifO4CGqzE1af6w1Lch CTMsFd2EJ6JE4ycZYL1e1RpgfeZ6NdQdsuLzo= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20260707; t=1796052433; x=1796657233; 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=CMgSJJRaW216e3tF3ylgFf1J1audkktc7mO5+6j5ZbU=; b=dbnuLYjfU/q9M4+HkIrfuzTbvyRuOGbjZWcp3Cmel2oDb4L6LrWaWoD4k66RYge7Pt D32SaIyNXksbYWN3kHTuf2SryLlMqjK1QxwQhyMIruFnO62NZh06LaKy578fXYgF8TEi QKNtZUxcAMQdvHx6Fygr5hKOlaIzNZGbVn5AAR8zXvgD+C3qP/sR6u6Pgq38qwdTpiUe m84l9r6c2vHFvCzpt1r/8tpsEz7plfI3Oy0qjofSusH9EE10RzIf0kOEvk/6URa89eVl 1XCfJegaRhO0fJMAAv444EGtC2jjVsR5ZTu8cNBSHKuk2MnXj6HX3Ob8h4KdDLFJsraQ pNGA== X-Gm-Message-State: APuU4Z+X9xJh872wBBUZJQ+g0Byokp7gtvIkjQJH51w2VmrIzY4hB3Vt uUKQtrKXEQRZFDeq0BXeBE8G+GX3L2nHmkJyvv33SNeN86rUMQyVfX4KVQG+1cr8RrQJPhL7IH+ +udvfha4= X-Gm-Gg: AZFdTZdzCi/drxsf14fsU9P+B9FFpTqk8oZP32m9hSCD0JUk2uceCVOZdkJANKxaQbT J2NIglKKe4kyhjYev1m41/Hh0yV8VMnbalbEsZkPkMEtQwrRCCdCSA/p0e7dvzAFzFzMX7OozG7 UVvjFnghSnfgS3UMuZiRHyobc42/ykMTdDoZD2QXdA046KqIhvBrBXOqy+MSRYMJwyDtJZ//Txj f5KyC3vMKZUESY4mhjqxefl1KKw+2zopmtTeqbiu82F0EGU8dPdLPvcaPK1nVL7J3dyhe12GOiN p9RBXI9DcEFPNWt8fC/lwKX6abVpbLkNMn2UGPNQyE4Mrdzp7idU4YiLH2j0OSkfoNT8YifUgjq +XnL2Xesx+wpFGVYFoWXaz68cuVH+n1OKaK4Ila6hgkpg3UUMLgMA5eTLl5xLCmrX4vAmAJ2hRL gVcz3WrUHyn2Ya/CtEw144q3uJmJTKS5fVda+aA0aGeR1+gU2vGdXixgGT1771Y514OxLwBURku Ma54pHRHoM3l40oVgsct3iyVuyHSUG3fl+4+hoR6i9pTAAhUtYlbQYn/sbXdI0xByuT7sdnfEt9 MUHwpJTDl4Kc9f3DMpEAAH8wZ0CqwDAFEA58tuUdO/qiuwdW6BD1G35n3w== X-Received: by 2002:a05:600c:3547:b0:4a2:a6e:80f5 with SMTP id 5b1f17b1804b1-4bb888098bfmr690290885e9.11.1796052432748; Mon, 30 Nov 2026 07:27:12 -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.11 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 30 Nov 2026 07:27:11 -0800 (PST) From: Richard Purdie To: openembedded-core@lists.openembedded.org Subject: [PATCH 06/16] core: Migrate to new layer format Date: Mon, 30 Nov 2026 15:26:54 +0000 Message-ID: <20261130152704.3471590-6-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:19 -0000 X-Groupsio-URL: https://lists.openembedded.org/g/openembedded-core/message/251615 After bitbake "cooker: Change layer.conf handling to new approach", we need to update our layer.conf files to the new format. To quote that change: This is a fairly radical set of changes to the way layer.conf is handled and how it works with layers. I tried to split this into more specific changes but bascially I couldn't make that work in any reasonable way. It is not intended to be backward compatible even if some bits of syntax are similar. There were several historical issues: - layers can contain multiple 'collections' - priorities could depend on the file, collection and layer which interacted in ways people couldn't easily picture - layer.conf became a dumping ground for random variables - the current internal layer/collection 'names' are suboptimal This patch therefore: - Drops the concept of 'collections' - Drops layer priorities - Drops file priorities - Requires LAYERNAME to be set - Auto constructs BBPATH based on layer dependencies - AUto constructs BBFILES based on layer dependencies - Auto constructs BBFILES_DYNAMIC based on a "dynamic-recipes" directory - Filter layer.conf variables - Adds support for layer specific variables in layervars.conf - Sets LAYERDIR_ variables (and includes bitbake) - No longer supports layers within layers (multiple layers in a repo is still fine) More details notes follow (with examples from OE): """ layer.conf has radically changed and is now parsed in isolation on top of bblayers.conf. This means any changes made to variables in that file don't pass to other files or the global state by default. ":append" would only add to the value from bblayers. Overrides will not work as they're not defined at this point. layer.conf is now expected to set a LAYERNAME. The layer names are going to change. Some examples: "core" -> "oe-core" "openembedded-layer" -> "meta-oe" "networking-layer" -> meta-oe-networking" "virtualization-layer" -> "meta-virtualization" The idea is to have a consistent base prefix for combined repos so that the repo can be identified from the name (e.g. in a list of dependencies), and drop unneeded "-layer" suffix, make "core" clearer from other "core" things. As such, we are expecting layers to move to new names. Note that any fragment references also then need to use the new layer names. The LAYERDEPENDS and LAYERRECOMMENDS variables remain as before. LAYER* variables which traditionally had a collection name suffix, e.g. "_core" now don't need to be suffixed with the layername, but can be. The concepts of layer priorities, bbfile prorities and collections are all removed. This means the variables BFILE_COLLECTIONS, BBFILE_PRIORITY and BBFILE_PATTERN no longer do anything but trigger warnings. BBPATH and BBFILES no longer should be set by layer.conf. They are both now set based upon the information from LAYERDEPENDS. If you depend on a layer, you have the ability to change it. BBFILES will now just include .bb and .bbappend files in any recipes* directories. BBFILES_DYNAMIC is also no longer needed. Instead, bitbake will look for a "dynamic-recipes" directory and apply any subdirectories directories there based on layername, adding any files contained to BBFILES internally dynamically. Bitbake will set LAYERDIR_ in the global namespace. In addition, it will also set BITBAKEDIR to point at itself (OE-Core needs that, hopefully nothing else does and it is really for internal use to build PATH correctly). BBLAYERS no longer controls much other that the layers to include. There are two variables which are exceptions, LAYERSERIES_CORENAMES and LAYER_PASSTHROUGH_VARS_PREFIXES. These two are only set by the first layer included that sets them. For the layerseries, this is by historical precedent, I did this for the latter for now to potentially cover some weird use cases people may have. I am tempted to remove that special casing and only allow one layer to set those variables. There are some variables which can pass from layer.conf into the global scope. There is a list of variable prefixes which are accepted in LAYER_PASSTHROUGH_VARS_PREFIXES. These should be lists which work well with +=. This list is deliberately restrictive, I've worked with the sample layers to remove as many of them that I can. Layers do need some way of setting variables for their own recipes. This is done with a new layervars.conf, which recipes in a given layer will always have included (in .bb files but not .bbappend). Note that layervars.conf is parsed on top of the base configuration, so much later in parsing than layer.conf. One pattern we've noticed is layers wanting to warn that the configuration they provide is not enabled and to provide that config, usually as a DISTRO_FEATURE. I've changed meta-virtiualization to use fragments to enable the different configs (which can enable DISTRO_FEATURES in turn). That means we can add a LAYER_FRAGEMENTS_RECOMMEND_ANY variable which is used to warn when fragments aren't selected and the user can override with LAYER_FRAGEMENTS_OPTED_OUT to hide the warnings if they really don't want to select any. Some things are better imeplemented with conf files and a "include_all" directive in core. I've changed security flags and reproducible builds to do that, we should be doing this anyway. Some layers have been setting INHERIT in layer.conf. This is no longer supported and should be done by configuration files/fragments instead. It can be done in layervars.conf but will only apply to recipes in that layer (and not bbapends). There is a BB_LAYER_FILTER_FUNC variable which takes the name of function which can make final changes to the datastore at the end of "layer" parsing before the main parse. If your layer is intended to be shared at all and used by others outside your own context, you *should not* be using this. It can only be set once, by the first layer.conf found that sets it. From an internals perspective, there is now a Layers object stored in the datastore as "layerdata". This is useful for some areas of the code to be able to work with layers, such as the fragment code. It is considered semi-internal API at this point. It does mean anyone iterating datastore values needs to be careful about non-text return values but we already have those. """ Signed-off-by: Richard Purdie --- meta-selftest/conf/layer.conf | 14 ++----- meta-skeleton/conf/layer.conf | 21 ++-------- meta/classes-recipe/testexport.bbclass | 6 +-- meta/classes-recipe/toolchain-scripts.bbclass | 2 +- meta/conf/bitbake.conf | 11 +++--- meta/conf/layer.conf | 39 ++++++++++--------- meta/conf/templates/default/local.conf.sample | 2 +- meta/lib/oeqa/selftest/cases/bblayers.py | 8 ++-- scripts/lib/devtool/ide_sdk.py | 4 +- 9 files changed, 44 insertions(+), 63 deletions(-) diff --git a/meta-selftest/conf/layer.conf b/meta-selftest/conf/layer.conf index 40b6b6910ad..2aa8b9b3dca 100644 --- a/meta-selftest/conf/layer.conf +++ b/meta-selftest/conf/layer.conf @@ -1,16 +1,8 @@ -# We have a conf and classes directory, add to BBPATH -BBPATH .= ":${LAYERDIR}" -# We have recipes-* directories, add to BBFILES -BBFILES += "${LAYERDIR}/recipes-*/*/*.bb \ - ${LAYERDIR}/recipes-*/*/*.bbappend" - -BBFILE_COLLECTIONS += "selftest" -BBFILE_PATTERN_selftest = "^${LAYERDIR}/" -BBFILE_PRIORITY_selftest = "5" +LAYERNAME = "selftest" addpylib ${LAYERDIR}/lib oeqa -LAYERSERIES_COMPAT_selftest = "blacksail" +LAYERSERIES_COMPAT_selftest = "garburn" -OE_FRAGMENTS_BUILTIN:append = " selftest-fragment:SELFTEST_BUILTIN_FRAGMENT_VARIABLE" +OE_FRAGMENTS_BUILTIN += " selftest-fragment:SELFTEST_BUILTIN_FRAGMENT_VARIABLE" diff --git a/meta-skeleton/conf/layer.conf b/meta-skeleton/conf/layer.conf index 94909d51205..fdb2f01c27c 100644 --- a/meta-skeleton/conf/layer.conf +++ b/meta-skeleton/conf/layer.conf @@ -1,17 +1,4 @@ -# We have a conf and classes directory, add to BBPATH -BBPATH .= ":${LAYERDIR}" - -# We have recipes-* directories, add to BBFILES -BBFILES += "${LAYERDIR}/recipes-*/*/*.bb ${LAYERDIR}/recipes-*/*/*.bbappend" - -BBFILE_COLLECTIONS += "skeleton" -BBFILE_PATTERN_skeleton = "^${LAYERDIR}/" -BBFILE_PRIORITY_skeleton = "1" - -# This should only be incremented on significant changes that will -# cause compatibility issues with other layers -LAYERVERSION_skeleton = "1" - -LAYERDEPENDS_skeleton = "core" - -LAYERSERIES_COMPAT_skeleton = "blacksail" +LAYERNAME = "skeleton" +LAYERVERSION = "1" +LAYERDEPENDS = "oe-core" +LAYERSERIES_COMPAT = "garburn" diff --git a/meta/classes-recipe/testexport.bbclass b/meta/classes-recipe/testexport.bbclass index b2b4a358c43..655f4267244 100644 --- a/meta/classes-recipe/testexport.bbclass +++ b/meta/classes-recipe/testexport.bbclass @@ -85,7 +85,7 @@ def copy_needed_files(d, tc): from oeqa.core.utils.test import getSuiteCasesFiles export_path = d.getVar('TEST_EXPORT_DIR') - bitbake_path = d.getVar('BITBAKEPATH') + bitbake_path = d.getVar('BITBAKEDIR') corebase_path = d.getVar('COREBASE') bblayers = d.getVar('BBLAYERS').split() @@ -93,10 +93,10 @@ def copy_needed_files(d, tc): oe.path.remove(export_path) bb.utils.mkdirhier(os.path.join(export_path, 'lib', 'oeqa')) - # The source of files to copy are relative to 'BITBAKEPATH' and 'COREBASE' + # The source of files to copy are relative to 'BITBAKEDIR' and 'COREBASE' # directory. The destination is relative to 'TEST_EXPORT_DIR'. # bitbake and core files/dirs first. - bitbake_files_to_copy = [os.path.join('..', 'lib')] + bitbake_files_to_copy = ['lib'] for f in bitbake_files_to_copy: src = os.path.join(bitbake_path, f) dst = os.path.join(export_path, 'bitbake', f.split('/', 1)[-1]) diff --git a/meta/classes-recipe/toolchain-scripts.bbclass b/meta/classes-recipe/toolchain-scripts.bbclass index 7b10b76609e..7bb77a5a7c4 100644 --- a/meta/classes-recipe/toolchain-scripts.bbclass +++ b/meta/classes-recipe/toolchain-scripts.bbclass @@ -89,7 +89,7 @@ toolchain_create_sdk_env_script () { # Caller must ensure CONFIG_SITE is setup toolchain_create_tree_env_script () { script=${B}/environment-setup-${REAL_MULTIMACH_TARGET_SYS} - bitbakedir=$(readlink -f ${BITBAKEPATH}/..) + bitbakedir=$(readlink -f ${BITBAKEDIR}) rm -f $script touch $script echo 'standalone_sysroot_target="${STAGING_DIR}/${MACHINE}"' >> $script diff --git a/meta/conf/bitbake.conf b/meta/conf/bitbake.conf index 8ff14158d9a..4a28b619c12 100644 --- a/meta/conf/bitbake.conf +++ b/meta/conf/bitbake.conf @@ -1,3 +1,5 @@ +COREBASE := "${@os.path.realpath('${LAYERDIR_oe-core}/../')}" + ################################################################## # Standard target filesystem paths. ################################################################## @@ -515,8 +517,7 @@ EXTRA_IMAGEDEPENDS = "" # Toolchain info. ################################################################## -PATH:prepend = "${COREBASE}/scripts:${STAGING_BINDIR_TOOLCHAIN}:${STAGING_BINDIR_CROSS}:${STAGING_DIR_NATIVE}${sbindir_native}:${STAGING_BINDIR_NATIVE}:${STAGING_DIR_NATIVE}${base_sbindir_native}:${STAGING_DIR_NATIVE}${base_bindir_native}:" -export PATH +export PATH = "${COREBASE}/scripts:${STAGING_BINDIR_TOOLCHAIN}:${STAGING_BINDIR_CROSS}:${STAGING_DIR_NATIVE}${sbindir_native}:${STAGING_BINDIR_NATIVE}:${STAGING_DIR_NATIVE}${base_sbindir_native}:${STAGING_DIR_NATIVE}${base_bindir_native}:${BITBAKEDIR}/bin:${RECIPE_HOSTTOOLS_DIR}:${HOSTTOOLS_DIR}" ################################################################## # Build utility info. @@ -803,7 +804,7 @@ include conf/local.conf OE_FRAGMENTS_PREFIX ?= "conf/fragments" OE_FRAGMENTS_METADATA_VARS ?= "BB_CONF_FRAGMENT_SUMMARY BB_CONF_FRAGMENT_DESCRIPTION" -OE_FRAGMENTS_BUILTIN ?= "machine:MACHINE distro:DISTRO" +OE_FRAGMENTS_BUILTIN =+ "machine:MACHINE distro:DISTRO" addfragments ${OE_FRAGMENTS_PREFIX} OE_FRAGMENTS OE_FRAGMENTS_METADATA_VARS OE_FRAGMENTS_BUILTIN require ${@"conf/multiconfig/${BB_CURRENT_MC}.conf" if "${BB_CURRENT_MC}" != "" else ""} @@ -902,8 +903,8 @@ DISTRO_FEATURES_NATIVESDK:mingw32 = "x11 ipv6" # Normally target distro features will not be applied to native builds: # Native distro features on this list will use the target feature value -DISTRO_FEATURES_FILTER_NATIVE ?= "api-documentation debuginfod opengl wayland" -DISTRO_FEATURES_FILTER_NATIVESDK ?= "api-documentation debuginfod opengl wayland" +DISTRO_FEATURES_FILTER_NATIVE += "api-documentation debuginfod opengl wayland" +DISTRO_FEATURES_FILTER_NATIVESDK += "api-documentation debuginfod opengl wayland" MACHINE_FEATURES_DEFAULTS = "rtc qemu-usermode" diff --git a/meta/conf/layer.conf b/meta/conf/layer.conf index 04bceadddee..53f77d165c2 100644 --- a/meta/conf/layer.conf +++ b/meta/conf/layer.conf @@ -1,23 +1,29 @@ -# We have a conf and classes directory, add to BBPATH -BBPATH .= ":${LAYERDIR}" -# We have recipes-* directories, add to BBFILES -BBFILES += "${LAYERDIR}/recipes-*/*/*.bb" +LAYERNAME = "oe-core" -BBFILE_COLLECTIONS += "core" -BBFILE_PATTERN_core = "^${LAYERDIR}/" -BBFILE_PRIORITY_core = "5" - -LAYERSERIES_CORENAMES = "blacksail" +LAYERSERIES_CORENAMES = "garburn" # This should only be incremented on significant changes that will # cause compatibility issues with other layers -LAYERVERSION_core = "15" -LAYERSERIES_COMPAT_core = "blacksail" +LAYERVERSION = "15" +LAYERSERIES_COMPAT = "garburn" -BBLAYERS_LAYERINDEX_NAME_core = "openembedded-core" +LAYER_PASSTHROUGH_VARS_PREFIXES = " \ + BBMASK \ + PREFERRED_RPROVIDER \ + PREFERRED_PROVIDER \ + OE_FRAGMENTS_BUILTIN \ + NON_MULTILIB_RECIPES \ + IMAGE_CLASSES \ + SIGGEN_EXCLUDE_SAFE_RECIPE_DEPS \ + SIGGEN_EXCLUDERECIPES_ABISAFE \ + SSTATE_EXCLUDEDEPS_SYSROOT \ + DUMMY_PACKAGE_ARCHS_TARGET \ + DUMMY_PACKAGE_ARCHS_SDK \ + DISTRO_FEATURES_FILTER_NATIVE \ + DISTRO_FEATURES_FILTER_NATIVESDK \ +" -# Set a variable to get to the top of the metadata location -COREBASE = '${@os.path.normpath("${LAYERDIR}/../")}' +BBLAYERS_LAYERINDEX_NAME_oe-core = "openembedded-core" # opkg-utils is for update-alternatives :( SIGGEN_EXCLUDERECIPES_ABISAFE += " \ @@ -135,11 +141,6 @@ SSTATE_EXCLUDEDEPS_SYSROOT += ".*->autoconf-archive-native" DUMMY_PACKAGE_ARCHS_SDK += "buildtools-dummy-${SDKPKGSUFFIX} sdk-provides-dummy-${SDKPKGSUFFIX}" DUMMY_PACKAGE_ARCHS_TARGET += "sdk-provides-dummy-target" -# We need to keep bitbake tools in PATH -# Avoid empty path entries -BITBAKEPATH := "${@os.path.dirname(bb.utils.which(d.getVar('PATH'),'bitbake'))}" -PATH := "${@'${BITBAKEPATH}:' if '${BITBAKEPATH}' != '' else ''}${RECIPE_HOSTTOOLS_DIR}:${HOSTTOOLS_DIR}" - # Only OE-Core should set/change this BB_GLOBAL_PYMODULES = "os sys time" diff --git a/meta/conf/templates/default/local.conf.sample b/meta/conf/templates/default/local.conf.sample index 935699929c3..a4178edff11 100644 --- a/meta/conf/templates/default/local.conf.sample +++ b/meta/conf/templates/default/local.conf.sample @@ -213,7 +213,7 @@ BB_DISKMON_DIRS ??= "\ # will then speed up the builds by not having to build things if they are present in the # cache. It assumes you can download something faster than you can build it which will # depend on your network. -# OE_FRAGMENTS += "core/yocto/sstate-mirror-cdn" +# OE_FRAGMENTS += "oe-core/yocto/sstate-mirror-cdn" # # Qemu configuration diff --git a/meta/lib/oeqa/selftest/cases/bblayers.py b/meta/lib/oeqa/selftest/cases/bblayers.py index 849afe36718..7ca82e0d5c0 100644 --- a/meta/lib/oeqa/selftest/cases/bblayers.py +++ b/meta/lib/oeqa/selftest/cases/bblayers.py @@ -21,9 +21,9 @@ class BitbakeLayers(OESelftestTestCase): bitbake("-c addto_recipe_sysroot python3-jsonschema-native") # Fetch variables used in multiple test cases - bb_vars = get_bb_vars(['COREBASE', 'BITBAKEPATH']) + bb_vars = get_bb_vars(['COREBASE', 'BITBAKEDIR']) cls.corebase = bb_vars['COREBASE'] - cls.bitbakepath = bb_vars['BITBAKEPATH'] + cls.bitbakedir = bb_vars['BITBAKEDIR'] cls.jsonschema_staging_bindir = get_bb_var('STAGING_BINDIR', 'python3-jsonschema-native') def test_bitbakelayers_layerindexshowdepends(self): @@ -145,7 +145,7 @@ class BitbakeLayers(OESelftestTestCase): def validate_json(self, json, jsonschema): python = os.path.join(self.jsonschema_staging_bindir, 'nativepython3') jsonvalidator = os.path.join(self.jsonschema_staging_bindir, 'jsonschema') - schemas_dir = os.path.join(self.bitbakepath, "..", "setup-schema") + schemas_dir = os.path.join(self.bitbakedir, "setup-schema") if not os.path.isabs(jsonschema): jsonschema = os.path.join(schemas_dir, jsonschema) @@ -165,7 +165,7 @@ class BitbakeLayers(OESelftestTestCase): def test_validate_bitbake_setup_default_registry(self): jsonschema = "bitbake-setup.schema.json" - default_registry_path = os.path.join(self.bitbakepath, "..", "default-registry", "configurations") + default_registry_path = os.path.join(self.bitbakedir, "default-registry", "configurations") for root, _, files in os.walk(default_registry_path): for f in files: diff --git a/scripts/lib/devtool/ide_sdk.py b/scripts/lib/devtool/ide_sdk.py index 9faf041957e..5dc5199c24b 100755 --- a/scripts/lib/devtool/ide_sdk.py +++ b/scripts/lib/devtool/ide_sdk.py @@ -974,7 +974,7 @@ class RecipeModified: self.base_libdir = recipe_d.getVar('base_libdir') self.bblayers = recipe_d.getVar('BBLAYERS').split() self.bindir = recipe_d.getVar('bindir') - self.bitbakepath = recipe_d.getVar('BITBAKEPATH') + self.bitbakepath = recipe_d.getVar('BITBAKEDIR') self.bpn = recipe_d.getVar('BPN') self.cc = recipe_d.getVar('CC') self.cxx = recipe_d.getVar('CXX') @@ -1656,7 +1656,7 @@ class RecipeModified: cmd_lines += ['import os', 'import sys', 'sys.path.insert(0, %r)' % os.path.realpath( - os.path.join(self.bitbakepath, '..', 'lib')), + os.path.join(self.bitbakepath, 'lib')), 'import bb.tinfoil', 'os.chdir(%r)' % self.topdir, # A stale BBPATH from the caller's environment (e.g. a From patchwork Mon Nov 30 15:26:55 2026 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Purdie X-Patchwork-Id: 106499 Received: from mail-wm1-f52.google.com (mail-wm1-f52.google.com [209.85.128.52]) by mx.groups.io with SMTP id smtpd.msgproc02-g2.34829.1796052435839704350 for ; Mon, 30 Nov 2026 07:27:16 -0800 Authentication-Results: mx.groups.io; dkim=pass header.i=@linuxfoundation.org header.s=google header.b=RkXXiPFS; spf=pass (domain: linuxfoundation.org, ip: 209.85.128.52, mailfrom: richard.purdie@linuxfoundation.org) Received: by mail-wm1-f52.google.com with SMTP id 5b1f17b1804b1-4bb606491faso55469375e9.3 for ; Mon, 30 Nov 2026 07:27:15 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linuxfoundation.org; s=google; t=1796052434; x=1796657234; 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=/365kiTK0kIwQjHE3D7AxYxHfxi6F6ueq7Xu0zUIL+E=; b=RkXXiPFSwO1VZ1McdLGpBOv6D8d9WCHO2sfkHw+y85MMbwRhG2ZYhLJYaiaohEV2qS yMsxZbHgeaTOqVR91trAlEgtEoQ9J/usdIMRtJacxjjYNFIRDgzlg1j+72Q9C0ypp2iY yEMVCywo9rD7e+ND+VoLIUGdYhQtnaBv/i7hs= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20260707; t=1796052434; x=1796657234; 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=/365kiTK0kIwQjHE3D7AxYxHfxi6F6ueq7Xu0zUIL+E=; b=wbRNEFKab/vtk11BURIUsOZ5b1u3H0q+IJ5GzbfTaQrAo/CMejDpsFM3ZI7XUz3aGE Alq1/Jtlkay8+JvX5JC36z5DH4fveTCDJaMcQLsmkXqZr9vR3otUtkx4BknPcNLtwqNF 6v6p/yuvVw9MyW8ctVlhu4qpRoyzjk4tNZAbk0fxS2hrl+tOIK33k8ULi71p1W48fWg+ 1JKyOAPunhLh19+s+nf3HN2+rlFkurHPzggQuDbygv/LjGVJ22AM+g6vjkk91HQc48ZZ ZSmtxOV9pdqPCrnHhKLlme9hKrBx8PrI36TYC63r6zpxLErdv08AXOWqEWDnQNks54nd ZiVA== X-Gm-Message-State: APuU4Z+VwwinWjAEb0vmRe+i1iOu/CbBr/geBw+kJbIzfVCMMXbf0dxo k66R804/MXGUsHfOd3oJNLvnzXOEO+5iJLk5q63BQSDQQ0+pafCmpp9E7a6mZLhIHj0FeNM7fZP iRe5C8Z4= X-Gm-Gg: AZFdTZdAaak85sP+bQt7KCE4h9lr1LN2E9huiHcVwcUqDUcnTRBhx5jQztSvKRlRanw drlGD5h5WNmb2izSq2IbvLDwK3ueY9186MdSnhFbQnR5nambbJvKEiZCfNk6eqGOj7K7MyiVr3v u8Wb4S+xLSM7iTByVWGtsIfIOyWl0K38v44GK8G8paitwA1OD0EWA+dRHwELgQSicRjgiOpZZ7M 8uga8mYL7z44bGyGq1CXvNzFBgk3QmVWnKZ1PMDp9cgx0woT1iVJFrCzFLLaptOFpy+Q72C44sD sSV2ONXx0n6Mrwmq8jaqHGqmmI2LyH9SaV05WeO3Ylc7r5tPpqg3FnDOhQZ1wXQzTlXT3O1BMbe YNdcJ/L9Mj+NnnkBu2hoDtXU4B5IFDm6NMXWR4n+sYm4vjmrEYFORCiJUi6CO1/yQVuqeiRKD1D x+flLwXFVJGGmf+dyYiUCV5N1ygRJuSBWzqoLQAcphmgX52ufTOudO9KgSucI/00NwtjzhkdOSM gF25C/c+iWhWbeiCByEsPeiJJsCG/hrmSlawxR1bcKJesIoSfPv1R7lZkto3ybnml24ZJBtZCW/ 4p9O3TZzoB+EjmZEXRTn9RnQISOrsLa9RSw/oUK+mk3anjtzs973yatagg== X-Received: by 2002:a05:600c:a115:b0:4bb:a5e1:74ac with SMTP id 5b1f17b1804b1-4bba5e195bcmr273847975e9.4.1796052433896; Mon, 30 Nov 2026 07:27:13 -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.12 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 30 Nov 2026 07:27:13 -0800 (PST) From: Richard Purdie To: openembedded-core@lists.openembedded.org Subject: [PATCH 07/16] documentation.conf: Update layer variables for new layer handling Date: Mon, 30 Nov 2026 15:26:55 +0000 Message-ID: <20261130152704.3471590-7-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/251616 Remove the obsolete BBFILE_COLLECTIONS, BBFILE_PATTERN and BBFILE_PRIORITY entries, note BBPATH and BBFILES are now constructed by bitbake, drop the layer suffix references and document LAYERNAME, LAYERRECOMMENDS and LAYERSERIES_COMPAT. AI-Generated: Uses Claude Opus 5.5 Signed-off-by: Richard Purdie --- meta/conf/documentation.conf | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/meta/conf/documentation.conf b/meta/conf/documentation.conf index 2a3c7f80a23..5952f26c726 100644 --- a/meta/conf/documentation.conf +++ b/meta/conf/documentation.conf @@ -80,15 +80,12 @@ BB_DISKMON_WARNINTERVAL[doc] = "Defines the disk space and free inode warning in BB_GENERATE_MIRROR_TARBALLS[doc] = "Causes tarballs of the Git repositories to be placed in the DL_DIR directory." BB_NUMBER_THREADS[doc] = "The maximum number of tasks BitBake should run in parallel at any one time. A good rule of thumb is to set this variable to twice the number of cores." BBCLASSEXTEND[doc] = "Allows you to extend a recipe so that it builds variants of the software. Common variants for recipes are 'native', 'cross', 'nativesdk' and multilibs." -BBFILE_COLLECTIONS[doc] = "Lists the names of configured layers. These names are used to find the other BBFILE_* variables." -BBFILE_PATTERN[doc] = "Variable that expands to match files from BBFILES in a particular layer. This variable is used in the layer.conf file and must be suffixed with the name of a layer." -BBFILE_PRIORITY[doc] = "Assigns the priority for recipe files in each layer. Setting this variable allows you to prioritize a layer against other layers that contain the same recipe." -BBFILES[doc] = "List of recipe files used by BitBake to build software." +BBFILES[doc] = "List of recipe files used by BitBake to build software. This is constructed automatically by BitBake from the recipes* directories of the configured layers and should not be set in layer.conf." BBINCLUDELOGS[doc] = "Variable that controls how BitBake displays logs on build failure." BBINCLUDELOGS_LINES[doc] = "Amount of log lines printed on failure." BBLAYERS[doc] = "Lists the layers to enable during the build. This variable is defined in the bblayers.conf configuration file." BBMASK[doc] = "Prevents BitBake from processing specific recipes or recipe append files." -BBPATH[doc] = "Used by BitBake to locate .bbclass and configuration files. This variable is analogous to the PATH variable." +BBPATH[doc] = "Used by BitBake to locate .bbclass and configuration files. This variable is analogous to the PATH variable. It is constructed automatically by BitBake from the configured layers, ordered by their dependencies, and should not be set in layer.conf." BBSERVER[doc] = "Points to the server that runs memory-resident BitBake." BINCONFIG_GLOB[doc] = "When inheriting binconfig.bbclass from a recipe, this variable specifies a wildcard for configuration scripts that need editing." BP[doc] = "The base recipe name and version but without any special recipe name suffix (i.e. -native, lib64-, and so forth). BP is comprised of ${BPN}-${PV}" @@ -250,9 +247,12 @@ KTYPE[doc] = "Defines the kernel type to be used in assembling the configuration #L -LAYERDEPENDS[doc] = "Lists the layers, separated by spaces, upon which this recipe depends. This variable is used in the conf/layer.conf file and must be suffixed with the name of the specific layer." -LAYERDIR[doc] = "When used inside the layer.conf configuration file, this variable provides the path of the current layer." -LAYERVERSION[doc] = "Optionally specifies the version of a layer as a single number. This variable is used in the conf/layer.conf file and must be suffixed with the name of the specific layer." +LAYERDEPENDS[doc] = "Lists the layers (by LAYERNAME), separated by spaces, upon which this layer depends, optionally with version constraints. This variable is used in the conf/layer.conf file. Layers are placed before the layers they depend upon in BBPATH and after them in BBFILES." +LAYERDIR[doc] = "When used inside the layer.conf configuration file, this variable provides the path of the current layer. The path of each configured layer is also available globally as LAYERDIR_." +LAYERNAME[doc] = "The name of the layer, which must be set in the conf/layer.conf file and be unique amongst the configured layers. Other layers refer to the layer by this name, for example in LAYERDEPENDS." +LAYERRECOMMENDS[doc] = "Lists the layers (by LAYERNAME), separated by spaces, which this layer recommends, optionally with version constraints. This variable is used in the conf/layer.conf file." +LAYERSERIES_COMPAT[doc] = "Lists the OpenEmbedded-Core release series names the layer is compatible with. This variable is used in the conf/layer.conf file." +LAYERVERSION[doc] = "Optionally specifies the version of a layer as a single number, used to check version constraints in LAYERDEPENDS. This variable is used in the conf/layer.conf file." LEAD_SONAME[doc] = "Specifies the lead (or primary) compiled library file (.so) that the debian class applies its naming policy to given a recipe that packages multiple libraries." LIC_FILES_CHKSUM[doc] = "Checksums of the license text in the recipe source code." LICENSE[doc] = "The source license for the recipe as a SPDX License expression" From patchwork Mon Nov 30 15:26:56 2026 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Purdie X-Patchwork-Id: 106500 Received: from mail-wm1-f48.google.com (mail-wm1-f48.google.com [209.85.128.48]) by mx.groups.io with SMTP id smtpd.msgproc02-g2.34830.1796052437208882459 for ; Mon, 30 Nov 2026 07:27:17 -0800 Authentication-Results: mx.groups.io; dkim=pass header.i=@linuxfoundation.org header.s=google header.b=hs0hrAsL; spf=pass (domain: linuxfoundation.org, ip: 209.85.128.48, mailfrom: richard.purdie@linuxfoundation.org) Received: by mail-wm1-f48.google.com with SMTP id 5b1f17b1804b1-4a5177d78c7so109365785e9.2 for ; Mon, 30 Nov 2026 07:27:16 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linuxfoundation.org; s=google; t=1796052435; x=1796657235; 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=wJ7SALwaSliBuVP02VQdUUfh1Ak+uQDk8342URFVl7A=; b=hs0hrAsLngU89J+N3x4pUjGnhZDT5r8chPewH0uOR9Sq0zxRrnoSM6VKzhrERwQQCO r8tOiymgYuQdC3rE9qGR9AYe472qey4yBug8+IctuuU+iNynn7T/zSzOWn61jb8FxHJ6 5lwwXLgS0KH8Ez1WvXGnZGjeeyzGPNX5Ozatg= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20260707; t=1796052435; x=1796657235; 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=wJ7SALwaSliBuVP02VQdUUfh1Ak+uQDk8342URFVl7A=; b=QQsYo0RtyQ/GhOZnlU0L1JHEG8yeFqs7N8z7vFC/UUf1E2EP+ivNWGYgVc1vtzdH/I foc09DUQuhZymURsi8gPAKtBx3nKFEnr9G3zui0C17kRsnonE63hCtwmRKf1MKIwMj73 57+VY8m1Jf//hCPVOCrN2MlTnjneAmoFlT6mwNFIDT2ZMfiBElFDG0nBc3t7OGjzSyOR BkUO7kUyWO4Xf93JXG5TqUCFUV05IUdIj0MlwOzXXbm2KJUUMSKrzA/ei74iqG+eGvu+ 8+fDU4tFj84N5xExbTuU1GdgFGCdOvClpGsecYsNR+qEGHsKbgQVz1+8cJY/njiCZ+AE fEKA== X-Gm-Message-State: APuU4Z/0CPEUW7cy/w+fHtRuR7ro4bADdwz9puh60N8WZV9EotC7zOcm NKo8G/1WXJMtOM8pD5e6XNrU8Z/QKWvXaDMt824CQpQKiTH01MkA5HcWIbwqhPJ6AnQT9cuMC8i rgJSR7lU= X-Gm-Gg: AZFdTZf0vRg9HJo8D0yRUHPaJjv74njeUndcQSbele5S/vcWUouU/N6BM/TX8jdM4BL 9lc8cjscN43eMfEs4I2xHrdCbM9hBACJkn+trD6siQj6Bvc+OoZV28ScemCLiRDFeFifP/ytlnm iSCKV5sLM+1T3Tl5MFyzhYUrjAJx6JjRx8MJvoxDHblXsy57k2HxxwNMrSmqKbU8nQtvN4efsIh tmg4/E9/p7p+Xl0l24Xwne/6eGCY2LLJOgw3kAZe2U/E9IhNCO5gqpLG1q2rfJPwGhwMwh3o3/O PZnsph72gpmVxrmFbIBdHkjIuVXoVt6o715UDDz/riTZE17ewwDPvkehNG6y/lxRKbGyqeD0H1x WnJOLdMneafJuRV/S86mBNhS/UIzlWTjTBvmKuVg9E1eoV0/uSSt5ekGdJMBFDdBArKxIlzxbmB +Oz2UmlHkJIrHRqHqhVOweDO00fctBO25pwxsvAHT8+yCYVbaXc5D4d0vJCwoEixGAOC33uq31o JjTKsvYm871tJLAG4YgHAuqrMQfP8fOYepLN0RWt2IYSqc6x5stnAx5/P1inL8x2U/jD9JqFw1x rEHYm9nXbOB1nA5p9ZdLAZkIhpiRCIGGD8Z9MDArOZH0+MMlYmTle+7yrdOeeALulnlm59t1pe7 uRFs= X-Received: by 2002:a05:600c:c173:b0:4a1:813f:2a60 with SMTP id 5b1f17b1804b1-4bb88800134mr660295785e9.11.1796052435392; Mon, 30 Nov 2026 07:27:15 -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.14 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 30 Nov 2026 07:27:14 -0800 (PST) From: Richard Purdie To: openembedded-core@lists.openembedded.org Subject: [PATCH 08/16] configfragments: Switch to use layerdata Date: Mon, 30 Nov 2026 15:26:56 +0000 Message-ID: <20261130152704.3471590-8-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/251617 Update the config fragment code to use the new layerdata structure after the bitbake layer changes. Signed-off-by: Richard Purdie --- meta/lib/bbconfigbuild/configfragments.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/meta/lib/bbconfigbuild/configfragments.py b/meta/lib/bbconfigbuild/configfragments.py index ccc1d8b6106..46fe3588d64 100644 --- a/meta/lib/bbconfigbuild/configfragments.py +++ b/meta/lib/bbconfigbuild/configfragments.py @@ -37,9 +37,10 @@ class ConfigFragmentsPlugin(LayerPlugin): def discover_fragments(self): fragments_path_prefix = self.tinfoil.config_data.getVar('OE_FRAGMENTS_PREFIX') + layerdata = self.tinfoil.config_data.getVar("layerdata", expand=False) allfragments = {} - for layername in self.bbfile_collections: - layerdir = self.bbfile_collections[layername] + for layername in layerdata: + layerdir = layerdata[layername].path fragments = [] for topdir, dirs, files in os.walk(os.path.join(layerdir, fragments_path_prefix)): fragmentdir = os.path.relpath(topdir, os.path.join(layerdir, fragments_path_prefix)) From patchwork Mon Nov 30 15:26:57 2026 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Purdie X-Patchwork-Id: 106504 Received: from mail-wm1-f53.google.com (mail-wm1-f53.google.com [209.85.128.53]) by mx.groups.io with SMTP id smtpd.msgproc01-g2.34557.1796052439894838154 for ; Mon, 30 Nov 2026 07:27:20 -0800 Authentication-Results: mx.groups.io; dkim=pass header.i=@linuxfoundation.org header.s=google header.b=NDAIH/9y; spf=pass (domain: linuxfoundation.org, ip: 209.85.128.53, mailfrom: richard.purdie@linuxfoundation.org) Received: by mail-wm1-f53.google.com with SMTP id 5b1f17b1804b1-4bb70074ab2so112505425e9.0 for ; Mon, 30 Nov 2026 07:27:19 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linuxfoundation.org; s=google; t=1796052438; x=1796657238; 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=KVWCEWDpW5+HLIlK0fwACVihseGUmj5qvEZi/MyojTA=; b=NDAIH/9yms57Mn8syfAuwjxozzxBYGG5Unm6yB9oMiorR5f6tyxI+ozcI1TwB4y8GT qOI13qNbBNVr4N3z+8dC3/ykEZYh6/zZQFeAAokliVmHKvszeEwNSMiCJ5RjorqQqE7G bUyOkUY6hmBO2zmulk3m0cMzd5W+7C0MRGOSI= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20260707; t=1796052438; x=1796657238; 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=KVWCEWDpW5+HLIlK0fwACVihseGUmj5qvEZi/MyojTA=; b=1WivlBk3J4cZk6ZzkBT/uezmtwnGWQhfUVfKRn+KcpCOuYVy6PEKri+ZS63DvqV0CR Yfs6cq5ompyRonLXS6wqjUqwD7MQgG8/9PBulQ01nMqXwg5D0JiSqk8x/t/9L90bxvh0 Jf5lDdPVDDmuRdbJS6wQ3YDlB4lpq32dlRjT6cmq3LcMy1iJKQipXvbEEtmSzESXpvjK qsXgkA0dK5vwYfyGH2tcV0/12yDYxQyCJ+BxFRLOHdZnYCQflAkqydN0xUxCcCxYnp/N hmxrtsN0mHXx4YbUKWt6Bzv83I0nIvSGnQE4djNjaY+T/FKEanBSOn3bM1CipmVFYIei lTeA== X-Gm-Message-State: APuU4Z+xruK/F1JpO8mNBIkbt1bmBqz0nnAGzv9sYty8Tuehx419fhyT k1r3ioYZ+E93O1LN4Cj9pc16iXwdOgBesHngWLVIjclWQXfnmamVD9h+3emLgpIPt17Jhsn882C fc44em2A= X-Gm-Gg: AZFdTZdHPZDfsin4yG43jlq/swsEGxVQxet4eVS9m1UPz5gefeoOu751bZJr1Ec8nuB 8igcDN0NGiDR8aDeu8PGIPJ0urIGEubdpv9l29jDTKIbiFlQSDLdX+pm1OrJ0Jnn2rxnKFEd2G4 o0UqHonBiX4k2gH152+c4MaLkpudG4Wcb6PoaBLKqx5IgsSKdnh3Zy2NT8+2Y1jJLJLaqGd8ErM c83FvUCRQrfuvdzgDGfPKHYZs9z8bQhVCcJP2eEYDwRhO3Gbndmn07UCUfY9UTEcge65f8CvDRb 2bbma4IlP02IGALUipBIIYnkpRnAjoZorzy+yd7nXL8oCtQ3f0T7410CteEnll9fw2o5iCCEAM0 A3oZpJPsaD8AZmUnfKhho1COCj0Uy5MhX2yhOWqx79NzZD5NHZ/HuxuLZLDMcN9qx9bdA64vGJp 6z5l6fqmSzyrLugrBUBne8LfkU51+y4H8sDNBntc69UujiU2X6xThCZu+k7x91x9UfE9eLUBRth 0pakSJlewPHQd2mu0meNxwLzS6+cSBhSKykfpqpsWhfawcHedOrXSjIe669ahfxUkm4B5wq39On 26k5itR6DWevEUw1N2LeVmpIsLuV2D+K0PdfmTxi+99kOrZN/eq7kHDAew== X-Received: by 2002:a05:600c:4e0d:b0:4bb:5f07:10d7 with SMTP id 5b1f17b1804b1-4bb8882445cmr632828015e9.26.1796052437686; Mon, 30 Nov 2026 07:27:17 -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.15 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 30 Nov 2026 07:27:15 -0800 (PST) From: Richard Purdie To: openembedded-core@lists.openembedded.org Subject: [PATCH 09/16] devtool: Update to match layer.conf changes from bitbake Date: Mon, 30 Nov 2026 15:26:57 +0000 Message-ID: <20261130152704.3471590-9-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:21 -0000 X-Groupsio-URL: https://lists.openembedded.org/g/openembedded-core/message/251618 This updates devtool's workspace handling to: - Set a LAYERNAME (workspace) - Use the new core name for LAYERDEPENDS - Stop adding BBFILES, BBPATH and BBFILE variables - Store appends in /recipes-appends/ instead of /appends/ Tests are updated to match the changes. AI-Generated: Uses Claude Opus 5.5 Signed-off-by: Richard Purdie --- meta/lib/oe/copy_buildsystem.py | 7 ++++-- meta/lib/oeqa/selftest/cases/devtool.py | 27 +++++++++++------------ scripts/devtool | 29 +++++++++++++++---------- scripts/lib/devtool/__init__.py | 15 ++++++++++++- scripts/lib/devtool/build_image.py | 6 ++--- scripts/lib/devtool/ide_sdk.py | 14 ++++++------ scripts/lib/devtool/import.py | 10 ++++++--- scripts/lib/devtool/standard.py | 4 ++-- scripts/lib/devtool/upgrade.py | 4 ++-- 9 files changed, 71 insertions(+), 45 deletions(-) mode change 100755 => 100644 scripts/lib/devtool/ide_sdk.py diff --git a/meta/lib/oe/copy_buildsystem.py b/meta/lib/oe/copy_buildsystem.py index 73b868ff2ec..5a0f5f058ba 100644 --- a/meta/lib/oe/copy_buildsystem.py +++ b/meta/lib/oe/copy_buildsystem.py @@ -138,7 +138,7 @@ class BuildSystem(object): # (because of externalsrc, the workspace bbappends will interfere with the # locked signatures if present, and we don't need them anyway) image_bbappend = os.path.splitext(os.path.basename(self.d.getVar('FILE')))[0] + '.bbappend' - appenddir = os.path.join(layerdestpath, 'appends') + appenddir = os.path.join(layerdestpath, 'recipes-appends') if os.path.isdir(appenddir): for fn in os.listdir(appenddir): if fn == image_bbappend: @@ -157,7 +157,10 @@ class BuildSystem(object): for line in origlines: if line.startswith('#'): continue - line = line.replace('workspacelayer', workspace_newname) + # LAYERNAME must be unique, so rename the original workspace layer + if re.match(r'^LAYERNAME\s*=', line): + line = 'LAYERNAME = "%s"\n' % workspace_newname + line = line.replace('_workspace ', '_' + workspace_newname + ' ') f.write(line) # meta-skeleton layer is added as part of the build system diff --git a/meta/lib/oeqa/selftest/cases/devtool.py b/meta/lib/oeqa/selftest/cases/devtool.py index 3400f90a906..89ca79e6358 100644 --- a/meta/lib/oeqa/selftest/cases/devtool.py +++ b/meta/lib/oeqa/selftest/cases/devtool.py @@ -37,8 +37,7 @@ def setUpModule(): bblayers_conf = os.path.join(os.environ['BUILDDIR'], 'conf', 'bblayers.conf') edited_layers = [] # make sure user doesn't have a local workspace - result = runCmd('bitbake-layers show-layers') - assert "workspacelayer" not in result.output, "Devtool test suite cannot be run with a local workspace directory" + assert not get_bb_var('LAYERDIR_workspace'), "Devtool test suite cannot be run with a local workspace directory" # We need to take a copy of the meta layer so we can modify it and not # have any races against other tests that might be running in parallel @@ -795,7 +794,7 @@ class DevtoolModifyTests(DevtoolBase): result = runCmd('devtool modify mdadm -x %s' % tempdir) self.assertExists(os.path.join(tempdir, 'Makefile'), 'Extracted source could not be found') self.assertExists(os.path.join(self.workspacedir, 'conf', 'layer.conf'), 'Workspace directory not created') - matches = glob.glob(os.path.join(self.workspacedir, 'appends', 'mdadm_*.bbappend')) + matches = glob.glob(os.path.join(self.workspacedir, 'recipes-appends', 'mdadm_*.bbappend')) self.assertTrue(matches, 'bbappend not created %s' % result.output) # Test devtool status @@ -857,7 +856,7 @@ class DevtoolModifyTests(DevtoolBase): oe.path.join(self.workspacedir, 'conf', 'layer.conf'), 'Workspace directory not created' ) - matches = glob.glob(oe.path.join(self.workspacedir, 'appends', 'go-helloworld_*.bbappend')) + matches = glob.glob(oe.path.join(self.workspacedir, 'recipes-appends', 'go-helloworld_*.bbappend')) self.assertTrue(matches, 'bbappend not created %s' % result.output) def test_devtool_buildclean(self): @@ -988,7 +987,7 @@ class DevtoolModifyTests(DevtoolBase): result = runCmd('devtool modify %s -x %s' % (testrecipe, tempdir)) srcfile = os.path.join(tempdir, 'share/dot.bashrc') self.assertExists(srcfile, 'Extracted source could not be found') - matches = glob.glob(os.path.join(self.workspacedir, 'appends', '%s_*.bbappend' % testrecipe)) + matches = glob.glob(os.path.join(self.workspacedir, 'recipes-appends', '%s_*.bbappend' % testrecipe)) self.assertTrue(matches, 'bbappend not created') # Test devtool status result = runCmd('devtool status') @@ -1013,7 +1012,7 @@ class DevtoolModifyTests(DevtoolBase): result = runCmd('devtool modify %s -x %s' % (testrecipe, tempdir)) self.assertExists(os.path.join(tempdir, 'Makefile.am'), 'Extracted source could not be found') self.assertExists(os.path.join(self.workspacedir, 'conf', 'layer.conf'), 'Workspace directory not created. devtool output: %s' % result.output) - matches = glob.glob(os.path.join(self.workspacedir, 'appends', 'psplash_*.bbappend')) + matches = glob.glob(os.path.join(self.workspacedir, 'recipes-appends', 'psplash_*.bbappend')) self.assertTrue(matches, 'bbappend not created') # Test devtool status result = runCmd('devtool status') @@ -1039,7 +1038,7 @@ class DevtoolModifyTests(DevtoolBase): self.add_command_to_tearDown('bitbake-layers remove-layer */workspace') result = runCmd('git clone https://git.yoctoproject.org/psplash %s && devtool modify -n %s %s' % (tempdir, testrecipe, tempdir)) self.assertExists(os.path.join(self.workspacedir, 'conf', 'layer.conf'), 'Workspace directory not created. devtool output: %s' % result.output) - matches = glob.glob(os.path.join(self.workspacedir, 'appends', 'psplash_*.bbappend')) + matches = glob.glob(os.path.join(self.workspacedir, 'recipes-appends', 'psplash_*.bbappend')) self.assertTrue(matches, 'bbappend not created') # Test devtool status result = runCmd('devtool status') @@ -1087,7 +1086,7 @@ class DevtoolModifyTests(DevtoolBase): result = runCmd('devtool modify %s -x %s' % (testrecipe, tempdir)) self.assertExists(os.path.join(tempdir, 'Cargo.toml'), 'Extracted source could not be found') self.assertExists(os.path.join(self.workspacedir, 'conf', 'layer.conf'), 'Workspace directory not created. devtool output: %s' % result.output) - matches = glob.glob(os.path.join(self.workspacedir, 'appends', '%s_*.bbappend' % testrecipe)) + matches = glob.glob(os.path.join(self.workspacedir, 'recipes-appends', '%s_*.bbappend' % testrecipe)) self.assertTrue(matches, 'bbappend not created') # Test devtool status result = runCmd('devtool status') @@ -1161,7 +1160,7 @@ class DevtoolModifyTests(DevtoolBase): result = runCmd('devtool modify %s -x %s' % (testrecipe, tempdir)) self.assertExists(os.path.join(tempdir, 'configure.ac'), 'Extracted source could not be found') self.assertExists(os.path.join(self.workspacedir, 'conf', 'layer.conf'), 'Workspace directory not created') - matches = glob.glob(os.path.join(self.workspacedir, 'appends', '%s_*.bbappend' % testrecipe)) + matches = glob.glob(os.path.join(self.workspacedir, 'recipes-appends', '%s_*.bbappend' % testrecipe)) self.assertTrue(matches, 'bbappend not created') # Test devtool status result = runCmd('devtool status') @@ -1248,7 +1247,7 @@ class DevtoolModifyTests(DevtoolBase): result = runCmd('devtool modify %s -x %s' % (virtrecipe, tempdir)) self.assertExists(os.path.join(tempdir, 'Makefile.am'), 'Extracted source could not be found') self.assertExists(os.path.join(self.workspacedir, 'conf', 'layer.conf'), 'Workspace directory not created') - matches = glob.glob(os.path.join(self.workspacedir, 'appends', '%s_*.bbappend' % realrecipe)) + matches = glob.glob(os.path.join(self.workspacedir, 'recipes-appends', '%s_*.bbappend' % realrecipe)) self.assertTrue(matches, 'bbappend not created %s' % result.output) # Test devtool status result = runCmd('devtool status') @@ -3170,7 +3169,7 @@ class DevtoolIdeSdkTests(DevtoolBase): self.assertExists(os.path.join(self.workspacedir, 'conf', 'layer.conf'), 'Workspace directory not created') matches = glob.glob(os.path.join(self.workspacedir, - 'appends', recipe_name + '.bbappend')) + 'recipes-appends', recipe_name + '.bbappend')) self.assertTrue(matches, 'bbappend not created %s' % result.output) # Test devtool status @@ -3540,7 +3539,7 @@ class DevtoolIdeSdkTests(DevtoolBase): def _verify_slirp_bbappend(self, testimage): """Verify update_qb_slirp_opt() wrote the SSH port-forward to the image bbappend.""" - bbappend = os.path.join(self.workspacedir, 'appends', testimage + '.bbappend') + bbappend = os.path.join(self.workspacedir, 'recipes-appends', testimage + '.bbappend') self.assertExists(bbappend, 'Image bbappend not created at %s' % bbappend) with open(bbappend) as f: bbappend_content = f.read() @@ -3608,7 +3607,7 @@ class DevtoolIdeSdkTests(DevtoolBase): self.assertIn('exec runqemu ', helper) self.assertIn(nfs_rootfs, helper) - bbappend = os.path.join(self.workspacedir, 'appends', testimage + '.bbappend') + bbappend = os.path.join(self.workspacedir, 'recipes-appends', testimage + '.bbappend') with open(bbappend) as append_file: self.assertRegex( append_file.read(), @@ -4385,7 +4384,7 @@ class DevtoolIdeSdkKernelTests(DevtoolIdeSdkTests): self.assertExists(os.path.join(self.workspacedir, 'conf', 'layer.conf'), 'Workspace directory not created') matches = glob.glob(os.path.join( - self.workspacedir, 'appends', recipe_name + '.bbappend')) + self.workspacedir, 'recipes-appends', recipe_name + '.bbappend')) self.assertTrue(matches, 'bbappend not created %s' % result.output) # Test devtool status diff --git a/scripts/devtool b/scripts/devtool index 39cebec0d83..208c1240810 100755 --- a/scripts/devtool +++ b/scripts/devtool @@ -24,6 +24,7 @@ scripts_path = os.path.dirname(os.path.realpath(__file__)) lib_path = scripts_path + '/lib' sys.path = sys.path + [lib_path] from devtool import DevtoolError, setup_tinfoil +from devtool import WORKSPACE_LAYERNAME, WORKSPACE_LAYERDEPENDS, get_workspace_appends_dir import scriptutils import argparse_oe logger = scriptutils.logger_create('devtool') @@ -101,7 +102,7 @@ def read_workspace(basepath, context): logger.debug('Reading workspace in %s' % context.config.workspace_path) externalsrc_re = re.compile(r'^EXTERNALSRC(:pn-([^ =]+))? *= *"([^"]*)"$') - for fn in glob.glob(os.path.join(context.config.workspace_path, 'appends', '*.bbappend')): + for fn in glob.glob(os.path.join(get_workspace_appends_dir(context.config.workspace_path), '*.bbappend')): with open(fn, 'r') as f: pnvalues = {} pn = None @@ -162,16 +163,7 @@ def _create_workspace(workspacedir, basepath, layerseries=None): # Add a config file bb.utils.mkdirhier(confdir) - with open(os.path.join(confdir, 'layer.conf'), 'w') as f: - f.write('# ### workspace layer auto-generated by devtool ###\n') - f.write('BBPATH =. "$' + '{LAYERDIR}:"\n') - f.write('BBFILES += "$' + '{LAYERDIR}/recipes/*/*.bb \\\n') - f.write(' $' + '{LAYERDIR}/appends/*.bbappend"\n') - f.write('BBFILE_COLLECTIONS += "workspacelayer"\n') - f.write('BBFILE_PATTERN_workspacelayer = "^$' + '{LAYERDIR}/"\n') - f.write('BBFILE_PATTERN_IGNORE_EMPTY_workspacelayer = "1"\n') - f.write('BBFILE_PRIORITY_workspacelayer = "99"\n') - f.write('LAYERSERIES_COMPAT_workspacelayer = "%s"\n' % layerseries) + _write_workspace_layerconf(os.path.join(confdir, 'layer.conf'), layerseries) # Add a README file with open(os.path.join(workspacedir, 'README'), 'w') as f: f.write('This layer was created by the OpenEmbedded devtool utility in order to\n') @@ -190,6 +182,21 @@ def _create_workspace(workspacedir, basepath, layerseries=None): f.write('layer. If you prefer it to be elsewhere you can specify the source\n') f.write('tree path on the command line.\n') +WORKSPACE_LAYERCONF_HEADER = '# ### workspace layer auto-generated by devtool ###' + +def _write_workspace_layerconf(layerconf, layerseries, extralines=None): + # BBPATH and BBFILES are constructed automatically by bitbake from the + # layer's location and its recipes* subdirectories, so only the layer + # metadata needs to be set here. + with open(layerconf, 'w') as f: + f.write(WORKSPACE_LAYERCONF_HEADER + '\n') + f.write('LAYERNAME = "%s"\n' % WORKSPACE_LAYERNAME) + f.write('LAYERDEPENDS = "%s"\n' % WORKSPACE_LAYERDEPENDS) + f.write('LAYERSERIES_COMPAT = "%s"\n' % layerseries) + for line in extralines or []: + f.write(line) + + def _enable_workspace_layer(workspacedir, config, basepath): """Ensure the workspace layer is in bblayers.conf""" import bb.utils diff --git a/scripts/lib/devtool/__init__.py b/scripts/lib/devtool/__init__.py index 8e016cfb214..ff32cf115f8 100644 --- a/scripts/lib/devtool/__init__.py +++ b/scripts/lib/devtool/__init__.py @@ -17,6 +17,19 @@ import codecs logger = logging.getLogger('devtool') +# LAYERNAME used for the auto-generated workspace layer +WORKSPACE_LAYERNAME = 'workspace' +# Layer(s) the workspace layer depends upon (LAYERDEPENDS) +WORKSPACE_LAYERDEPENDS = 'oe-core' +# Subdirectory of the workspace layer holding bbappends. Bitbake constructs +# BBFILES automatically from a layer's recipes* directories, so this needs +# to match that pattern. +WORKSPACE_APPENDS_DIR = 'recipes-appends' + +def get_workspace_appends_dir(workspace_path): + """Return the directory within the workspace layer holding bbappends""" + return os.path.join(workspace_path, WORKSPACE_APPENDS_DIR) + class DevtoolError(Exception): """Exception for handling devtool errors""" def __init__(self, message, exitcode=1): @@ -286,7 +299,7 @@ def recipe_to_append(recipefile, config, wildcard=False): appendname = os.path.splitext(os.path.basename(recipefile))[0] if wildcard: appendname = re.sub(r'_.*', '_%', appendname) - appendpath = os.path.join(config.workspace_path, 'appends') + appendpath = get_workspace_appends_dir(config.workspace_path) appendfile = os.path.join(appendpath, appendname + '.bbappend') return appendfile diff --git a/scripts/lib/devtool/build_image.py b/scripts/lib/devtool/build_image.py index 980f90ddd63..6ff221cae99 100644 --- a/scripts/lib/devtool/build_image.py +++ b/scripts/lib/devtool/build_image.py @@ -12,7 +12,7 @@ import errno import logging from bb.process import ExecutionError -from devtool import exec_build_env_command, setup_tinfoil, parse_recipe, DevtoolError +from devtool import exec_build_env_command, setup_tinfoil, parse_recipe, DevtoolError, get_workspace_appends_dir logger = logging.getLogger('devtool') @@ -67,7 +67,7 @@ def build_image_task(config, basepath, workspace, image, add_packages=None, task # break because of it target_basename = config.get('SDK', 'target_basename', '') if target_basename: - appendfile = os.path.join(config.workspace_path, 'appends', + appendfile = os.path.join(get_workspace_appends_dir(config.workspace_path), '%s.bbappend' % target_basename) try: os.unlink(appendfile) @@ -90,7 +90,7 @@ def build_image_task(config, basepath, workspace, image, add_packages=None, task config.set('SDK', 'target_basename', target_basename) config.write() - appendfile = os.path.join(config.workspace_path, 'appends', + appendfile = os.path.join(get_workspace_appends_dir(config.workspace_path), '%s.bbappend' % target_basename) outputdir = None diff --git a/scripts/lib/devtool/ide_sdk.py b/scripts/lib/devtool/ide_sdk.py old mode 100755 new mode 100644 index 5dc5199c24b..ba9bc18d22c --- a/scripts/lib/devtool/ide_sdk.py +++ b/scripts/lib/devtool/ide_sdk.py @@ -22,7 +22,7 @@ from pathlib import Path import scriptutils import bb -from devtool import exec_build_env_command, setup_tinfoil, check_workspace_recipe, DevtoolError, parse_recipe +from devtool import exec_build_env_command, setup_tinfoil, check_workspace_recipe, DevtoolError, parse_recipe, get_workspace_appends_dir from devtool.standard import get_real_srctree from devtool.deploy import parse_packages_arg from devtool.ide_plugins import BuildTool, DebuggerCrossConfig, LOOPBACK_HOSTS, is_loopback_target @@ -243,7 +243,7 @@ class RecipeImage: that have a bbappend, to be passed on to the RecipeImage constructor. """ originals = {} - appends_dir = os.path.join(config.workspace_path, 'appends') + appends_dir = get_workspace_appends_dir(config.workspace_path) for name in recipe_names: bbappend = os.path.join(appends_dir, name + '.bbappend') if not os.path.exists(bbappend): @@ -259,7 +259,7 @@ class RecipeImage: return originals def initialize(self, config, tinfoil, nfs=None): - appends_dir = os.path.join(config.workspace_path, 'appends') + appends_dir = get_workspace_appends_dir(config.workspace_path) self._bbappend = os.path.join(appends_dir, self.name + '.bbappend') # strip_bbappend_sections() ran before the tinfoil session started, so @@ -897,7 +897,7 @@ class RecipeModified: original recipe content and only non standard flags can be bbappended later. """ originals = {} - appends_dir = os.path.join(config.workspace_path, 'appends') + appends_dir = get_workspace_appends_dir(config.workspace_path) for name in recipe_names: bbappend = os.path.join(appends_dir, name + '.bbappend') if not os.path.exists(bbappend): @@ -1795,7 +1795,7 @@ def ide_setup(args, config, basepath, workspace): invalid_params = True if DevtoolIdeMode.modified in modes: if not recipes_modified_names: - appends_dir = os.path.join(config.workspace_path, 'appends') + appends_dir = get_workspace_appends_dir(config.workspace_path) recipes_modified_names = sorted( bb.parse.vars_from_file(path, None)[0] for path in glob.glob(os.path.join(appends_dir, '*.bbappend')) @@ -1815,7 +1815,7 @@ def ide_setup(args, config, basepath, workspace): if not recipes_modified_names: logger.error( "At least one modified recipe is required or must be guessable from %s." % - os.path.join(config.workspace_path, 'appends')) + get_workspace_appends_dir(config.workspace_path)) invalid_params = True for modified_recipe_name in recipes_modified_names: if modified_recipe_name.startswith('nativesdk-') or modified_recipe_name.endswith('-native'): @@ -2066,7 +2066,7 @@ def register_commands(subparsers, context): 'recipenames', nargs='+', help='Generate an IDE configuration suitable to work on the given recipes.\n' 'Depending on the --mode parameter different types of SDKs and IDE configurations are generated.\n' 'In modified mode at least the image recipe is required; if no modified recipe is passed, ' - 'all modified recipes are taken from /appends/*.bbappend.') + 'all modified recipes are taken from /recipes-appends/*.bbappend.') parser_ide_sdk.add_argument( '-m', '--mode', type=DevtoolIdeMode, action='append', help='Different SDK types are supported. Repeat --mode to generate both:\n' diff --git a/scripts/lib/devtool/import.py b/scripts/lib/devtool/import.py index 6829851669a..7e944fb223f 100644 --- a/scripts/lib/devtool/import.py +++ b/scripts/lib/devtool/import.py @@ -14,6 +14,7 @@ import json import fnmatch from devtool import standard, setup_tinfoil, replace_from_file, DevtoolError +from devtool import WORKSPACE_APPENDS_DIR from devtool import export logger = logging.getLogger('devtool') @@ -45,12 +46,15 @@ def devimport(args, config, basepath, workspace): members = tar.getmembers() + def is_append(name): + return name == WORKSPACE_APPENDS_DIR or name.startswith(WORKSPACE_APPENDS_DIR + '/') + # Get appends and recipes from the exported archive, these # will be needed to find out those appends without corresponding # recipe pair append_fns, recipe_fns = set(), set() for member in members: - if member.name.startswith('appends'): + if is_append(member.name): append_fns.add(get_pn(member.name)) elif member.name.startswith('recipes'): recipe_fns.add(get_pn(member.name)) @@ -82,7 +86,7 @@ def devimport(args, config, basepath, workspace): for nonimp in non_importables: pn = nonimp.split('_')[0] # do not extract data from non-importable recipes or metadata - if member.name.startswith('appends/%s' % nonimp) or \ + if member.name.startswith('%s/%s' % (WORKSPACE_APPENDS_DIR, nonimp)) or \ member.name.startswith('recipes/%s' % nonimp) or \ member.name.startswith('sources/%s' % pn): break @@ -102,7 +106,7 @@ def devimport(args, config, basepath, workspace): tar.extract(member, path=config.workspace_path) # Update EXTERNALSRC and the devtool md5 file - if member.name.startswith('appends'): + if is_append(member.name): if export_workspace_path: # appends created by 'devtool modify' just need to update the workspace replace_from_file(path, export_workspace_path, config.workspace_path) diff --git a/scripts/lib/devtool/standard.py b/scripts/lib/devtool/standard.py index 0d933e68b12..37ee404c176 100644 --- a/scripts/lib/devtool/standard.py +++ b/scripts/lib/devtool/standard.py @@ -21,7 +21,7 @@ import glob from collections import OrderedDict from devtool import exec_build_env_command, setup_tinfoil, check_workspace_recipe, use_external_build, setup_git_repo, recipe_to_append, get_bbclassextend_targets, update_unlockedsigs, check_prerelease_version, check_git_repo_dirty, check_git_repo_op, DevtoolError -from devtool import parse_recipe +from devtool import parse_recipe, get_workspace_appends_dir import bb.utils @@ -2042,7 +2042,7 @@ def _reset(recipes, no_clean, remove_work, config, basepath, workspace): # This should always be true if recipefile is set, but just in case preservedir(os.path.dirname(recipefile)) # We don't automatically create this dir next to appends, but the user can - preservedir(os.path.join(config.workspace_path, 'appends', pn)) + preservedir(os.path.join(get_workspace_appends_dir(config.workspace_path), pn)) srctreebase = workspace[pn]['srctreebase'] if os.path.isdir(srctreebase): diff --git a/scripts/lib/devtool/upgrade.py b/scripts/lib/devtool/upgrade.py index 46fb1be5d53..1923b5a7b6b 100644 --- a/scripts/lib/devtool/upgrade.py +++ b/scripts/lib/devtool/upgrade.py @@ -26,7 +26,7 @@ sys.path = sys.path + [devtool_path] import oe.recipeutils from devtool import standard -from devtool import exec_build_env_command, setup_tinfoil, DevtoolError, parse_recipe, use_external_build, update_unlockedsigs, check_prerelease_version +from devtool import exec_build_env_command, setup_tinfoil, DevtoolError, parse_recipe, use_external_build, update_unlockedsigs, check_prerelease_version, get_workspace_appends_dir logger = logging.getLogger('devtool') @@ -138,7 +138,7 @@ def _write_append(rc, srctreebase, srctree, same_dir, no_same_dir, revs, copied, if not os.path.exists(rc): raise DevtoolError("bbappend not created because %s does not exist" % rc) - appendpath = os.path.join(workspace, 'appends') + appendpath = get_workspace_appends_dir(workspace) if not os.path.exists(appendpath): bb.utils.mkdirhier(appendpath) From patchwork Mon Nov 30 15:26:58 2026 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Purdie X-Patchwork-Id: 106506 Received: from mail-wr1-f50.google.com (mail-wr1-f50.google.com [209.85.221.50]) by mx.groups.io with SMTP id smtpd.msgproc02-g2.34833.1796052441957860356 for ; Mon, 30 Nov 2026 07:27:22 -0800 Authentication-Results: mx.groups.io; dkim=pass header.i=@linuxfoundation.org header.s=google header.b=NFR0JLmr; spf=pass (domain: linuxfoundation.org, ip: 209.85.221.50, mailfrom: richard.purdie@linuxfoundation.org) Received: by mail-wr1-f50.google.com with SMTP id ffacd0b85a97d-4a358881793so5636734f8f.0 for ; Mon, 30 Nov 2026 07:27:21 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linuxfoundation.org; s=google; t=1796052440; x=1796657240; 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=77aSGDCYMJ8gDjEWKIehVmCQLGsZjZqYPnnacbYzGPo=; b=NFR0JLmrFbg5u+AUWKfTsN0WOIDs4q0SbPNJkp0tkrLyi2eMtjB5woRAGGzkPg18o5 oRAxiR7MA313u5wQIeygAgtwaW7+M2QmH4ZeaOP5/KxggqlJNJZtdnCdyneLMwfyjIBW PChULSVfI++6NbcAL/xRrO1RFXyorm+xZjttg= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20260707; t=1796052440; x=1796657240; 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=77aSGDCYMJ8gDjEWKIehVmCQLGsZjZqYPnnacbYzGPo=; b=cOshPzTFYk1hVcPCs4d5AeeLjBtMZ2sLCfAqZQCBS0IC413vfEuevdxfNNrcIWxvzo tT1onvHpdw31zclBGf8ttmb9UJc5przo0OJ09roQRZlb+3ZaBxtrABAFO5RmosDKCorB 0Ps3WvPIiBSksLscDo8Ly1XKs7/w1D+cGBGCecz1GOv+iTBbi19P6VxRrIX2yAsPVAyo qXbFDzpe4Czx9D/gV9cLE1U736QVc4ry9MJ0vR57n5hSdKZV34D/7duVYuRIWsBq6Sl+ YXFik6CAERzgttzIOZlxhiuYPFXFxA+jgTSnqv/Rwqg9rmEeqttYJM9531dOAk776r9+ nxAg== X-Gm-Message-State: APuU4Z+nzSa2vmZTe7ztxj5RCzkGxwpsJYA1LzkpR2qTzGCJUYsb0Y+9 G3eF1t0WmFVRW+JqXeBUMIST/XoJ60QBW3G+zV9pL4SE9N8GZ6XhbUkMbsJ8SfKzgc2TXUxDmSC khnQocxY= X-Gm-Gg: AZFdTZcLVp7zr551JxKK7imgTngxvjnDDUQda+nZdbTVluEv56WfrQ7BXSlc1VQgY7W 1Q+V0doYb35tUNgAwhzoVqilJustVroWsGw9OsXDkaFlgoD9nUUq/lvJb/FzPOMne//rvE8J0qR j3SNXObvqRp6Q2ffAmYG5+aUCu6uwXNsnUARMreanhJBkchD68tH5KXcJEfk8fPohCYpKy5LFvz kbX6X0Hbv60OIGzRVjN9d1YMimnq4d7NUC4DXkdtWGMPz8pDwPN8rUkabyuptYPCcs9DgxzJjnK fboLVISAoPYg8RmEWGgkSVuZN18K7xRY/Fx2n3m1hgMxcPNSJO/iGll4RIhXQOKJz27k5hHI/1f 71XFxiaok/hDLBCaHCO9vZJG+Wa+FTFGGTJdSsxRTHl4nKhqfD0/3dvGqw8J8RsJ7/AP41+iBui 2Q44bBDby3TtXgvVcrNO9qrlEX24qY9l6zOpzp3wznAHwiZ6d7C58wWh0A2jXGwh/fVDDVxuFnj JkiUG8AvzCFEOFhhxovJww+8PBcR9/EKMDBDFs8fqHfoMVrVZUYnz4KLTspF8mxbyzPzRvY8O9r p7vz4EKJ6qFEJC/S09gt/55l6hWpaj2ybA094EzfXjX0UQHz97Z4mT29rZU= X-Received: by 2002:a05:600c:e549:10b0:4bb:a60a:fc8 with SMTP id 5b1f17b1804b1-4bba60a11d2mr230274375e9.35.1796052439991; Mon, 30 Nov 2026 07:27:19 -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.17 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 30 Nov 2026 07:27:18 -0800 (PST) From: Richard Purdie To: openembedded-core@lists.openembedded.org Subject: [PATCH 10/16] devtool: Prefer workspace recipes now layer priorities are gone Date: Mon, 30 Nov 2026 15:26:58 +0000 Message-ID: <20261130152704.3471590-10-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:30 -0000 X-Groupsio-URL: https://lists.openembedded.org/g/openembedded-core/message/251619 The workspace layer's priority of 99 used to ensure recipes from devtool add and devtool upgrade were used over any other recipe with the same name. Without priorities an equal or higher version elsewhere now wins, for example devtool add of i2c-tools 3.1.2 picked up OE-Core's 4.4 in test_devtool_rename. Set DEFAULT_PREFERENCE in the bbappend devtool writes for these recipes, which only applies to the workspace's version of the recipe and is removed by devtool finish/reset. Tested that a lower version workspace recipe is now selected. AI-Generated: Uses Claude Opus 5.5 Signed-off-by: Richard Purdie --- scripts/lib/devtool/__init__.py | 6 ++++++ scripts/lib/devtool/standard.py | 3 ++- scripts/lib/devtool/upgrade.py | 3 ++- 3 files changed, 10 insertions(+), 2 deletions(-) diff --git a/scripts/lib/devtool/__init__.py b/scripts/lib/devtool/__init__.py index ff32cf115f8..5a9ac5cd005 100644 --- a/scripts/lib/devtool/__init__.py +++ b/scripts/lib/devtool/__init__.py @@ -26,6 +26,12 @@ WORKSPACE_LAYERDEPENDS = 'oe-core' # to match that pattern. WORKSPACE_APPENDS_DIR = 'recipes-appends' +# Written to the bbappend for recipes which live in the workspace (from +# 'devtool add' and 'devtool upgrade'). Layers no longer have priorities so +# without this a recipe elsewhere with the same name and an equal or higher +# version would be used instead. +WORKSPACE_PREFERENCE_LINES = 'DEFAULT_PREFERENCE = "99"\n' + def get_workspace_appends_dir(workspace_path): """Return the directory within the workspace layer holding bbappends""" return os.path.join(workspace_path, WORKSPACE_APPENDS_DIR) diff --git a/scripts/lib/devtool/standard.py b/scripts/lib/devtool/standard.py index 37ee404c176..ca90e8089ea 100644 --- a/scripts/lib/devtool/standard.py +++ b/scripts/lib/devtool/standard.py @@ -21,7 +21,7 @@ import glob from collections import OrderedDict from devtool import exec_build_env_command, setup_tinfoil, check_workspace_recipe, use_external_build, setup_git_repo, recipe_to_append, get_bbclassextend_targets, update_unlockedsigs, check_prerelease_version, check_git_repo_dirty, check_git_repo_op, DevtoolError -from devtool import parse_recipe, get_workspace_appends_dir +from devtool import parse_recipe, get_workspace_appends_dir, WORKSPACE_PREFERENCE_LINES import bb.utils @@ -255,6 +255,7 @@ def add(args, config, basepath, workspace): with open(appendfile, 'w') as f: f.write('inherit externalsrc\n') f.write('EXTERNALSRC = "%s"\n' % srctree) + f.write(WORKSPACE_PREFERENCE_LINES) b_is_s = use_external_build(args.same_dir, args.no_same_dir, rd) if b_is_s: diff --git a/scripts/lib/devtool/upgrade.py b/scripts/lib/devtool/upgrade.py index 1923b5a7b6b..3b5db4f2bf0 100644 --- a/scripts/lib/devtool/upgrade.py +++ b/scripts/lib/devtool/upgrade.py @@ -26,7 +26,7 @@ sys.path = sys.path + [devtool_path] import oe.recipeutils from devtool import standard -from devtool import exec_build_env_command, setup_tinfoil, DevtoolError, parse_recipe, use_external_build, update_unlockedsigs, check_prerelease_version, get_workspace_appends_dir +from devtool import exec_build_env_command, setup_tinfoil, DevtoolError, parse_recipe, use_external_build, update_unlockedsigs, check_prerelease_version, get_workspace_appends_dir, WORKSPACE_PREFERENCE_LINES logger = logging.getLogger('devtool') @@ -158,6 +158,7 @@ def _write_append(rc, srctreebase, srctree, same_dir, no_same_dir, revs, copied, f.write(('# NOTE: We use pn- overrides here to avoid affecting' 'multiple variants in the case where the recipe uses BBCLASSEXTEND\n')) f.write('EXTERNALSRC:pn-%s = "%s"\n' % (pn, srctree)) + f.write(WORKSPACE_PREFERENCE_LINES) b_is_s = use_external_build(same_dir, no_same_dir, d) if b_is_s: f.write('EXTERNALSRC_BUILD:pn-%s = "%s"\n' % (pn, srctree)) From patchwork Mon Nov 30 15:26:59 2026 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Purdie X-Patchwork-Id: 106507 Received: from mail-wm1-f44.google.com (mail-wm1-f44.google.com [209.85.128.44]) by mx.groups.io with SMTP id smtpd.msgproc01-g2.34558.1796052443694827284 for ; Mon, 30 Nov 2026 07:27:24 -0800 Authentication-Results: mx.groups.io; dkim=pass header.i=@linuxfoundation.org header.s=google header.b=fecmQ7+P; spf=pass (domain: linuxfoundation.org, ip: 209.85.128.44, mailfrom: richard.purdie@linuxfoundation.org) Received: by mail-wm1-f44.google.com with SMTP id 5b1f17b1804b1-4bb70074ab2so112506525e9.0 for ; Mon, 30 Nov 2026 07:27:23 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linuxfoundation.org; s=google; t=1796052442; x=1796657242; 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=xCq6H1+czFB0c4sNFDf5JnIKa1uuCN8U7g+xQmgY0Bw=; b=fecmQ7+PpaSBZz79p+9d4fNYvZwkzb4W0jmiFnI0dnGq0OtFpbDXR5P3o0rYPnrEEB ZeiVX+idreZcQWk0R3S9p3Ac2z5+aMqunUPBiYVU528fIU76JVleAU395Lgv2ReeowAZ Nh4ZvYiqho0iQLrYm5BaAUp1CRKpgbpClUJa8= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20260707; t=1796052442; x=1796657242; 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=xCq6H1+czFB0c4sNFDf5JnIKa1uuCN8U7g+xQmgY0Bw=; b=JkYFMWISIQ6420HG2koOX8WIKlWwqo4A6uMEcayfE+waqKf0Ud5ycHvPfATOzko97y 7ptV3fCLJRNLR5SyLxmhSCPdJ3R9CDzA8YR6U1jLnrEWbqxFz7MqvmwCSBVMMpWxwnnZ A//VT7EXpWU2z6odTb0hzuesoFj/ysH2oRJsY5owEIhlmTh0620+IouOHx0sI+3yQWdJ UcZK5WWGc4uYyofyZU+gH+14uAbRiiDsFDZp86Hpi1S42QEkmszaRT1S4Db3rxlF1O4g i4RWXJCXX+IqGKVO+jmIglixSTs0zCk9ML+GAp7Fp5+eGb/UH+sZmFxFQgqepRJnjYza Fl5w== X-Gm-Message-State: APuU4Z/FVAwNYxS+LfX7K9UEcEN5uuRcSL7HHI7iA28l2EXhcGhmq2/k mz7sbWdSzsqte9kPORV7lep0KL8RHhWSlLqvRWGXw48b3Fgvo6AuO81BWSRGS0P9CiCv2lRRNr+ nV/2cJes= X-Gm-Gg: AZFdTZcPWN7uKO3uGHSrT5MOGBuf83uFF9LnJH4KE8+ETD8j2uH9RgV/4rSFmNUGXhM 0BxRrihRdmifbfK46oSjWsqriZ3Qlij1/qKOwYYXBH0k/w+pkC2Y41V38Rn19V5pLdTtkx/2Gj2 1actFYMGpqBk3vOhV0GFSoys0FX5p3KOrf4l6AMx4iZrScLng1LVN4ynG648ciXYwp+YgbdQXfT 0oWiPR0Ezzt6cn22EaMwcOx2QigyzonXb+huOMTr5cFsKgSzX+KW694jCd/pQmHASy7194dDFGq g2uLh51I/23KLqojugxM4l5IT15mcOMj2eTe3BHobJGxLydsocspNUCg1BoqybxgoOb3d0s3XYf Auh56VrG9sRbE5/tvdJXv8PqliRmTrXffa2hHx7gwccUTujSqdvuuv9X1mTkweFAAri9ft59Ap/ 0XyWrozyjDFkhj5gSTqqYAAtkfkTmjHCNFNl0XjiSX2ViF9G6DGbKQkwqtiPVPKm2Qf/Jw8c824 3HQOlGJLjkr6MLbBVL91gIQ/+LITs9M4xdcDooaLELDDgosBz4vsQU3CT+UooK2Trc0ErFFcSP1 fhqD4TY6qK/P98gSqB+aY4Rb8WVQr+tsdI6JO/4b+qxC8HX3meYZqf1wPg== X-Received: by 2002:a05:600c:8b11:b0:4bb:6871:8f21 with SMTP id 5b1f17b1804b1-4bb88822346mr697687375e9.23.1796052441832; Mon, 30 Nov 2026 07:27:21 -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.20 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 30 Nov 2026 07:27:20 -0800 (PST) From: Richard Purdie To: openembedded-core@lists.openembedded.org Subject: [PATCH 11/16] bitbake-layers: Update to match new layer format Date: Mon, 30 Nov 2026 15:26:59 +0000 Message-ID: <20261130152704.3471590-11-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:31 -0000 X-Groupsio-URL: https://lists.openembedded.org/g/openembedded-core/message/251620 Update to match the new layer format, updating the template, using layername as the command parameter instead of layerid (which remains an alias) and droping the priority options. The selftest is updated to match. AI-Generated: Uses Claude Opus 5.5 Signed-off-by: Richard Purdie --- meta/lib/bblayers/create.py | 11 +++++------ meta/lib/bblayers/templates/layer.conf | 17 ++++++----------- meta/lib/oeqa/selftest/cases/bblayers.py | 17 +++-------------- 3 files changed, 14 insertions(+), 31 deletions(-) diff --git a/meta/lib/bblayers/create.py b/meta/lib/bblayers/create.py index b38c4b5e38a..5128611b707 100644 --- a/meta/lib/bblayers/create.py +++ b/meta/lib/bblayers/create.py @@ -37,11 +37,11 @@ class CreatePlugin(LayerPlugin): conf = os.path.join(layerdir, 'conf') bb.utils.mkdirhier(conf) - layername = os.path.basename(os.path.normpath(args.layerdir)) - layerid = args.layerid if args.layerid is not None else layername + layerdirname = os.path.basename(os.path.normpath(args.layerdir)) + layername = args.layername if args.layername is not None else layerdirname # Create the README from templates/README - readme_template = read_template('README').format(layername=layername) + readme_template = read_template('README').format(layername=layerdirname) readme = os.path.join(layerdir, 'README') with open(readme, 'w') as fd: fd.write(readme_template) @@ -58,7 +58,7 @@ class CreatePlugin(LayerPlugin): # Create the layer.conf from templates/layer.conf layerconf_template = read_template('layer.conf').format( - layerid=layerid, priority=args.priority, compat=compat) + layername=layername, compat=compat) layerconf = os.path.join(conf, 'layer.conf') with open(layerconf, 'w') as fd: fd.write(layerconf_template) @@ -83,8 +83,7 @@ class CreatePlugin(LayerPlugin): parser_create_layer = self.add_command(sp, 'create-layer', self.do_create_layer, parserecipes=False) parser_create_layer.add_argument('layerdir', help='Layer directory to create') parser_create_layer.add_argument('--add-layer', '-a', action='store_true', help='Add the layer to bblayers.conf after creation') - parser_create_layer.add_argument('--layerid', '-i', help='Layer ID to use in BBFILE_COLLECTIONS, if different from the layerdir basename') - parser_create_layer.add_argument('--priority', '-p', default=6, help='Priority of recipes in layer') + parser_create_layer.add_argument('--layername', '--layerid', '-i', dest='layername', help='Layer name to use for LAYERNAME, if different from the layerdir basename') parser_create_layer.add_argument('--example-recipe-name', '-e', dest='examplerecipe', default='example', help='Filename of the example recipe') parser_create_layer.add_argument('--example-recipe-version', '-v', dest='version', default='0.1', help='Version number for the example recipe') diff --git a/meta/lib/bblayers/templates/layer.conf b/meta/lib/bblayers/templates/layer.conf index dddfbf716e0..557d498c85d 100644 --- a/meta/lib/bblayers/templates/layer.conf +++ b/meta/lib/bblayers/templates/layer.conf @@ -1,13 +1,8 @@ -# We have a conf and classes directory, add to BBPATH -BBPATH .= ":${{LAYERDIR}}" +# BBPATH and BBFILES are constructed automatically by bitbake. Recipes and +# bbappends in any recipes* directory within this layer are found automatically. -# We have recipes-* directories, add to BBFILES -BBFILES += "${{LAYERDIR}}/recipes-*/*/*.bb \ - ${{LAYERDIR}}/recipes-*/*/*.bbappend" +LAYERNAME = "{layername}" +LAYERVERSION = "1" -BBFILE_COLLECTIONS += "{layerid}" -BBFILE_PATTERN_{layerid} = "^${{LAYERDIR}}/" -BBFILE_PRIORITY_{layerid} = "{priority}" - -LAYERDEPENDS_{layerid} = "core" -LAYERSERIES_COMPAT_{layerid} = "{compat}" +LAYERDEPENDS = "oe-core" +LAYERSERIES_COMPAT = "{compat}" diff --git a/meta/lib/oeqa/selftest/cases/bblayers.py b/meta/lib/oeqa/selftest/cases/bblayers.py index 7ca82e0d5c0..b83ae6283df 100644 --- a/meta/lib/oeqa/selftest/cases/bblayers.py +++ b/meta/lib/oeqa/selftest/cases/bblayers.py @@ -102,29 +102,18 @@ class BitbakeLayers(OESelftestTestCase): self.assertIn('ERROR:', result.output) def test_bitbakelayers_createlayer(self): - priority = 10 layername = 'test-bitbakelayer-layercreate' layerpath = os.path.join(self.builddir, layername) self.assertFalse(os.path.exists(layerpath), '%s should not exist at this point in time' % layerpath) - result = runCmd('bitbake-layers create-layer --priority=%d %s' % (priority, layerpath)) + result = runCmd('bitbake-layers create-layer %s' % layerpath) self.track_for_cleanup(layerpath) result = runCmd('bitbake-layers add-layer %s' % layerpath) self.add_command_to_tearDown('bitbake-layers remove-layer %s' % layerpath) result = runCmd('bitbake-layers show-layers') - find_in_contents = re.search(re.escape(layername) + r'\s+' + re.escape(layerpath) + r'\s+' + re.escape(str(priority)), result.output) + find_in_contents = re.search(re.escape(layername) + r'\s+' + re.escape(layerpath) + r'\s+1\s+oe-core', result.output) self.assertTrue(find_in_contents, "%s not found in layers\n%s" % (layername, result.output)) - layervars = ['BBFILE_PRIORITY', 'BBFILE_PATTERN', 'LAYERDEPENDS', 'LAYERSERIES_COMPAT'] - bb_vars = get_bb_vars(['BBFILE_COLLECTIONS'] + ['%s_%s' % (v, layername) for v in layervars]) - - for v in layervars: - varname = '%s_%s' % (v, layername) - self.assertIsNotNone(bb_vars[varname], "%s not found" % varname) - - find_in_contents = re.search(r'(^|\s)' + re.escape(layername) + r'($|\s)', bb_vars['BBFILE_COLLECTIONS']) - self.assertTrue(find_in_contents, "%s not in BBFILE_COLLECTIONS" % layername) - - self.assertEqual(bb_vars['BBFILE_PRIORITY_%s' % layername], str(priority), 'BBFILE_PRIORITY_%s != %d' % (layername, priority)) + self.assertEqual(get_bb_var('LAYERDIR_%s' % layername), layerpath, 'LAYERDIR_%s not set to %s' % (layername, layerpath)) result = runCmd('bitbake-layers save-build-conf {} {}'.format(layerpath, "buildconf-1")) for f in ('local.conf.sample', 'bblayers.conf.sample', 'conf-summary.txt', 'conf-notes.txt'): From patchwork Mon Nov 30 15:27:00 2026 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Purdie X-Patchwork-Id: 106508 Received: from mail-wm1-f50.google.com (mail-wm1-f50.google.com [209.85.128.50]) by mx.groups.io with SMTP id smtpd.msgproc02-g2.34835.1796052446045394014 for ; Mon, 30 Nov 2026 07:27:26 -0800 Authentication-Results: mx.groups.io; dkim=pass header.i=@linuxfoundation.org header.s=google header.b=cMGznjNU; spf=pass (domain: linuxfoundation.org, ip: 209.85.128.50, mailfrom: richard.purdie@linuxfoundation.org) Received: by mail-wm1-f50.google.com with SMTP id 5b1f17b1804b1-4ba013938d7so100519245e9.2 for ; Mon, 30 Nov 2026 07:27:25 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linuxfoundation.org; s=google; t=1796052444; x=1796657244; 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=Gu4jZ+5cQh9M2uddjP56zxsRZ7QrndFuHvTpiho8otc=; b=cMGznjNUVtp6eRPIDCxJn3B7i7wy7k//rz+YZ2LRB0rpwX0QCniLQh8a0PzT7UD0kw eU3FZDgVlkEPFH+C6Ni+lXqEWXKN5tbFWL0+sw/Kc8riX8vbfDJ/z7Q6IzBL0RxqFL66 BFarXNI/UMO0bluJvId7foRx2ASa59tFgH3/U= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20260707; t=1796052444; x=1796657244; 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=Gu4jZ+5cQh9M2uddjP56zxsRZ7QrndFuHvTpiho8otc=; b=raPcnjowleztFaSoa0af0KQZqyBSeYYkf8IG0oNHh536Xd803YGMVvlpnIVHCcaN2K ZULMMGKC8TqI/osn7FqrGBk1bh0JCHC66+aVJzy4j1HPPO23bUJAX86/ep+GjYm4sf+P 122+MbrXnDBFBBgG5UL+kws2heAPwUgGGhXIz+M4N/d4tWYTM5DAuvO3rE1K132YnpQ6 y/Em2uCRfMVNtT2MhxezMiefCQwvrKp9WUVxL8WgvoXELyjzPoOD5dXWjdCVhv9SwUPS cv9FPtXs+P5RDkFzcJA5CzBQbkhehgB3amlb5W7/hd2dFistTHfb/1rX/WNervcrk1v8 mHdg== X-Gm-Message-State: APuU4Z9gKuseJefoAzRaMEeiQkQHqcPh5Z2vh6Awz7I7mZgc6bsAdly8 Iy/n/w/detIMMAlVlnUvjymohMCq2hjk6isFuSIpj3h3RF2cZ3t/9Pdr/fGPJkzZrUc0tJhv0SO 0LewEdyE= X-Gm-Gg: AZFdTZcCkXofnQsKJSGj8OvRQ7gBASjCLGkjcuUXsQK5g9nxiK5J8u4PnP3JqmlZtWy zE7omIOwyYtS8/NFkIGyC4HXVoE03zwGfmh/coswtzgkrDbAbg77OLmllA4d5SRzVHHxZ2aNXxk PJdEEAGXd7QeIeI9z5TsgHM4vyFgzeXIEbm8aePkbe4tnaA4LCQYCOig58S1v/wu20cnnTiAuru +P70/hEp8tbpYkKtre8jb/02ehk38YVL/8GOM79wV6kMT3HTT2Q/TEBqgDJ97EtAfPrmr48741j iWaztjmLQ+c9c2ID5tA9u58jg7DobX3XA5YbTCso9IPfQMV29tvxe+pJCPLZw9f9ERKPk/YPCuv wBVOqZMOu4nteBnnqSyx/Ms0cMurtX+zA8hNqQOfuSyU0jYaVH1x0RTY8n99cgzXzcMvPnRPAJ6 1BTI06fcOMO7bgFcIOOq6wA07FA6rIrUats/KV5dDVmLiF0P32VsQxUSuv0RKEvBl5sWABIpR6x b/nDhyYZyGEz2RuzDuPsj2XtR+goF4ca6WnfNs/Gsd5mi+hrI5AasyuGDr/ROomsjilZJif2MNI MnYfiCmxS1NbkvAdhUEPjyF+wGi8bgsXPcrzyDvoTL0HEsXJdDKXzrlYKg== X-Received: by 2002:a05:600c:6290:b0:4bb:741d:eba with SMTP id 5b1f17b1804b1-4bb88824a5bmr661602805e9.13.1796052444126; Mon, 30 Nov 2026 07:27:24 -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.21 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 30 Nov 2026 07:27:22 -0800 (PST) From: Richard Purdie To: openembedded-core@lists.openembedded.org Subject: [PATCH 12/16] oeqa: Update test layers for the new layer.conf format Date: Mon, 30 Nov 2026 15:27:00 +0000 Message-ID: <20261130152704.3471590-12-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:31 -0000 X-Groupsio-URL: https://lists.openembedded.org/g/openembedded-core/message/251621 Update the test layer creation code to use the new layer format. Use LAYERDIR_ as the way to check if a layer is available to replace the collections check which is no longer available. AI-Generated: Uses Claude Opus 5.5 Signed-off-by: Richard Purdie --- meta/lib/oeqa/selftest/cases/buildoptions.py | 8 +++---- meta/lib/oeqa/selftest/cases/devtool.py | 24 +++++--------------- meta/lib/oeqa/selftest/cases/layerappend.py | 18 +++++++-------- meta/lib/oeqa/selftest/cases/recipetool.py | 11 ++++----- meta/lib/oeqa/utils/commands.py | 15 +++++------- 5 files changed, 28 insertions(+), 48 deletions(-) diff --git a/meta/lib/oeqa/selftest/cases/buildoptions.py b/meta/lib/oeqa/selftest/cases/buildoptions.py index 92d8595591b..264fe09b959 100644 --- a/meta/lib/oeqa/selftest/cases/buildoptions.py +++ b/meta/lib/oeqa/selftest/cases/buildoptions.py @@ -117,11 +117,9 @@ class SanityOptionsTest(OESelftestTestCase): os.makedirs(dummy_layer_conf_dir) dummy_layer_conf_path = os.path.join(dummy_layer_conf_dir, 'layer.conf') - dummy_layer_content = 'BBPATH .= ":${LAYERDIR}"\n' \ - 'BBFILES += "${LAYERDIR}/recipes-*/*/*.bb ${LAYERDIR}/recipes-*/*/*.bbappend"\n' \ - 'BBFILE_COLLECTIONS += "%s"\n' \ - 'BBFILE_PATTERN_%s = "^${LAYERDIR}/"\n' \ - 'BBFILE_PRIORITY_%s = "6"\n' % (dummy_layer_name, dummy_layer_name, dummy_layer_name) + dummy_layer_content = 'LAYERNAME = "%s"\n' \ + 'LAYERDEPENDS = "oe-core"\n' \ + 'LAYERSERIES_COMPAT = "%s"\n' % (dummy_layer_name, get_bb_var('LAYERSERIES_CORENAMES')) ftools.write_file(dummy_layer_conf_path, dummy_layer_content) diff --git a/meta/lib/oeqa/selftest/cases/devtool.py b/meta/lib/oeqa/selftest/cases/devtool.py index 89ca79e6358..7d815534996 100644 --- a/meta/lib/oeqa/selftest/cases/devtool.py +++ b/meta/lib/oeqa/selftest/cases/devtool.py @@ -218,8 +218,8 @@ class DevtoolTestCase(OESelftestTestCase): self.fail('bbappend for recipe %s does not seem to be created in test layer' % testrecipe) return bbappendfile - def _create_temp_layer(self, templayerdir, addlayer, templayername, priority=999, recipepathspec='recipes-*/*'): - create_temp_layer(templayerdir, templayername, priority, recipepathspec) + def _create_temp_layer(self, templayerdir, addlayer, templayername): + create_temp_layer(templayerdir, templayername) if addlayer: self.add_command_to_tearDown('bitbake-layers remove-layer %s || true' % templayerdir) result = runCmd('bitbake-layers add-layer %s' % templayerdir, cwd=self.builddir) @@ -687,8 +687,7 @@ class DevtoolAddTests(DevtoolBase): self._test_recipe_contents(recipefile, checkvars, []) def test_devtool_add_npm(self): - collections = get_bb_var('BBFILE_COLLECTIONS').split() - if "openembedded-layer" not in collections: + if not get_bb_var('LAYERDIR_meta-oe'): self.skipTest("Test needs meta-oe for nodejs") pn = 'savoirfairelinux-node-server-example' @@ -1553,10 +1552,9 @@ class DevtoolUpdateTests(DevtoolBase): def test_devtool_update_recipe_append_git(self): # Check preconditions testrecipe = 'mtd-utils-selftest' - bb_vars = get_bb_vars(['FILE', 'SRC_URI', 'LAYERSERIES_CORENAMES'], testrecipe) + bb_vars = get_bb_vars(['FILE', 'SRC_URI'], testrecipe) recipefile = bb_vars['FILE'] src_uri = bb_vars['SRC_URI'] - corenames = bb_vars['LAYERSERIES_CORENAMES'] self.assertIn('git://', src_uri, 'This test expects the %s recipe to be a git recipe' % testrecipe) for entry in src_uri.split(): if entry.startswith('git://'): @@ -1578,18 +1576,8 @@ class DevtoolUpdateTests(DevtoolBase): result = runCmd('echo "# Additional line" >> Makefile.am', cwd=tempsrcdir) result = runCmd('git commit -a -m "Change the Makefile"', cwd=tempsrcdir) self._add_recipe_cleanup(recipefile) - # Create a temporary layer - os.makedirs(os.path.join(templayerdir, 'conf')) - with open(os.path.join(templayerdir, 'conf', 'layer.conf'), 'w') as f: - f.write('BBPATH .= ":${LAYERDIR}"\n') - f.write('BBFILES += "${LAYERDIR}/recipes-*/*/*.bbappend"\n') - f.write('BBFILE_COLLECTIONS += "oeselftesttemplayer"\n') - f.write('BBFILE_PATTERN_oeselftesttemplayer = "^${LAYERDIR}/"\n') - f.write('BBFILE_PRIORITY_oeselftesttemplayer = "999"\n') - f.write('BBFILE_PATTERN_IGNORE_EMPTY_oeselftesttemplayer = "1"\n') - f.write('LAYERSERIES_COMPAT_oeselftesttemplayer = "%s"\n' % corenames) - self.add_command_to_tearDown('bitbake-layers remove-layer %s || true' % templayerdir) - result = runCmd('bitbake-layers add-layer %s' % templayerdir, cwd=self.builddir) + # Create a temporary layer and add it to bblayers.conf + self._create_temp_layer(templayerdir, True, 'oeselftesttemplayer') # Create the bbappend result = runCmd('devtool update-recipe -m srcrev %s -a %s' % (testrecipe, templayerdir)) self.assertNotIn('WARNING:', result.output) diff --git a/meta/lib/oeqa/selftest/cases/layerappend.py b/meta/lib/oeqa/selftest/cases/layerappend.py index afd65b485f1..b915cd98460 100644 --- a/meta/lib/oeqa/selftest/cases/layerappend.py +++ b/meta/lib/oeqa/selftest/cases/layerappend.py @@ -11,16 +11,12 @@ from oeqa.utils.commands import bitbake, get_bb_var import oeqa.utils.ftools as ftools class LayerAppendTests(OESelftestTestCase): + # Each layer depends on the previous one so that the bbappends are + # applied in a defined order (layer 2's after layer 1's) layerconf = """ -# We have a conf and classes directory, append to BBPATH -BBPATH .= ":${LAYERDIR}" - -# We have a recipes directory, add to BBFILES -BBFILES += "${LAYERDIR}/recipes*/*.bb ${LAYERDIR}/recipes*/*.bbappend" - -BBFILE_COLLECTIONS += "meta-layerINT" -BBFILE_PATTERN_meta-layerINT := "^${LAYERDIR}/" -BBFILE_PRIORITY_meta-layerINT = "6" +LAYERNAME = "meta-layertestINT" +LAYERDEPENDS = "DEPENDS" +LAYERSERIES_COMPAT = "CORENAMES" """ recipe = """ LICENSE = "MIT" @@ -57,6 +53,8 @@ SRC_URI:append = " file://appendtest.txt" def test_layer_appends(self): corebase = get_bb_var("COREBASE") + corenames = get_bb_var("LAYERSERIES_CORENAMES") + depends = {"0": "oe-core", "1": "meta-layertest0", "2": "meta-layertest1"} for l in ["0", "1", "2"]: layer = os.path.join(corebase, "meta-layertest" + l) @@ -64,7 +62,7 @@ SRC_URI:append = " file://appendtest.txt" os.mkdir(layer) os.mkdir(layer + "/conf") with open(layer + "/conf/layer.conf", "w") as f: - f.write(self.layerconf.replace("INT", l)) + f.write(self.layerconf.replace("INT", l).replace("DEPENDS", depends[l]).replace("CORENAMES", corenames)) os.mkdir(layer + "/recipes-test") if l == "0": with open(layer + "/recipes-test/layerappendtest.bb", "w") as f: diff --git a/meta/lib/oeqa/selftest/cases/recipetool.py b/meta/lib/oeqa/selftest/cases/recipetool.py index 181d95804fc..fdcc468a837 100644 --- a/meta/lib/oeqa/selftest/cases/recipetool.py +++ b/meta/lib/oeqa/selftest/cases/recipetool.py @@ -318,9 +318,9 @@ class RecipetoolAppendTests(RecipetoolBase): _, output = self._try_recipetool_appendfile('selftest-recipetool-appendfile', '/usr/share/selftest-replaceme-postinst', self.testfile, '-r selftest-recipetool-appendfile', expectedlines, ['testfile']) def test_recipetool_appendfile_extlayer(self): - # Try creating a bbappend in a layer that's not in bblayers.conf and has a different structure + # Try creating a bbappend in a layer that's not in bblayers.conf exttemplayerdir = os.path.join(self.tempdir, 'extlayer') - self._create_temp_layer(exttemplayerdir, False, 'oeselftestextlayer', recipepathspec='metadata/recipes/recipes-*/*') + self._create_temp_layer(exttemplayerdir, False, 'oeselftestextlayer') result = runCmd('recipetool appendfile %s /usr/share/selftest-replaceme-orig %s' % (exttemplayerdir, self.testfile)) self.assertNotIn('Traceback', result.output) createdfiles = [] @@ -328,8 +328,8 @@ class RecipetoolAppendTests(RecipetoolBase): for f in files: createdfiles.append(os.path.relpath(os.path.join(root, f), exttemplayerdir)) createdfiles.remove('conf/layer.conf') - expectedfiles = ['metadata/recipes/recipes-test/selftest-recipetool-appendfile/selftest-recipetool-appendfile.bbappend', - 'metadata/recipes/recipes-test/selftest-recipetool-appendfile/selftest-recipetool-appendfile/selftest-replaceme-orig'] + expectedfiles = ['recipes-test/recipetool/selftest-recipetool-appendfile.bbappend', + 'recipes-test/recipetool/selftest-recipetool-appendfile/selftest-replaceme-orig'] self.assertEqual(sorted(createdfiles), sorted(expectedfiles)) def test_recipetool_appendfile_wildcard(self): @@ -434,8 +434,7 @@ class RecipetoolCreateTests(RecipetoolBase): self._test_recipe_contents(recipefile, checkvars, inherits) def test_recipetool_create_npm(self): - collections = get_bb_var('BBFILE_COLLECTIONS').split() - if "openembedded-layer" not in collections: + if not get_bb_var('LAYERDIR_meta-oe'): self.skipTest("Test needs meta-oe for nodejs") temprecipe = os.path.join(self.tempdir, 'recipe') diff --git a/meta/lib/oeqa/utils/commands.py b/meta/lib/oeqa/utils/commands.py index cf2b7aa9418..35459358535 100644 --- a/meta/lib/oeqa/utils/commands.py +++ b/meta/lib/oeqa/utils/commands.py @@ -337,18 +337,15 @@ def get_test_layer(bblayers=None): break return testlayer -def create_temp_layer(templayerdir, templayername, priority=999, recipepathspec='recipes-*/*'): +def create_temp_layer(templayerdir, templayername, layerdepends='oe-core'): + # Bitbake constructs BBPATH and BBFILES itself, recipes and bbappends + # are found in any recipes* directories within the layer os.makedirs(os.path.join(templayerdir, 'conf')) corenames = get_bb_var('LAYERSERIES_CORENAMES') with open(os.path.join(templayerdir, 'conf', 'layer.conf'), 'w') as f: - f.write('BBPATH .= ":${LAYERDIR}"\n') - f.write('BBFILES += "${LAYERDIR}/%s/*.bb \\' % recipepathspec) - f.write(' ${LAYERDIR}/%s/*.bbappend"\n' % recipepathspec) - f.write('BBFILE_COLLECTIONS += "%s"\n' % templayername) - f.write('BBFILE_PATTERN_%s = "^${LAYERDIR}/"\n' % templayername) - f.write('BBFILE_PRIORITY_%s = "%d"\n' % (templayername, priority)) - f.write('BBFILE_PATTERN_IGNORE_EMPTY_%s = "1"\n' % templayername) - f.write('LAYERSERIES_COMPAT_%s = "%s"\n' % (templayername, corenames)) + f.write('LAYERNAME = "%s"\n' % templayername) + f.write('LAYERDEPENDS = "%s"\n' % layerdepends) + f.write('LAYERSERIES_COMPAT = "%s"\n' % corenames) @contextlib.contextmanager def runqemu(pn, ssh=True, runqemuparams='', image_fstype=None, launch_cmd=None, qemuparams=None, overrides={}, boot_patterns = {}, discard_writes=True): From patchwork Mon Nov 30 15:27:01 2026 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Purdie X-Patchwork-Id: 106509 Received: from mail-wm1-f52.google.com (mail-wm1-f52.google.com [209.85.128.52]) by mx.groups.io with SMTP id smtpd.msgproc01-g2.34561.1796052447363119735 for ; Mon, 30 Nov 2026 07:27:27 -0800 Authentication-Results: mx.groups.io; dkim=pass header.i=@linuxfoundation.org header.s=google header.b=L7bI4Qi1; spf=pass (domain: linuxfoundation.org, ip: 209.85.128.52, mailfrom: richard.purdie@linuxfoundation.org) Received: by mail-wm1-f52.google.com with SMTP id 5b1f17b1804b1-4b79502c27aso106593435e9.1 for ; Mon, 30 Nov 2026 07:27:27 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linuxfoundation.org; s=google; t=1796052446; x=1796657246; 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=iqvl+WpLa86qnKpMDxVPqEuaNtBUSUCI52o6Ho8pcck=; b=L7bI4Qi1vvJy5v4FtTdJLGQaogeqNUlEcUhU106aZ+j+eFU2K6DMQ1eRhdFm86tDwD /dRdYC+iW3INELl+orX89RxQHZmW24i3gdP05cmA6W1CM1OXoh8d5Bvyz+lrJVjuTDGu QQR6KNfTdAit5MRxTz4aRNqeIBSUeqMzg4yNk= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20260707; t=1796052446; x=1796657246; 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=iqvl+WpLa86qnKpMDxVPqEuaNtBUSUCI52o6Ho8pcck=; b=cdBxL49gn5dy9+l+5N96GbTo8ZVQpWQOzRMJruqvy6If27kwPhcYvLdCNrWGxxxQUg MvdWMIixTjER2q4t0kQFfEjLNQDo2TZhobm+V300gph+K9TITWNpdFrGeesBy0dswiKX tw3TrtSaPfqZKEjihDa/4UtXQ3eAlv1CGfSsD5KjBo+pHO6NIK4Dh9iwHWV2GLiJi6zV DxkBXLP+nHIVszpZ7t4FA3kJPVxB4ERUFXr2DsZVUMTGnefwebsobN7BxbF4lN2loeXu xsxop2QF+PnNpo2me+OrZ2kD1JOmKdvVoS5OJWQ0dMh8fGN3Nc/ChHVVKef0BP0AnE77 Mg0w== X-Gm-Message-State: APuU4Z/1CWTDFQLXRHyqsqlbYlb1xfI/eS8QQwwQ9o2aOpx+W1qqqFTV sKQxiAWfR5HgmQL3Ke7JQkSIxbBpc0AGVydOs3oIx8NmbkquHbkl8n8sKuSKhFi+cgazcgHvWBu 11bpq0pU= X-Gm-Gg: AZFdTZf+D2pK7PvOiYq9dcHU5i0eI22WFBNPrcK84dwTRFP0QB6h87fpSo9qnSPE+L4 xI7sAEGS57IR6xWs7oK/hkQxr+WRMzccvprod3G2Tk3lhkuCOqiHzImdzAg5uKfXzkR83WGufH2 Ohqk1i6/ZDUTlUTmG2qHC0F57VDo3T5fXR/nGCETF0kI4UOgtBjFel8/DNcOxN2mb/9GRwlsAb1 JupdDJE+LxqBrA/mqJC5rxofJRvFfPbfQMPWp2XLXTjdBoALVd+5Lb5cbKIA/9p5iehL7LUOM0j 55iExDzg1wK4U9XxZ8VYrnCLlP8XWtsWg4y60WGel8KQjxvuB4hyFxxAmQP2DGb5jZy9+M+Uknr D6gJHJ3GwoTkuoLyJj6JDmCoK+lFXoT6xeKTTG+yeQtI1M1o0uLAvi1PiNYq4robRuBDGmxfM+E iDknN3Hy5ZKygXyWV5U/ooeIzSsNoBnszSbBUYMhSiAeKg7rHTaUqZ+V4CSqGRffpec1jjZ6etc XmLJs1n09bBWPWLIdTLKOK4wi6by0HQJsDKtWK5Aw4vCGzrlWSEqdS9eDR3Cg2LWXaLYlZUpQjk N1QzjKO/mz/KiVTRvAp2/8tBm0LXd0IOKjv6f0Oe5XMCBGQLYQUAkh6WCjO/4nKr+GtU/3WTitI HdYk= X-Received: by 2002:a05:600c:a088:b0:4a2:1a:a120 with SMTP id 5b1f17b1804b1-4bb8880ac02mr639780195e9.6.1796052445525; Mon, 30 Nov 2026 07:27:25 -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.24 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 30 Nov 2026 07:27:24 -0800 (PST) From: Richard Purdie To: openembedded-core@lists.openembedded.org Subject: [PATCH 13/16] oeqa/selftest/devtool: Don't nest the temp layer around the OE-Core copy Date: Mon, 30 Nov 2026 15:27:01 +0000 Message-ID: <20261130152704.3471590-13-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:31 -0000 X-Groupsio-URL: https://lists.openembedded.org/g/openembedded-core/message/251622 test_devtool_update_recipe_local_files used the module's templayerdir as a layer, but that directory also contains the copy of OE-Core used by the tests, so the layers nested. Bitbake now detects that so use a separate temporary directory for the layer. AI-Generated: Uses Claude Opus 5.5 Signed-off-by: Richard Purdie --- meta/lib/oeqa/selftest/cases/devtool.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/meta/lib/oeqa/selftest/cases/devtool.py b/meta/lib/oeqa/selftest/cases/devtool.py index 7d815534996..37b2482a136 100644 --- a/meta/lib/oeqa/selftest/cases/devtool.py +++ b/meta/lib/oeqa/selftest/cases/devtool.py @@ -1661,7 +1661,11 @@ class DevtoolUpdateTests(DevtoolBase): self._check_repo_status(os.path.dirname(recipefile), expected_status) # Now try to update recipe in another layer, so first, clean it runCmd('cd %s; git clean -fd .; git checkout .' % os.path.dirname(recipefile)) - # Create a temporary layer and add it to bblayers.conf + # Create a temporary layer and add it to bblayers.conf. This needs its + # own directory since the module's templayerdir contains the copy of + # OE-Core and layers can't nest. + templayerdir = tempfile.mkdtemp(prefix='devtoolqa') + self.track_for_cleanup(templayerdir) self._create_temp_layer(templayerdir, True, 'templayer') # Update recipe in templayer result = runCmd('devtool update-recipe %s -a %s' % (testrecipe, templayerdir)) From patchwork Mon Nov 30 15:27:02 2026 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Purdie X-Patchwork-Id: 106505 Received: from mail-wm1-f54.google.com (mail-wm1-f54.google.com [209.85.128.54]) by mx.groups.io with SMTP id smtpd.msgproc01-g2.34563.1796052448776789268 for ; Mon, 30 Nov 2026 07:27:29 -0800 Authentication-Results: mx.groups.io; dkim=pass header.i=@linuxfoundation.org header.s=google header.b=f2dJZydg; spf=pass (domain: linuxfoundation.org, ip: 209.85.128.54, mailfrom: richard.purdie@linuxfoundation.org) Received: by mail-wm1-f54.google.com with SMTP id 5b1f17b1804b1-4bb55cda775so64748165e9.0 for ; Mon, 30 Nov 2026 07:27:28 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linuxfoundation.org; s=google; t=1796052447; x=1796657247; 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=sKUVf/QSe9ROsZzOhR+r/b16zhCikq8MCbL03BvRdsc=; b=f2dJZydgjIi4xE/ceARlhaJriSH/iyJ9g92xBppDfwXSTzvr+QRPmuJYwHEcrP7umM PW95S1ndST+31oO6prT0CuaN2Povj1yj//0diPD3ZGY2FpddufW0EqL/t2nr6dLP5jfk IUAtTcOcQlxy6HfUIDOk4KQe23lrW2JHJV8Qg= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20260707; t=1796052447; x=1796657247; 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=sKUVf/QSe9ROsZzOhR+r/b16zhCikq8MCbL03BvRdsc=; b=ot4jm73dNXFdQelicFMK9GcsuCmhQ8FGKkur+g/rxP29Ugy8gPtesWRYTOGzVg1ifd GvbjDwdanvRYPdRWcp8iQd5ncvAiwvg4azriTdvdiR7VTRQtYZphTQoE9ZhmNuBw4WGY sdFL1u7PX1yqTVAAZR8xoUQ7D1O1RmhDM2QHK0sA/lMJdLxm+WidKkd8ya2SkPHKLcs7 4NDzOtheK/1dxAkcJqlyCM2ZbaDHBHVquZqHBItRxt9/cYbiuVPO12rSpSKtvaOCVdxN cg0kjyEggxL3H810qps7en8eTC2kCQ4oeHT0ekso+lboDttJuiOirj2nA7x9gyEB5PWO muvQ== X-Gm-Message-State: APuU4Z8T2boj+YI+sKraDzrt7zh0afb2cWc+JvlX3OnvjjSqz/AA9U/9 UOJ8YDA5ztjxmX2qGPL731hdwTBn+jUxpJ0QRUbtIkFXVOTSH3+EPEaVP9xWbUZGrQabWhcoG70 5YYhUkto= X-Gm-Gg: AZFdTZe0Tw7y9Yn4ASFvbg58ilk9x5t6qagjJwhJkR5GUQlXgUFm87X9xNTOYh0w1NP P1yB6YX+52jQVrVTz/eqIUyvBdBV2b2e1CoyVLB3+HpyNrbNR24VRjnujq4zVJmAL0ZP3z33fCD KvaDtLHqTQWnkVBb+FP4P+32YmegPqNqgE6i9gKhvnJB/MsMSCXfpT/uDftxVmXxLXxkQFu8zjc VHNDTKbJ6/TUduHGW6N8U8WBdwc9jIWREdbx8oOVX+9MMIQTn+dtqMQHoEJ42LMtKy52TgbBXGK 7bFmOdyBYdxbzwiLDN9lzRnV81I4iSOnu3RO+JUEnP4rP/MoGoDHdeeIhnaKhaLQlU9yp+9i8ts HycDc7Qu0nLi17GaTxn/2wpBp1TR5yeW7QvYEgp4GI4BGEovbrDg9hITp1r3AFUZmn1mitfh0l5 Xt7LP8AxgBbmCoUOrgGcMtyQwy7wmP1lVNmioiuQOklwI6qbsjFap8Ppf8kypCB5MAewkMTG+wX fMrGE0ywfHgk0/kw/Ps/e07srQXIJYDQT+kk2pONF0RJMIl2JbHHub0W4WCjn4sNE5gulRCSpdR m9ZTNBbW2npvtuKulbyNb+gA9nw/u/BGJjXa0OBpkB5E9g7To0d4naGLBg== X-Received: by 2002:a05:600c:3547:b0:4a1:c27d:e1a8 with SMTP id 5b1f17b1804b1-4bb8880b88fmr672676625e9.10.1796052446901; Mon, 30 Nov 2026 07:27:26 -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.25 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 30 Nov 2026 07:27:25 -0800 (PST) From: Richard Purdie To: openembedded-core@lists.openembedded.org Subject: [PATCH 14/16] recipetool: Fix temporary fetch recipe location after layer.conf changes Date: Mon, 30 Nov 2026 15:27:02 +0000 Message-ID: <20261130152704.3471590-14-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:30 -0000 X-Groupsio-URL: https://lists.openembedded.org/g/openembedded-core/message/251623 _get_temp_recipe_dir() looked for BBFILES entries ending in .bb, but BBFILES is now /recipes* globs, so recipetool create (and devtool add/upgrade) failed to find anywhere to put the temporary fetch recipe. Use a new recipes-recipetool directory in a writeable layer from BBFILES, still preferring the workspace. Drop the BBFILES reference from the newappend warning. AI-Generated: Uses Claude Opus 5.5 Signed-off-by: Richard Purdie --- scripts/lib/recipetool/newappend.py | 2 +- scripts/lib/scriptutils.py | 24 ++++++++++++++---------- 2 files changed, 15 insertions(+), 11 deletions(-) diff --git a/scripts/lib/recipetool/newappend.py b/scripts/lib/recipetool/newappend.py index 08e2474dc42..3d8d22b2be1 100644 --- a/scripts/lib/recipetool/newappend.py +++ b/scripts/lib/recipetool/newappend.py @@ -48,7 +48,7 @@ def newappend(args): return 1 if not path_ok: - logger.warning('Unable to determine correct subdirectory path for bbappend file - check that what %s adds to BBFILES also matches .bbappend files. Using %s for now, but until you fix this the bbappend will not be applied.', os.path.join(args.destlayer, 'conf', 'layer.conf'), os.path.dirname(append_path)) + logger.warning('Unable to determine correct subdirectory path for bbappend file. Using %s for now, but it may not be applied.', os.path.dirname(append_path)) layerdirs = [os.path.abspath(layerdir) for layerdir in rd.getVar('BBLAYERS').split()] if not os.path.abspath(args.destlayer) in layerdirs: diff --git a/scripts/lib/scriptutils.py b/scripts/lib/scriptutils.py index 860415789b1..dc3ef98f175 100644 --- a/scripts/lib/scriptutils.py +++ b/scripts/lib/scriptutils.py @@ -114,16 +114,20 @@ def _get_temp_recipe_dir(d): # This is a little bit hacky but we need to find a place where we can put # the recipe so that bitbake can find it. We're going to delete it at the # end so it doesn't really matter where we put it. - bbfiles = d.getVar('BBFILES').split() + # BBFILES has a /recipes* entry for each layer, we place in a + # recipes-recipetool directory under one, prefering workspace if present. + layerdata = d.getVar('layerdata', False) or {} + workspace = layerdata.get('workspace') + if workspace and os.access(workspace.path, os.W_OK): + # Prefer the workspace + return os.path.join(workspace.path, 'recipes-recipetool') + layerdirs = [os.path.dirname(pth) for pth in d.getVar('BBFILES').split() + if os.path.basename(pth) == 'recipes*'] fetchrecipedir = None - for pth in bbfiles: - if pth.endswith('.bb'): - pthdir = os.path.dirname(pth) - if os.access(os.path.dirname(os.path.dirname(pthdir)), os.W_OK): - fetchrecipedir = pthdir.replace('*', 'recipetool') - if pthdir.endswith('workspace/recipes/*'): - # Prefer the workspace - break + for layer in layerdirs: + layer = os.path.realpath(layer) + if os.access(layer, os.W_OK): + fetchrecipedir = os.path.join(layer, 'recipes-recipetool') return fetchrecipedir class FetchUrlFailure(Exception): @@ -155,7 +159,7 @@ def fetch_url(tinfoil, srcuri, srcrev, destdir, logger, preserve_tmp=False, mirr fetchrecipedir = _get_temp_recipe_dir(tinfoil.config_data) if not fetchrecipedir: - logger.error('Searched BBFILES but unable to find a writeable place to put temporary recipe') + logger.error('Unable to find a writeable layer containing recipes to put the temporary recipe in') sys.exit(1) fetchrecipe = None bb.utils.mkdirhier(fetchrecipedir) From patchwork Mon Nov 30 15:27:03 2026 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Purdie X-Patchwork-Id: 106510 Received: from mail-wm1-f52.google.com (mail-wm1-f52.google.com [209.85.128.52]) by mx.groups.io with SMTP id smtpd.msgproc01-g2.34564.1796052450915750189 for ; Mon, 30 Nov 2026 07:27:31 -0800 Authentication-Results: mx.groups.io; dkim=pass header.i=@linuxfoundation.org header.s=google header.b=TNkq+kA6; spf=pass (domain: linuxfoundation.org, ip: 209.85.128.52, mailfrom: richard.purdie@linuxfoundation.org) Received: by mail-wm1-f52.google.com with SMTP id 5b1f17b1804b1-4bb606491faso55471365e9.3 for ; Mon, 30 Nov 2026 07:27:30 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linuxfoundation.org; s=google; t=1796052449; x=1796657249; 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=xmqK5XqxnoK0zqOkBj9zEDG0NksSdAIbXhg9BQr3RDo=; b=TNkq+kA6ceSrs6aJdpuhM7hRPiUY4EN23a5rUgL9cXDragtl9IpC39oSSDjcFd242J mitBVWSQ2oKlVp7tBueTVKxBN/mxWkMlrhXmW/fJd8fYNZJmZ43Y7MJ+O50yziakMQiw eP3jPEpm+vr5oL+wjX8A0v2330WkFbJmtmT7I= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20260707; t=1796052449; x=1796657249; 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=xmqK5XqxnoK0zqOkBj9zEDG0NksSdAIbXhg9BQr3RDo=; b=J+Rmxc2BqrJb/Yz3VkiAH1VIeIWXkou67AIAGCYGYj52FaaaxcfADWf+2fiWPhvrNm XiB9MLPj8wXwlRxpz+qB1mffwfJV8ZnueOTYG0COgN03an4wMyY7nYMrDrdtri/+/Yyp UYNYYuJwxhYNHtiCN7S4rXO2kLhGMOIvYHCQGvo8PPqVHMDVsJ9ElyhRhCvLPeGTLlO0 YaA1cUnHdgWTNybno9t+47A1FTigTnYliIwIQBFt2GiKxVgtHUyxAHwMJ3Fu82SeBdGP VkjGHQnYyCimzwt8+dOoahBEYrweAKMHsj9B//Ppuq2SitEXUianbrW7qSfHsaEbhEx4 PV8w== X-Gm-Message-State: APuU4Z+pd9xT/ZTReyuk8Vsf9tzuQfygBwvVImq6P/1LEjXR7fzfvFwS Ja2HeEGcBciwU6CuCDhcy76lelef5DlYgVfa84js6q2eS2+XCOPL+Iim1FwtvKFfT0xUIk36P5J 3tCZ30y0= X-Gm-Gg: AZFdTZdFITswkjSaW5MBAntxBELbBfqSxporxT07216202HwpQWF51+osFZuBH52RUh 4jp1a20kI6mCIXb1zftsvCFvDIrokfp3ZTbok6MYIx40NQMdKogScwkTfFW9euAIvkJH2mdO68a aOuPoVjv/QC/uIky8bJduRySU+eK4iU/XcqsCKBgm9NJa7FgSj99uMa0o5Oj1kKcvxRAF4yJ2xF eQ2Mhsn9aMiQuGo67OBL8P/8Vb5W0tAIlEJJGtSiiPgUsW0ikbkD8TUVjIS8DMD5XszWzpVshRf nxc9e5iMTllJYKw5Xc4R7IVRpA84wZ514Vx0idZ/dROH6ysPlODeNvRwaNM4VUDEpnWoCnXySDo I7O37B5LWWFue0x1hmL4Ylnb7R4jxyJm5w6rCZa6iqYZ+RHOa505GnOApGmJTvOOz4dCwK2Spb8 VEngCuscmZJleQ4wwPvTUZUHj02zP+uKpFklr/CGIZXd2Uv0RGgtQZ8BmzwU0CUco9XgZEcTiX9 6fr/t5aaDMkuvFh1iwTeb+NaFSJh1xIivTQu5MSrnsw2k9+I638S3Tf6hRbysSMWV4yG+oI7Lso owXVkVQIg0OOJcK89cbF3jEoDNkTK9+VreOVY3jOmKnS+NWdBSKlH0ov0w== X-Received: by 2002:a05:600c:1384:b0:4a2:1612:6367 with SMTP id 5b1f17b1804b1-4bb88816c44mr682886295e9.15.1796052448965; Mon, 30 Nov 2026 07:27:28 -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.27 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 30 Nov 2026 07:27:27 -0800 (PST) From: Richard Purdie To: openembedded-core@lists.openembedded.org Subject: [PATCH 15/16] lib/oe/recipeutils: Find recipe and bbappend locations from layer structure Date: Mon, 30 Nov 2026 15:27:03 +0000 Message-ID: <20261130152704.3471590-15-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:41 -0000 X-Groupsio-URL: https://lists.openembedded.org/g/openembedded-core/message/251624 get_bbfile_path() and get_bbappend_path() parsed the destination layer's layer.conf for BBFILES patterns, which layers no longer set, so devtool finish and recipetool appendfile couldn't work out where to put files. Derive the patterns from the layer's recipes* (and dynamic-recipes) directories as bitbake now does, preferring the conventional recipes-// layout. AI-Generated: Uses Claude Opus 5.5 Signed-off-by: Richard Purdie --- meta/lib/oe/recipeutils.py | 139 ++++++++++++++++--------------------- 1 file changed, 59 insertions(+), 80 deletions(-) diff --git a/meta/lib/oe/recipeutils.py b/meta/lib/oe/recipeutils.py index 9b3a2d0638d..635998d021b 100644 --- a/meta/lib/oe/recipeutils.py +++ b/meta/lib/oe/recipeutils.py @@ -539,6 +539,24 @@ def validate_pn(pn): return '' +def get_layer_bbfile_specs(d, layerdir, ext): + """ + Return a list of fnmatch patterns matching the recipes (ext='.bb') or + bbappends (ext='.bbappend') bitbake will pick up from the specified layer. + Bitbake searches any recipes* directories within a layer (at any depth) + plus dynamic-recipes// for any configured layer. This is + determined from the layer's structure so works for layers which aren't + in bblayers.conf. + """ + # fnmatch's '*' also matches '/', so this covers files at any depth + specs = [os.path.join(layerdir, 'recipes*', '*' + ext)] + dynamicdir = os.path.join(layerdir, 'dynamic-recipes') + if os.path.isdir(dynamicdir): + for layername in sorted(os.listdir(dynamicdir)): + if os.path.isdir(os.path.join(dynamicdir, layername)) and d.getVar('LAYERDIR_%s' % layername): + specs.append(os.path.join(dynamicdir, layername, '*' + ext)) + return specs + def get_bbfile_path(d, destdir, extrapathhint=None): """ Determine the correct path for a recipe within a layer @@ -548,48 +566,25 @@ def get_bbfile_path(d, destdir, extrapathhint=None): partial path somewhere within the layer. extrapathhint: a path relative to the base of the layer to try """ - import bb.cookerdata - destdir = os.path.abspath(destdir) destlayerdir = find_layerdir(destdir) - - # Parse the specified layer's layer.conf file directly, in case the layer isn't in bblayers.conf - confdata = d.createCopy() - confdata.setVar('BBFILES', '') - confdata.setVar('LAYERDIR', destlayerdir) - destlayerconf = os.path.join(destlayerdir, "conf", "layer.conf") - confdata = bb.cookerdata.parse_config_file(destlayerconf, confdata) + if not destlayerdir: + return None pn = d.getVar('PN') - # Parse BBFILES_DYNAMIC and append to BBFILES - bbfiles_dynamic = (confdata.getVar('BBFILES_DYNAMIC') or "").split() - collections = (confdata.getVar('BBFILE_COLLECTIONS') or "").split() - invalid = [] - for entry in bbfiles_dynamic: - parts = entry.split(":", 1) - if len(parts) != 2: - invalid.append(entry) - continue - l, f = parts - invert = l[0] == "!" - if invert: - l = l[1:] - if (l in collections and not invert) or (l not in collections and invert): - confdata.appendVar("BBFILES", " " + f) - if invalid: - return None - bbfilespecs = (confdata.getVar('BBFILES') or '').split() + bbfilespecs = get_layer_bbfile_specs(d, destlayerdir, '.bb') if destdir == destlayerdir: - for bbfilespec in bbfilespecs: - if not bbfilespec.endswith('.bbappend'): - for match in glob.glob(bbfilespec): - splitext = os.path.splitext(os.path.basename(match)) - if splitext[1] == '.bb': - mpn = splitext[0].split('_')[0] - if mpn == pn: - return os.path.dirname(match) - - # Try to make up a path that matches BBFILES + # See if there is an existing recipe for this PN in the layer + for root, dirs, files in os.walk(destlayerdir): + dirs.sort() + for fn in sorted(files): + splitext = os.path.splitext(fn) + if splitext[1] == '.bb' and splitext[0].split('_')[0] == pn: + match = os.path.join(root, fn) + if any(fnmatch.fnmatchcase(match, spec) for spec in bbfilespecs): + return root + + # Try to make up a path bitbake will find recipes in # this is a little crude, but better than nothing bpn = d.getVar('BPN') recipefn = os.path.basename(d.getVar('FILE')) @@ -602,19 +597,28 @@ def get_bbfile_path(d, destdir, extrapathhint=None): pathoptions.append(os.path.join(destdir, bpn)) elif not destdir.endswith(('/' + pn, '/' + bpn)): pathoptions.append(os.path.join(destdir, bpn)) - closepath = '' - for pathoption in pathoptions: - bbfilepath = os.path.join(pathoption, 'test.bb') - for bbfilespec in bbfilespecs: - if fnmatch.fnmatchcase(bbfilepath, bbfilespec): - return pathoption + + def conventional(path): + # Recipes are conventionally placed in recipes-// + # (optionally under dynamic-recipes//) + parts = os.path.relpath(path, destlayerdir).split(os.sep) + if parts[0] == 'dynamic-recipes': + parts = parts[2:] + return len(parts) == 2 and parts[0].startswith('recipes') + + # Bitbake will find recipes at any depth within a recipes* directory, so + # prefer the first option giving the conventional layout, if there is one + valid = [p for p in pathoptions if any(fnmatch.fnmatchcase(os.path.join(p, 'test.bb'), spec) for spec in bbfilespecs)] + for pathoption in valid: + if conventional(pathoption): + return pathoption + if valid: + return valid[0] return None def get_bbappend_path(d, destlayerdir, wildcardver=False): """Determine how a bbappend for a recipe should be named and located within another layer""" - import bb.cookerdata - destlayerdir = os.path.abspath(destlayerdir) recipefile = d.getVar('FILE') recipefn = os.path.splitext(os.path.basename(recipefile))[0] @@ -622,45 +626,20 @@ def get_bbappend_path(d, destlayerdir, wildcardver=False): recipefn = recipefn.split('_', 1)[0] + '_%' appendfn = recipefn + '.bbappend' - # Parse the specified layer's layer.conf file directly, in case the layer isn't in bblayers.conf - confdata = d.createCopy() - confdata.setVar('BBFILES', '') - confdata.setVar('LAYERDIR', destlayerdir) - destlayerconf = os.path.join(destlayerdir, "conf", "layer.conf") - confdata = bb.cookerdata.parse_config_file(destlayerconf, confdata) - origlayerdir = find_layerdir(recipefile) if not origlayerdir: return (None, False) - # Now join this to the path where the bbappend is going and check if it is covered by BBFILES + # Now join this to the path where the bbappend is going and check bitbake will find it there appendpath = os.path.join(destlayerdir, os.path.relpath(os.path.dirname(recipefile), origlayerdir), appendfn) - closepath = '' pathok = True - for bbfilespec in confdata.getVar('BBFILES').split(): - if fnmatch.fnmatchcase(appendpath, bbfilespec): - # Our append path works, we're done - break - elif bbfilespec.startswith(destlayerdir) and fnmatch.fnmatchcase('test.bbappend', os.path.basename(bbfilespec)): - # Try to find the longest matching path - if len(bbfilespec) > len(closepath): - closepath = bbfilespec - else: - # Unfortunately the bbappend layer and the original recipe's layer don't have the same structure - if closepath: - # bbappend layer's layer.conf at least has a spec that picks up .bbappend files - # Now we just need to substitute out any wildcards - appendsubdir = os.path.relpath(os.path.dirname(closepath), destlayerdir) - if 'recipes-*' in appendsubdir: - # Try to copy this part from the original recipe path - res = re.search('/recipes-[^/]+/', recipefile) - if res: - appendsubdir = appendsubdir.replace('/recipes-*/', res.group(0)) - # This is crude, but we have to do something - appendsubdir = appendsubdir.replace('*', recipefn.split('_')[0]) - appendsubdir = appendsubdir.replace('?', 'a') - appendpath = os.path.join(destlayerdir, appendsubdir, appendfn) - else: - pathok = False + if not any(fnmatch.fnmatchcase(appendpath, spec) for spec in get_layer_bbfile_specs(d, destlayerdir, '.bbappend')): + # The recipe isn't in a location which maps to one bitbake will search + # in the destination layer (e.g. it is under dynamic-recipes/ for a + # layer which isn't configured), so put the bbappend under a + # recipes-* directory, using the original recipe's category if possible + res = re.search('/(recipes-[^/]+)/', recipefile) + category = res.group(1) if res else 'recipes' + appendpath = os.path.join(destlayerdir, category, recipefn.split('_')[0], appendfn) return (appendpath, pathok) @@ -723,7 +702,7 @@ def bbappend_recipe(rd, destlayerdir, srcfiles, install=None, wildcardver=False, bb.error('Unable to determine layer directory containing %s' % recipefile) return (None, None) if not pathok: - bb.warn('Unable to determine correct subdirectory path for bbappend file - check that what %s adds to BBFILES also matches .bbappend files. Using %s for now, but until you fix this the bbappend will not be applied.' % (os.path.join(destlayerdir, 'conf', 'layer.conf'), os.path.dirname(appendpath))) + bb.warn('Unable to determine correct subdirectory path for bbappend file. Using %s for now, but it may not be applied.' % os.path.dirname(appendpath)) appenddir = os.path.dirname(appendpath) if not redirect_output: From patchwork Mon Nov 30 15:27:04 2026 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Purdie X-Patchwork-Id: 106511 Received: from mail-wm1-f44.google.com (mail-wm1-f44.google.com [209.85.128.44]) by mx.groups.io with SMTP id smtpd.msgproc01-g2.34566.1796052452533815233 for ; Mon, 30 Nov 2026 07:27:32 -0800 Authentication-Results: mx.groups.io; dkim=pass header.i=@linuxfoundation.org header.s=google header.b=TpI+btM8; spf=pass (domain: linuxfoundation.org, ip: 209.85.128.44, mailfrom: richard.purdie@linuxfoundation.org) Received: by mail-wm1-f44.google.com with SMTP id 5b1f17b1804b1-4bb6adaf0f1so90687715e9.0 for ; Mon, 30 Nov 2026 07:27:32 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linuxfoundation.org; s=google; t=1796052451; x=1796657251; 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=E8rxSQlkXLXzyUqqj3pYP/zM0aPsfm60fESyx9RDvJg=; b=TpI+btM81ZYSDo+tvNUO+AKy0lDpm6peR12KDQueBNxAVNMqCap9pJX43j6Gwq2HXc Ng6+jECQI6LyPLNbG9T9Yxr7uTT/KFW1/ZHHa5T5v4S6mYOF0Nk1bKg4zwHvY7J6+yPj 4ok1KrvCuhKuxD2PsXA4duv0L9rUoDKxzr8w4= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20260707; t=1796052451; x=1796657251; 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=E8rxSQlkXLXzyUqqj3pYP/zM0aPsfm60fESyx9RDvJg=; b=EtHOTM4L9mcr115BvF6TFVBif4h7+6E359zBonnTUIT92aQXWGe1uMW2lNPCH/Ewnv hUMR9Vglft/mmWYpNCtCn7ux0odS8UVGNL8o49vOCJwjC83f5DQ00fnz/NbR/qszfNLD rzyn7Bi2iTQZxpM2tvBjwpeVaxJMRRbDSr5AyW9OMLXoGv0bPFP3AkdKOPAePNlIkKNK TyV1EuQ58X1FTlq12obGM+dZp83f2Mht14P8Ku5PUdHvK3cfYlKn08fJKqQ95dDIjlUp G9vG1ivQaCMJgvHOoSQN5u4BNrIPt2yNe5HMaMxOHYAZGYdNy+d4yXmiQ04BDHuzNxJI OnRg== X-Gm-Message-State: APuU4Z8r8zfAmTff++YtvlEqyRg8fWLFXNKkmQ5WWR7LaeP7/fHKZKQG HhZ3ySqKHqP/GrNBretU8FBfYftc+Wn7EHM458XKSLTroXDbOaQuk0A7OuNPce3s5mEo+vYTxkJ c0Y1+rSc= X-Gm-Gg: AZFdTZdca3HjbJ1rLiinCbIJNyrgUer8+cko7cZZ/tnq2mD1djeuZkdlzC6AJM2n+M7 FgtaOF+ppOWUPNqdEIBdUhUlliLagxhAaOxgrzZAhFSGOeHcpjGK3YZtZ8ugI7J5iJMZamR160m +/sBi09Lm7Nv5GLxa8t7RG4gLOibJIlc7mnUKX7xTbodHEGWyQIqWqmOdE0O8RGes71dj4+IhuH qVsWEGv4il+SMqKbxJdo+e/kp+k7wami2fWd48WfvDnAsbYM9yaegFxDVs4VyoAaqa/l/2MrAXD 2IQ8ClabW9Y3EEww3bgD2zYmsvFQfKlr8FukiNsQjKAr8vSS4QzER512HV5uVk6eDB7vgPyXE5E 2viXUA6pbmLMAjHQ9xJC/MA+vQKmJVxGtGwizA8n1KdpSdSep42KAdvhV0myPv7ZU3SSVJUyur4 jm2IO5EOgTOa2OF5i6vFyWqhNrvkAShN/I2n/UMjPETHpThVbCPqe1VLxSnRYpP7p2aFHjuVRQZ 7fpsxB/cYhPmY6rGpMyWTgRPR1Kw3B4DmcYiY4FKAY0amk18+JOVH/+rkqPSaRCg0oQSQc0FNnm wt8nOSceJsNERhu4QSv1v6WyWH9823XWjnexUXmeFUNzHuP5bX2qXck1t0ErJqd5ffgaosWsKxQ KFaQ= X-Received: by 2002:a05:600c:37c3:b0:4bb:b7a7:8377 with SMTP id 5b1f17b1804b1-4bbb7a7837cmr217259645e9.32.1796052450660; Mon, 30 Nov 2026 07:27:30 -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.29 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 30 Nov 2026 07:27:29 -0800 (PST) From: Richard Purdie To: openembedded-core@lists.openembedded.org Subject: [PATCH 16/16] checklayer: Update for layer format changes and removal of collections Date: Mon, 30 Nov 2026 15:27:04 +0000 Message-ID: <20261130152704.3471590-16-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:41 -0000 X-Groupsio-URL: https://lists.openembedded.org/g/openembedded-core/message/251625 Update to use the new layer format variables and the removal of collection support. AI-Generated: Uses Claude Opus 5.5 Signed-off-by: Richard Purdie --- scripts/lib/checklayer/__init__.py | 91 +++++++++++--------------- scripts/lib/checklayer/cases/common.py | 9 ++- scripts/yocto-check-layer | 5 +- 3 files changed, 45 insertions(+), 60 deletions(-) diff --git a/scripts/lib/checklayer/__init__.py b/scripts/lib/checklayer/__init__.py index 9d79ae9cd01..5fc2ef7058b 100644 --- a/scripts/lib/checklayer/__init__.py +++ b/scripts/lib/checklayer/__init__.py @@ -29,7 +29,11 @@ def _get_configurations(path): configs.append(f[:-5]) # strip .conf return configs -def _get_layer_collections(layer_path, lconf=None, data=None): +def _get_layer_info(layer_path, lconf=None, data=None): + """ + Parse a layer's layer.conf and return a dict with its LAYERNAME, the names + of the layers it depends upon and the release series it is compatible with. + """ import bb.parse import bb.data @@ -49,28 +53,22 @@ def _get_layer_collections(layer_path, lconf=None, data=None): raise RuntimeError("Parsing of layer.conf from layer: %s failed" % layer_path) ldata.expandVarref('LAYERDIR') - collections = (ldata.getVar('BBFILE_COLLECTIONS') or '').split() - if not collections: - name = os.path.basename(layer_path) - collections = [name] - - collections = {c: {} for c in collections} - for name in collections: - priority = ldata.getVar('BBFILE_PRIORITY_%s' % name) - pattern = ldata.getVar('BBFILE_PATTERN_%s' % name) - depends = ldata.getVar('LAYERDEPENDS_%s' % name) - compat = ldata.getVar('LAYERSERIES_COMPAT_%s' % name) - try: - depDict = bb.utils.explode_dep_versions2(depends or "") - except bb.utils.VersionStringException as vse: - bb.fatal('Error parsing LAYERDEPENDS_%s: %s' % (name, str(vse))) + layername = ldata.getVar('LAYERNAME') or os.path.basename(layer_path) - collections[name]['priority'] = priority - collections[name]['pattern'] = pattern - collections[name]['depends'] = ' '.join(depDict.keys()) - collections[name]['compat'] = compat + def getVar(var): + return ldata.getVar(var) or ldata.getVar('%s_%s' % (var, layername)) + + try: + depDict = bb.utils.explode_dep_versions2(getVar('LAYERDEPENDS') or "") + except bb.utils.VersionStringException as vse: + bb.fatal('Error parsing LAYERDEPENDS for layer %s: %s' % (layername, str(vse))) - return collections + return { + 'layername': layername, + 'has_layername': bool(ldata.getVar('LAYERNAME')), + 'depends': ' '.join(depDict.keys()), + 'compat': getVar('LAYERSERIES_COMPAT'), + } def _detect_layer(layer_path): """ @@ -107,9 +105,9 @@ def _detect_layer(layer_path): if distros: is_distro = True - layer['collections'] = _get_layer_collections(layer['path']) + layer.update(_get_layer_info(layer['path'])) - if layer_name == "meta" and "core" in layer['collections']: + if layer_name == "meta" and layer['layername'] == "oe-core": layer['type'] = LayerType.CORE layer['conf']['machines'] = machines layer['conf']['distros'] = distros @@ -153,33 +151,28 @@ def detect_layers(layer_directories, no_auto): def _find_layer(depend, layers): for layer in layers: - if 'collections' not in layer: - continue - - for collection in layer['collections']: - if depend == collection: - return layer + if layer.get('layername') == depend: + return layer return None def sanity_check_layers(layers, logger): """ - Check that we didn't find duplicate collection names, as the layer that will - be used is non-deterministic. The precise check is duplicate collections - with different patterns, as the same pattern being repeated won't cause - problems. + Check that we didn't find duplicate layer names (LAYERNAME), as the layer + that will be used is non-deterministic and bitbake will refuse to use + both together. """ import collections passed = True seen = collections.defaultdict(set) for layer in layers: - for name, data in layer.get("collections", {}).items(): - seen[name].add(data["pattern"]) + if 'layername' in layer: + seen[layer['layername']].add(layer['path']) - for name, patterns in seen.items(): - if len(patterns) > 1: + for name, paths in seen.items(): + if len(paths) > 1: passed = False - logger.error("Collection %s found multiple times: %s" % (name, ", ".join(patterns))) + logger.error("Layer name %s found multiple times: %s" % (name, ", ".join(sorted(paths)))) return passed def get_layer_dependencies(layer, layers, logger): @@ -188,8 +181,8 @@ def get_layer_dependencies(layer, layers, logger): (depends, layer['name'])) for depend in depends.split(): - # core (oe-core) is suppose to be provided - if depend == 'core': + # oe-core is supposed to be provided + if depend == 'oe-core': continue layer_depend = _find_layer(depend, layers) @@ -209,24 +202,14 @@ def get_layer_dependencies(layer, layers, logger): continue # Recursively process... - if 'collections' not in layer_depend: - continue - - for collection in layer_depend['collections']: - collect_deps = layer_depend['collections'][collection]['depends'] - if not collect_deps: - continue - ret = recurse_dependencies(collect_deps, layer_depend, layers, logger, ret) + if layer_depend.get('depends'): + ret = recurse_dependencies(layer_depend['depends'], layer_depend, layers, logger, ret) return ret layer_depends = [] - for collection in layer['collections']: - depends = layer['collections'][collection]['depends'] - if not depends: - continue - - layer_depends = recurse_dependencies(depends, layer, layers, logger, layer_depends) + if layer.get('depends'): + layer_depends = recurse_dependencies(layer['depends'], layer, layers, logger, layer_depends) # Note: [] (empty) is allowed, None is not! return layer_depends diff --git a/scripts/lib/checklayer/cases/common.py b/scripts/lib/checklayer/cases/common.py index 812bb6e637d..67610fa36ba 100644 --- a/scripts/lib/checklayer/cases/common.py +++ b/scripts/lib/checklayer/cases/common.py @@ -146,7 +146,10 @@ class CommonCheckLayer(OECheckLayerTestCase): if msg is not None: self.fail('Adding layer %s changed signatures.\n%s' % (self.tc.layer['name'], msg)) + def test_layername(self): + self.assertTrue(self.tc.layer['has_layername'], "Layer %s does not set LAYERNAME in conf/layer.conf." \ + % self.tc.layer['name']) + def test_layerseries_compat(self): - for collection_name, collection_data in self.tc.layer['collections'].items(): - self.assertTrue(collection_data['compat'], "Collection %s from layer %s does not set compatible oe-core versions via LAYERSERIES_COMPAT_collection." \ - % (collection_name, self.tc.layer['name'])) + self.assertTrue(self.tc.layer['compat'], "Layer %s (%s) does not set compatible oe-core versions via LAYERSERIES_COMPAT." \ + % (self.tc.layer['layername'], self.tc.layer['name'])) diff --git a/scripts/yocto-check-layer b/scripts/yocto-check-layer index 9b00bf5b8f2..d98a14c9f52 100755 --- a/scripts/yocto-check-layer +++ b/scripts/yocto-check-layer @@ -44,9 +44,8 @@ def test_layer(td, layer, test_software_layer_signatures, run_tests): def dump_layer_debug(layer): logger.debug("Found layer %s (%s)" % (layer["name"], layer["path"])) - collections = layer.get("collections", {}) - if collections: - logger.debug("%s collections: %s" % (layer["name"], ", ".join(collections))) + if "layername" in layer: + logger.debug("%s layer name: %s" % (layer["name"], layer["layername"])) def validate_layers(layers): valid_layers = []