Skip to contentSkip to conversation

Use more descriptive variable for skipping recipes

PATCH In review Saul Wold 3 participants 8 messages Feb 4, 2022 – Feb 8, 2022

lore
Share & tools
lore

Saul Wold

author
#0 lore raw

cover Use more descriptive variable for skipping recipes

This patchset in conjuction with a meta-yocto and documentation patch change the varFlag for skipping a recipe to be SKIP_RECIPE. This removes the need to have to explicitly use the class by moving the code to base.bbclass.

Tested with the Autobuilder (a-quick) and by using the PNBLACKLIST variable.

Sau!

Saul Wold (5):
skip_recipe: remove old class and rename VarFlag to SKIP_RECIPE
imagefeatures: selftest: Change variable to be more descriptive
multilib: Use renamed SKIP_RECIPE varFlag
dnf: Use renamed SKIP_RECIPE varFlag
documentation: Update for skip_recipe rename

 meta/classes/base.bbclass                     | 10 ++++++++++
 meta/classes/blacklist.bbclass                | 20 -------------------
 meta/classes/multilib.bbclass                 |  8 ++++----
 meta/conf/distro/defaultsetup.conf            |  3 +--
 meta/conf/documentation.conf                  |  2 +-
 meta/lib/oeqa/selftest/cases/imagefeatures.py |  8 ++++----
 meta/recipes-devtools/dnf/dnf_4.10.0.bb       |  2 +-
 meta/recipes-devtools/libdnf/libdnf_0.65.0.bb |  2 +-
 8 files changed, 22 insertions(+), 33 deletions(-)
 delete mode 100644 meta/classes/blacklist.bbclass
Signature · 1 line
2.31.1
author
#1 lore raw

PATCH 1/5 skip_recipe: remove old class and rename VarFlag to SKIP_RECIPE

This change better describes what the VarFlag is doing since it is implemeted with the SkipRecipe() function.

By moving this into base.bbclass we simplify the distro inherit.

---
 meta/classes/base.bbclass          | 10 ++++++++++
 meta/classes/blacklist.bbclass     | 20 --------------------
 meta/conf/distro/defaultsetup.conf |  3 +--
 3 files changed, 11 insertions(+), 22 deletions(-)
 delete mode 100644 meta/classes/blacklist.bbclass
meta/classes/base.bbclass +10 -0
index 5f4956a1d31..854d14d8a51 100644
@@ -438,6 +438,16 @@ python () {
     if os.path.normpath(d.getVar("WORKDIR")) != os.path.normpath(d.getVar("B")):
         d.appendVar("PSEUDO_IGNORE_PATHS", ",${B}")
 
+    # To add a recipe to the skip list , set:
+    #   SKIP_RECIPE[pn] = "message"
+    pn = d.getVar('PN')
+    if d.getVarFlag('PNBLACKLIST', pn) is not None:
+        bb.error("PNBLACKLIST is deprecated, please convert to SKIP_RECIPE[%s]" % (pn))
+    skip_msg = d.getVarFlag('SKIP_RECIPE', pn)
+    if skip_msg:
+        bb.debug(1, "Skipping %s %s" % (pn, skip_msg))
+        raise bb.parse.SkipRecipe("Recipe will be skipped because: %s" % (skip_msg))
+
     # Handle PACKAGECONFIG
     #
     # These take the form:
meta/classes/blacklist.bbclass deleted +0 -20
deleted file mode 100644
index dc794228ffe..00000000000
@@ -1,20 +0,0 @@
-# anonymous support class from originally from angstrom
-# 
-# To use the blacklist, a distribution should include this
-# class in the INHERIT_DISTRO
-#
-# No longer use ANGSTROM_BLACKLIST, instead use a table of
-# recipes in PNBLACKLIST
-#
-# Features:
-#
-# * To add a package to the blacklist, set:
-#   PNBLACKLIST[pn] = "message"
-#
-
-python () {
-    blacklist = d.getVarFlag('PNBLACKLIST', d.getVar('PN'))
-
-    if blacklist:
-        raise bb.parse.SkipRecipe("Recipe is blacklisted: %s" % (blacklist))
-}
meta/conf/distro/defaultsetup.conf +1 -2
index b36a4ffffe5..f6894f3ab56 100644
@@ -14,9 +14,8 @@ TMPDIR .= "${TCLIBCAPPEND}"
 
 USER_CLASSES ?= ""
 PACKAGE_CLASSES ?= "package_ipk"
-INHERIT_BLACKLIST = "blacklist"
 INHERIT_DISTRO ?= "debian devshell sstate license remove-libtool"
-INHERIT += "${PACKAGE_CLASSES} ${USER_CLASSES} ${INHERIT_DISTRO} ${INHERIT_BLACKLIST}"
+INHERIT += "${PACKAGE_CLASSES} ${USER_CLASSES} ${INHERIT_DISTRO}"
 
 INIT_MANAGER ??= "none"
 require conf/distro/include/init-manager-${INIT_MANAGER}.inc
Signature · 1 line
2.31.1
#2 lore raw

RE: [OE-core] [PATCH 1/5] skip_recipe: remove old class and rename VarFlag to SKIP_RECIPE

Quoted 9 lines

-----Original Message-----
From: [email protected] <[email protected]> On Behalf Of Saul Wold
Sent: den 4 februari 2022 18:02
To: [email protected]
Cc: Saul Wold <[email protected]>
Subject: [OE-core] [PATCH 1/5] skip_recipe: remove old class and rename VarFlag to SKIP_RECIPE

This change better describes what the VarFlag is doing since it is implemeted with the SkipRecipe() function.

Change "implemeted" to " implemented".

Quoted 20 lines

By moving this into base.bbclass we simplify the distro inherit.

---
 meta/classes/base.bbclass          | 10 ++++++++++
 meta/classes/blacklist.bbclass     | 20 --------------------
 meta/conf/distro/defaultsetup.conf |  3 +--
 3 files changed, 11 insertions(+), 22 deletions(-)
 delete mode 100644 meta/classes/blacklist.bbclass
meta/classes/base.bbclass +0 -0
index 5f4956a1d31..854d14d8a51 100644
@@ -438,6 +438,16 @@ python () {
     if os.path.normpath(d.getVar("WORKDIR")) !=

os.path.normpath(d.getVar("B")):

         d.appendVar("PSEUDO_IGNORE_PATHS", ",${B}")

meta/classes/base.bbclass python () { · line 446

Quoted 6 lines
meta/classes/base.bbclass +6 -0
+    # To add a recipe to the skip list , set:
+    #   SKIP_RECIPE[pn] = "message"
+    pn = d.getVar('PN')
+    if d.getVarFlag('PNBLACKLIST', pn) is not None:
+        bb.error("PNBLACKLIST is deprecated, please convert to SKIP_RECIPE[%s]" % (pn))
+    skip_msg = d.getVarFlag('SKIP_RECIPE', pn)

Is there any reason this is a varflag rather than an override? I.e., why is it SKIP_RECIPE[foo] rather than SKIP_RECIPE:foo or SKIP_RECIPE:pn-foo)?

Quoted 49 lines
meta/classes/base.bbclass +4 -0
+    if skip_msg:
+        bb.debug(1, "Skipping %s %s" % (pn, skip_msg))
+        raise bb.parse.SkipRecipe("Recipe will be skipped because: %s" % (skip_msg))
+
     # Handle PACKAGECONFIG
     #
     # These take the form:
meta/classes/blacklist.bbclass deleted +0 -20
deleted file mode 100644
index dc794228ffe..00000000000
@@ -1,20 +0,0 @@
-# anonymous support class from originally from angstrom
-#
-# To use the blacklist, a distribution should include this
-# class in the INHERIT_DISTRO
-#
-# No longer use ANGSTROM_BLACKLIST, instead use a table of
-# recipes in PNBLACKLIST
-#
-# Features:
-#
-# * To add a package to the blacklist, set:
-#   PNBLACKLIST[pn] = "message"
-#
-
-python () {
-    blacklist = d.getVarFlag('PNBLACKLIST', d.getVar('PN'))
-
-    if blacklist:
-        raise bb.parse.SkipRecipe("Recipe is blacklisted: %s" % (blacklist))
-}
meta/conf/distro/defaultsetup.conf +1 -3
index b36a4ffffe5..f6894f3ab56 100644
@@ -14,9 +14,8 @@ TMPDIR .= "${TCLIBCAPPEND}"
 
 USER_CLASSES ?= ""
 PACKAGE_CLASSES ?= "package_ipk"
-INHERIT_BLACKLIST = "blacklist"
 INHERIT_DISTRO ?= "debian devshell sstate license remove-libtool"
-INHERIT += "${PACKAGE_CLASSES} ${USER_CLASSES} ${INHERIT_DISTRO} ${INHERIT_BLACKLIST}"
+INHERIT += "${PACKAGE_CLASSES} ${USER_CLASSES} ${INHERIT_DISTRO}"
 
 INIT_MANAGER ??= "none"
 require conf/distro/include/init-manager-${INIT_MANAGER}.inc
--
Quoted 1 line

2.31.1

//Peter

author
#3 lore raw

PATCH 2/5 imagefeatures: selftest: Change variable to be more descriptive

In reply to Saul Wold

This changes a couple of variables to be more representive of their usage.

---
 meta/lib/oeqa/selftest/cases/imagefeatures.py | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)
meta/lib/oeqa/selftest/cases/imagefeatures.py +4 -4
index 18f37c6d7d9..d36d45c5516 100644
@@ -198,8 +198,8 @@ class ImageFeatures(OESelftestTestCase):
         image_name = 'core-image-minimal'
 
         all_image_types = set(get_bb_var("IMAGE_TYPES", image_name).split())
-        blacklist = set(('container', 'elf', 'f2fs', 'multiubi', 'tar.zst', 'wic.zst'))
-        img_types = all_image_types - blacklist
+        skip_image_types = set(('container', 'elf', 'f2fs', 'multiubi', 'tar.zst', 'wic.zst'))
+        img_types = all_image_types - skip_image_types
 
         config = 'IMAGE_FSTYPES += "%s"\n'\
                  'MKUBIFS_ARGS ?= "-m 2048 -e 129024 -c 2047"\n'\
@@ -245,8 +245,8 @@ VIRTUAL-RUNTIME_base-utils = "packagegroup-core-base-utils"
 VIRTUAL-RUNTIME_base-utils-hwclock = "util-linux-hwclock"
 VIRTUAL-RUNTIME_base-utils-syslog = ""
 
-# Blacklist busybox
-PNBLACKLIST[busybox] = "Don't build this"
+# Skip busybox
+SKIP_RECIPE[busybox] = "Don't build this"
 """
         self.write_config(config)
 
Signature · 1 line
2.31.1
author
#4 lore raw

PATCH 3/5 multilib: Use renamed SKIP_RECIPE varFlag

In reply to Saul Wold

This is a more descriptive variable name updated in base.bbclass

---
 meta/classes/multilib.bbclass | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)
meta/classes/multilib.bbclass +4 -4
index 4a3e582816d..ec2013198ce 100644
@@ -65,11 +65,11 @@ python multilib_virtclass_handler () {
  
     override = ":virtclass-multilib-" + variant
 
-    blacklist = e.data.getVarFlag('PNBLACKLIST', e.data.getVar('PN'))
-    if blacklist:
+    skip_msg = e.data.getVarFlag('SKIP_RECIPE', e.data.getVar('PN'))
+    if skip_msg:
         pn_new = variant + "-" + e.data.getVar('PN')
-        if not e.data.getVarFlag('PNBLACKLIST', pn_new):
-            e.data.setVarFlag('PNBLACKLIST', pn_new, blacklist)
+        if not e.data.getVarFlag('SKIP_RECIPE', pn_new):
+            e.data.setVarFlag('SKIP_RECIPE', pn_new, skip_msg)
 
     e.data.setVar("MLPREFIX", variant + "-")
     e.data.setVar("PN", variant + "-" + e.data.getVar("PN", False))
Signature · 1 line
2.31.1
author
#5 lore raw

PATCH 4/5 dnf: Use renamed SKIP_RECIPE varFlag

In reply to Saul Wold

This is a more descriptive variable name updated in base.bbclass

---
 meta/recipes-devtools/dnf/dnf_4.10.0.bb       | 2 +-
 meta/recipes-devtools/libdnf/libdnf_0.65.0.bb | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)
meta/recipes-devtools/dnf/dnf_4.10.0.bb +1 -1
index 3fc24b132df..3f22c1d8f2e 100644
@@ -87,4 +87,4 @@ SYSTEMD_SERVICE:${PN} = "dnf-makecache.service dnf-makecache.timer \
 "
 SYSTEMD_AUTO_ENABLE ?= "disable"
 
-PNBLACKLIST[dnf] ?= "${@bb.utils.contains('PACKAGE_CLASSES', 'package_rpm', '', 'does not build without package_rpm in PACKAGE_CLASSES due disabled rpm support in libsolv', d)}"
+SKIP_RECIPE[dnf] ?= "${@bb.utils.contains('PACKAGE_CLASSES', 'package_rpm', '', 'does not build without package_rpm in PACKAGE_CLASSES due disabled rpm support in libsolv', d)}"
meta/recipes-devtools/libdnf/libdnf_0.65.0.bb +1 -1
index 81da04c9ca1..092ad98d4b7 100644
@@ -34,5 +34,5 @@ EXTRA_OECMAKE:append:class-native = " -DWITH_GIR=OFF"
 EXTRA_OECMAKE:append:class-nativesdk = " -DWITH_GIR=OFF"
 
 BBCLASSEXTEND = "native nativesdk"
-PNBLACKLIST[libdnf] ?= "${@bb.utils.contains('PACKAGE_CLASSES', 'package_rpm', '', 'Does not build without package_rpm in PACKAGE_CLASSES due disabled rpm support in libsolv', d)}"
+SKIP_RECIPE[libdnf] ?= "${@bb.utils.contains('PACKAGE_CLASSES', 'package_rpm', '', 'Does not build without package_rpm in PACKAGE_CLASSES due disabled rpm support in libsolv', d)}"
 
Signature · 1 line
2.31.1
author
#6 lore raw

PATCH 5/5 documentation: Update for skip_recipe rename

In reply to Saul Wold

This change better aligns the name of the variable with it's purpose. Since we removed the odler class, the associated documentation is also removed.

---
 meta/conf/documentation.conf | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
meta/conf/documentation.conf +1 -1
index 6b50ad08a8b..9614448a1fe 100644
@@ -331,7 +331,6 @@ PKGDATA_DIR[doc] = "Points to a shared, global-state directory that holds data g
 PKGDEST[doc] = "Points to the parent directory for files to be packaged after they have been split into individual packages."
 PKGDESTWORK[doc] = "Points to a temporary work area used by the do_package task to write output from the do_packagedata task."
 PN[doc] = "PN refers to a recipe name in the context of a file used by the OpenEmbedded build system as input to create a package. It refers to a package name in the context of a file created or produced by the OpenEmbedded build system."
-PNBLACKLIST[doc] = "Lists recipes you do not want the OpenEmbedded build system to build."
 PR[doc] = "The revision of the recipe. The default value for this variable is 'r0'."
 PREFERRED_PROVIDER[doc] = "If multiple recipes provide an item, this variable determines which recipe should be given preference."
 PREFERRED_VERSION[doc] = "If there are multiple versions of recipes available, this variable determines which recipe should be given preference."
@@ -385,6 +384,7 @@ SIGGEN_EXCLUDE_SAFE_RECIPE_DEPS[doc] = "A list of recipe dependencies that shoul
 SIGGEN_EXCLUDERECIPES_ABISAFE[doc] = "A list of recipes that are completely stable and will never change."
 SITEINFO_BITS[doc] = "Specifies the number of bits for the target system CPU."
 SITEINFO_ENDIANNESS[doc] = "Specifies the endian byte order of the target system. The value should be either 'le' for 'little-endian' or 'be' for 'big-endian'."
+SKIP_RECIPE[doc] = "Lists recipes you do not want the OpenEmbedded build system to build."
 SOC_FAMILY[doc] = "Groups together machines based upon the same family of SOC (System On Chip). You typically set this variable in a common .inc file that you include in the configuration files of all the machines."
 SOLIBS[doc] = "Defines the suffix for shared libraries used on the target platform."
 SOLIBSDEV[doc] = "Defines the suffix for the development symbolic link (symlink) for shared libraries on the target platform."
Signature · 1 line
2.31.1
#7 lore raw

Re: [OE-core] [PATCH 5/5] documentation: Update for skip_recipe rename

Hi Saul,

Quoted 22 lines · Saul Wold

This change better aligns the name of the variable with it's purpose. Since we removed the odler class, the associated documentation is also removed.

---
  meta/conf/documentation.conf | 2 +-
  1 file changed, 1 insertion(+), 1 deletion(-)
meta/conf/documentation.conf +0 -1
index 6b50ad08a8b..9614448a1fe 100644
@@ -331,7 +331,6 @@ PKGDATA_DIR[doc] = "Points to a shared, global-state directory that holds data g
  PKGDEST[doc] = "Points to the parent directory for files to be packaged after they have been split into individual packages."
  PKGDESTWORK[doc] = "Points to a temporary work area used by the do_package task to write output from the do_packagedata task."
  PN[doc] = "PN refers to a recipe name in the context of a file used by the OpenEmbedded build system as input to create a package. It refers to a package name in the context of a file created or produced by the OpenEmbedded build system."
-PNBLACKLIST[doc] = "Lists recipes you do not want the OpenEmbedded build system to build."
  PR[doc] = "The revision of the recipe. The default value for this variable is 'r0'."
  PREFERRED_PROVIDER[doc] = "If multiple recipes provide an item, this variable determines which recipe should be given preference."
  PREFERRED_VERSION[doc] = "If there are multiple versions of recipes available, this variable determines which recipe should be given preference."

meta/conf/documentation.conf SIGGEN_EXCLUDE_SAFE_RECIPE_DEPS[doc] = "A list of recipe dependencies that shoul · line 387

Quoted 4 lines
meta/conf/documentation.conf +1 -0
@@ -385,6 +384,7 @@ SIGGEN_EXCLUDE_SAFE_RECIPE_DEPS[doc] = "A list of recipe dependencies that shoul
  SIGGEN_EXCLUDERECIPES_ABISAFE[doc] = "A list of recipes that are completely stable and will never change."
  SITEINFO_BITS[doc] = "Specifies the number of bits for the target system CPU."
  SITEINFO_ENDIANNESS[doc] = "Specifies the endian byte order of the target system. The value should be either 'le' for 'little-endian' or 'be' for 'big-endian'."
+SKIP_RECIPE[doc] = "Lists recipes you do not want the OpenEmbedded build system to build."

Mmm with this sentence I would basically try to use it this way:

SKIP_RECIPE += "libndf"

instead of SKIP_RECIPE[libdnf] = "message to be printed"

I think we can do better :)

Maybe add something like "e.g. SKIP_RECIPE[my-recipe] = "This is the reason for skipping this recipe"" at the end of the sentence?

Also, can you add some words in documentation/migration-guides/migration-3.5.rst in yocto-docs to explain this migration so we don't forget about it before the release :) ?

Thanks!
Cheers,
Quentin

Quoted 14 lines
meta/conf/documentation.conf +0 -1
  SOC_FAMILY[doc] = "Groups together machines based upon the same family of SOC (System On Chip). You typically set this variable in a common .inc file that you include in the configuration files of all the machines."
  SOLIBS[doc] = "Defines the suffix for shared libraries used on the target platform."
  SOLIBSDEV[doc] = "Defines the suffix for the development symbolic link (symlink) for shared libraries on the target platform."
 
 
 
-=-=-=-=-=-=-=-=-=-=-=-

Links: You receive all messages sent to this group.
View/Reply Online (#161370): https://urldefense.proofpoint.com/v2/url?u=https-3A__lists.openembedded.org_g_openembedded-2Dcore_message_161370&d=DwIFaQ&c=_sEr5x9kUWhuk4_nFwjJtA&r=LYjLexDn7rXIzVmkNPvw5ymA1XTSqHGq8yBP6m6qZZ4njZguQhZhkI_-172IIy1t&m=uiHZKRqLMObgXqpXUwRFi8y7UtEaiVhDs8cQdPQk0Tdl2K_q3sYbssh1fwYeBTYV&s=dbpnhNdhY-cK8zLxdt9j35m75kaNaiam5c8Uj8YG66E&e=
Mute This Topic: https://urldefense.proofpoint.com/v2/url?u=https-3A__lists.openembedded.org_mt_88911226_6293953&d=DwIFaQ&c=_sEr5x9kUWhuk4_nFwjJtA&r=LYjLexDn7rXIzVmkNPvw5ymA1XTSqHGq8yBP6m6qZZ4njZguQhZhkI_-172IIy1t&m=uiHZKRqLMObgXqpXUwRFi8y7UtEaiVhDs8cQdPQk0Tdl2K_q3sYbssh1fwYeBTYV&s=N3WJTb7jcA-mNcna2UbtcBfV9fXbBYnRGcDLzvyL3sE&e=
Group Owner: [email protected]
Unsubscribe: https://urldefense.proofpoint.com/v2/url?u=https-3A__lists.openembedded.org_g_openembedded-2Dcore_unsub&d=DwIFaQ&c=_sEr5x9kUWhuk4_nFwjJtA&r=LYjLexDn7rXIzVmkNPvw5ymA1XTSqHGq8yBP6m6qZZ4njZguQhZhkI_-172IIy1t&m=uiHZKRqLMObgXqpXUwRFi8y7UtEaiVhDs8cQdPQk0Tdl2K_q3sYbssh1fwYeBTYV&s=nXnfk2h1SI1tLsRNpDucivTBifk_qM77Ldm0sTsIKQw&e= [[email protected]]
-=-=-=-=-=-=-=-=-=-=-=-