diff mbox series

layer.conf: add a bb_min_version statement to perform an early bitbake version check

Message ID 20251027181238.3798758-1-alex.kanavin@gmail.com
State New
Headers show
Series layer.conf: add a bb_min_version statement to perform an early bitbake version check | expand

Commit Message

Alexander Kanavin Oct. 27, 2025, 6:12 p.m. UTC
From: Alexander Kanavin <alex@linutronix.de>

Please see the corresponding change in bitbake for the rationale:
https://lists.openembedded.org/g/bitbake-devel/message/18223

This change also means the identical later check in sanity will never fail, and so
that can be removed.

Signed-off-by: Alexander Kanavin <alex@linutronix.de>
---
 meta/classes-global/sanity.bbclass | 5 -----
 meta/conf/layer.conf               | 3 +++
 meta/conf/sanity.conf              | 2 --
 3 files changed, 3 insertions(+), 7 deletions(-)
diff mbox series

Patch

diff --git a/meta/classes-global/sanity.bbclass b/meta/classes-global/sanity.bbclass
index 6934e071a3d..bdd4d1474ef 100644
--- a/meta/classes-global/sanity.bbclass
+++ b/meta/classes-global/sanity.bbclass
@@ -845,11 +845,6 @@  def check_sanity_everybuild(status, d):
     if sys.hexversion < 0x030900F0:
         status.addresult('The system requires at least Python 3.9 to run. Please update your Python interpreter.\n')
 
-    # Check the bitbake version meets minimum requirements
-    minversion = d.getVar('BB_MIN_VERSION')
-    if bb.utils.vercmp_string_op(bb.__version__, minversion, "<"):
-        status.addresult('Bitbake version %s is required and version %s was found\n' % (minversion, bb.__version__))
-
     sanity_check_locale(d)
 
     paths = d.getVar('PATH').split(":")
diff --git a/meta/conf/layer.conf b/meta/conf/layer.conf
index 54fa04e213e..d6dbad040c2 100644
--- a/meta/conf/layer.conf
+++ b/meta/conf/layer.conf
@@ -1,3 +1,6 @@ 
+BB_MIN_VERSION = "2.15.2"
+bitbake_min_version ${BB_MIN_VERSION}
+
 # We have a conf and classes directory, add to BBPATH
 BBPATH .= ":${LAYERDIR}"
 # We have recipes-* directories, add to BBFILES
diff --git a/meta/conf/sanity.conf b/meta/conf/sanity.conf
index 71828542748..602a7701f4c 100644
--- a/meta/conf/sanity.conf
+++ b/meta/conf/sanity.conf
@@ -3,8 +3,6 @@ 
 # See sanity.bbclass
 #
 # Expert users can confirm their sanity with "touch conf/sanity.conf"
-BB_MIN_VERSION = "2.15.2"
-
 SANITY_ABIFILE = "${TMPDIR}/abi_version"
 
 SANITY_VERSION ?= "1"