Skip to contentSkip to conversation

insane: make patch upstream-status configurable

RFC PATCH Superseded Konrad Weihmann 2 participants 3 messages Dec 15, 2021 2 messages not in the archive

v1 of 2 Superseded Latest is v2 →

lore
Share & tools
lore

A message that is not in the archive (sent off-list or not yet received): [email protected]

#1 lore raw

RFC PATCH 2/2 insane: make patch upstream-status configurable

instead of hard coding /meta/ into a skip condition introduce a variable called QA_PATCH_CHECK_LAYER containing a space separated list of layer names to perform the upstrem-status check against.

as this will add BBFILE_PATTERN_* and therefore host specific paths to the task hash, we need to exclude do_qa_patch function from task hashing.
As it is a postfunc it should run anyway, once do_patch needs to rerun

---
 meta/classes/insane.bbclass | 10 ++++++++--
 1 file changed, 8 insertions(+), 2 deletions(-)
meta/classes/insane.bbclass +8 -2
index 240f3aad62..c19cc6f629 100644
@@ -65,6 +65,8 @@ QA_EMPTY_DIRS ?= " \
 # message if the directory is not empty. If it is not specified for a directory,
 # then "but it is expected to be empty" will be used.
 
+QA_PATCH_CHECK_LAYER ?= "core"
+
 def package_qa_clean_path(path, d, pkg=None):
     """
     Remove redundant paths from the path for display.  If pkg isn't set then
@@ -1171,12 +1173,15 @@ python do_qa_patch() {
     # Check if the patch contains a correctly formatted and spelled Upstream-Status
     import re
     from oe import patch
+    from oe.recipeutils import get_layer_name
+
+    check_layer = (d.getVar("QA_PATCH_CHECK_LAYER") or "").split()
 
     for url in patch.src_patches(d):
        (_, _, fullpath, _, _, _) = bb.fetch.decodeurl(url)
 
-       # skip patches not in oe-core
-       if '/meta/' not in fullpath:
+       # skip patches in all but the configured ones
+       if get_layer_name(fullpath, d) not in check_layer:
            continue
 
        content = open(fullpath, encoding='utf-8', errors='ignore').read()
@@ -1298,6 +1303,7 @@ do_populate_sysroot[postfuncs] += "do_qa_staging "
 
 # Check for patch fuzz
 do_patch[postfuncs] += "do_qa_patch "
+do_patch[vardepsexclude] += "do_qa_patch "
 
 # Check broken config.log files, for packages requiring Gettext which
 # don't have it in DEPENDS.
Signature · 1 line
2.25.1

A message that is not in the archive (sent off-list or not yet received): [email protected]

#3 lore raw

Picking up where Alex left it last time, this proposes a different way to make the layers where the Upstream-Status check is run configurable.

Please share your thoughs - esp. about the vardepsexclude, as I so far don't see any other option to get rid of the BBFILE_PATTERN creeping into the task hash

Quoted 65 lines · Konrad Weihmann

instead of hard coding /meta/ into a skip condition introduce a variable called QA_PATCH_CHECK_LAYER containing a space separated list of layer names to perform the upstrem-status check against.

as this will add BBFILE_PATTERN_* and therefore host specific paths to the task hash, we need to exclude do_qa_patch function from task hashing.
As it is a postfunc it should run anyway, once do_patch needs to rerun

---
  meta/classes/insane.bbclass | 10 ++++++++--
  1 file changed, 8 insertions(+), 2 deletions(-)
meta/classes/insane.bbclass +8 -3
index 240f3aad62..c19cc6f629 100644
@@ -65,6 +65,8 @@ QA_EMPTY_DIRS ?= " \
  # message if the directory is not empty. If it is not specified for a directory,
  # then "but it is expected to be empty" will be used.
 
+QA_PATCH_CHECK_LAYER ?= "core"
+
  def package_qa_clean_path(path, d, pkg=None):
      """
      Remove redundant paths from the path for display.  If pkg isn't set then
@@ -1171,12 +1173,15 @@ python do_qa_patch() {
      # Check if the patch contains a correctly formatted and spelled Upstream-Status
      import re
      from oe import patch
+    from oe.recipeutils import get_layer_name
+
+    check_layer = (d.getVar("QA_PATCH_CHECK_LAYER") or "").split()
 
      for url in patch.src_patches(d):
         (_, _, fullpath, _, _, _) = bb.fetch.decodeurl(url)
 
-       # skip patches not in oe-core
-       if '/meta/' not in fullpath:
+       # skip patches in all but the configured ones
+       if get_layer_name(fullpath, d) not in check_layer:
             continue
 
         content = open(fullpath, encoding='utf-8', errors='ignore').read()
@@ -1298,6 +1303,7 @@ do_populate_sysroot[postfuncs] += "do_qa_staging "
 
  # Check for patch fuzz
  do_patch[postfuncs] += "do_qa_patch "
+do_patch[vardepsexclude] += "do_qa_patch "
 
  # Check broken config.log files, for packages requiring Gettext which
  # don't have it in DEPENDS.
 
 
 
-=-=-=-=-=-=-=-=-=-=-=-

Links: You receive all messages sent to this group.
View/Reply Online (#159718): https://lists.openembedded.org/g/openembedded-core/message/159718
Mute This Topic: https://lists.openembedded.org/mt/87741230/3647476
Group Owner: [email protected]
Unsubscribe: https://lists.openembedded.org/g/openembedded-core/unsub [[email protected]]
-=-=-=-=-=-=-=-=-=-=-=-

#4 lore raw

I don't have any immediate objections :)

Alex

Quoted 80 lines · Konrad Weihmann

Picking up where Alex left it last time, this proposes a different way to make the layers where the Upstream-Status check is run configurable.

Please share your thoughs - esp. about the vardepsexclude, as I so far don't see any other option to get rid of the BBFILE_PATTERN creeping into the task hash

Quoted 20 lines · Konrad Weihmann

instead of hard coding /meta/ into a skip condition introduce a variable called QA_PATCH_CHECK_LAYER containing a space separated list of layer names to perform the upstrem-status check against.

as this will add BBFILE_PATTERN_* and therefore host specific paths to the task hash, we need to exclude do_qa_patch function from task hashing.
As it is a postfunc it should run anyway, once do_patch needs to rerun

---
  meta/classes/insane.bbclass | 10 ++++++++--
  1 file changed, 8 insertions(+), 2 deletions(-)
meta/classes/insane.bbclass +0 -0
index 240f3aad62..c19cc6f629 100644

meta/classes/insane.bbclass QA_EMPTY_DIRS ?= " \ · line 65

Quoted 1 line
meta/classes/insane.bbclass +0 -0
@@ -65,6 +65,8 @@ QA_EMPTY_DIRS ?= " \
  # message if the directory is not empty. If it is not specified for a

directory,

meta/classes/insane.bbclass QA_EMPTY_DIRS ?= " \ · line 72

Quoted 7 lines
meta/classes/insane.bbclass +2 -0
  # then "but it is expected to be empty" will be used.
 
+QA_PATCH_CHECK_LAYER ?= "core"
+
  def package_qa_clean_path(path, d, pkg=None):
      """
      Remove redundant paths from the path for display.  If pkg isn't

set then

meta/classes/insane.bbclass python do_qa_patch() { · line 1173

Quoted 2 lines
meta/classes/insane.bbclass +0 -0
@@ -1171,12 +1173,15 @@ python do_qa_patch() {
      # Check if the patch contains a correctly formatted and spelled

Upstream-Status

Quoted 6 lines
meta/classes/insane.bbclass +3 -0
      import re
      from oe import patch
+    from oe.recipeutils import get_layer_name
+
+    check_layer = (d.getVar("QA_PATCH_CHECK_LAYER") or "").split()
 

meta/classes/insane.bbclass python do_qa_patch() { · line 1187

Quoted 10 lines
meta/classes/insane.bbclass +2 -2
      for url in patch.src_patches(d):
         (_, _, fullpath, _, _, _) = bb.fetch.decodeurl(url)
 
-       # skip patches not in oe-core
-       if '/meta/' not in fullpath:
+       # skip patches in all but the configured ones
+       if get_layer_name(fullpath, d) not in check_layer:
             continue
 
         content = open(fullpath, encoding='utf-8',

errors='ignore').read()

Quoted 12 lines
meta/classes/insane.bbclass +1 -1
@@ -1298,6 +1303,7 @@ do_populate_sysroot[postfuncs] += "do_qa_staging "
 
  # Check for patch fuzz
  do_patch[postfuncs] += "do_qa_patch "
+do_patch[vardepsexclude] += "do_qa_patch "
 
  # Check broken config.log files, for packages requiring Gettext which
  # don't have it in DEPENDS.
 
 
 
-=-=-=-=-=-=-=-=-=-=-=-
Quoted 2 lines

Links: You receive all messages sent to this group. View/Reply Online (#159718):

https://lists.openembedded.org/g/openembedded-core/message/159718

Quoted 3 lines

Mute This Topic: https://lists.openembedded.org/mt/87741230/3647476
Group Owner: [email protected]
Unsubscribe: https://lists.openembedded.org/g/openembedded-core/unsub [

[email protected]]

Quoted 2 lines

-=-=-=-=-=-=-=-=-=-=-=-