Skip to contentSkip to conversation

cache: Make CoreRecipeInfo include rprovides_pkg for skipped recipes

PATCH In review Peter Kjellerstedt 1 participant 4 messages Dec 7, 2020 – Jan 22, 2021 1 message not in the archive

lore
Share & tools
lore
#0 lore raw

PATCH 1/2 cache: Make CoreRecipeInfo include rprovides_pkg for skipped recipes

This will be needed by SkippedPackage in the cooker.

---
 bitbake/lib/bb/cache.py | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
bitbake/lib/bb/cache.py +2 -2
index b8054e028b..36270d0093 100644
@@ -26,7 +26,7 @@ import re
 
 logger = logging.getLogger("BitBake.Cache")
 
-__cache_version__ = "153"
+__cache_version__ = "154"
 
 def getCacheFile(path, filename, mc, data_hash):
     mcspec = ''
@@ -94,6 +94,7 @@ class CoreRecipeInfo(RecipeInfoCommon):
         if not self.packages:
             self.packages.append(self.pn)
         self.packages_dynamic = self.listvar('PACKAGES_DYNAMIC', metadata)
+        self.rprovides_pkg = self.pkgvar('RPROVIDES', self.packages, metadata)
 
         self.skipreason = self.getvar('__SKIPPED', metadata)
         if self.skipreason:
@@ -120,7 +121,6 @@ class CoreRecipeInfo(RecipeInfoCommon):
         self.depends          = self.depvar('DEPENDS', metadata)
         self.rdepends         = self.depvar('RDEPENDS', metadata)
         self.rrecommends      = self.depvar('RRECOMMENDS', metadata)
-        self.rprovides_pkg    = self.pkgvar('RPROVIDES', self.packages, metadata)
         self.rdepends_pkg     = self.pkgvar('RDEPENDS', self.packages, metadata)
         self.rrecommends_pkg  = self.pkgvar('RRECOMMENDS', self.packages, metadata)
         self.inherits         = self.getvar('__inherit_cache', metadata, expand=False)
#1 lore raw

PATCH 2/2 cooker: Include all packages a recipe provides in SkippedPackage.rprovides

The provided packages by a skipped recipe are supposed to be listed in SkippedPackage.rprovides, which is used when generating a meaningful error message when a build fails because of a skipped package. Previously this variable only contained the contents of ${RPROVIDES}. However, most recipes don't define RPROVIDES, they define RPROVIDES_<pkg> for each package they provide. Additionally, the recipe provides the packages in PACKAGES without them being included in ${RPROVIDES}.

Before this change, having a runtime dependency on a skipped non-recipe package would result in a build error stating that the build failed because the package was skipped, but without providing any reason for why it was skipped.

---
 bitbake/lib/bb/cooker.py | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)
bitbake/lib/bb/cooker.py +3 -1
index 1f4cc1e96d..83cfee7fb4 100644
@@ -73,7 +73,9 @@ class SkippedPackage:
             self.pn = info.pn
             self.skipreason = info.skipreason
             self.provides = info.provides
-            self.rprovides = info.rprovides
+            self.rprovides = info.packages + info.rprovides
+            for package in info.packages:
+                self.rprovides += info.rprovides_pkg[package]
         elif reason:
             self.skipreason = reason
 
#3 lore raw

Re: [bitbake-devel] [PATCH 2/2] cooker: Include all packages a recipe provides in SkippedPackage.rprovides

In reply to a message not in the archive

*ping*

//Peter

Quoted 42 lines

-----Original Message-----
From: [email protected] <bitbake- [email protected]> On Behalf Of Peter Kjellerstedt
Sent: den 7 december 2020 22:39
To: [email protected]
Subject: [bitbake-devel] [PATCH 2/2] cooker: Include all packages a recipe provides in SkippedPackage.rprovides

The provided packages by a skipped recipe are supposed to be listed in SkippedPackage.rprovides, which is used when generating a meaningful error message when a build fails because of a skipped package. Previously this variable only contained the contents of ${RPROVIDES}. However, most recipes don't define RPROVIDES, they define RPROVIDES_<pkg> for each package they provide. Additionally, the recipe provides the packages in PACKAGES without them being included in ${RPROVIDES}.

Before this change, having a runtime dependency on a skipped non-recipe package would result in a build error stating that the build failed because the package was skipped, but without providing any reason for why it was skipped.

---
 bitbake/lib/bb/cooker.py | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)
bitbake/lib/bb/cooker.py +3 -1
index 1f4cc1e96d..83cfee7fb4 100644
@@ -73,7 +73,9 @@ class SkippedPackage:
             self.pn = info.pn
             self.skipreason = info.skipreason
             self.provides = info.provides
-            self.rprovides = info.rprovides
+            self.rprovides = info.packages + info.rprovides
+            for package in info.packages:
+                self.rprovides += info.rprovides_pkg[package]
         elif reason:
             self.skipreason = reason
 
#4 lore raw

Re: [bitbake-devel] [PATCH 2/2] cooker: Include all packages a recipe provides in SkippedPackage.rprovides

In reply to a message not in the archive

Can these two bitbake patches be backported to Dunfell and Gatesgarth?

93d01614565bd540d05fbc1791dd66e46723d683
efd026c26a377b826a49b945a8212bf7de8a480a

For Gatesgarth they should apply without any conflicts. For Dunfell there is a conflict in bitbake/lib/bb/cache.py due to __cache_version__ having changed.

//Peter

Quoted 42 lines

-----Original Message-----
From: [email protected] <bitbake- [email protected]> On Behalf Of Peter Kjellerstedt
Sent: den 7 december 2020 22:39
To: [email protected]
Subject: [bitbake-devel] [PATCH 2/2] cooker: Include all packages a recipe provides in SkippedPackage.rprovides

The provided packages by a skipped recipe are supposed to be listed in SkippedPackage.rprovides, which is used when generating a meaningful error message when a build fails because of a skipped package. Previously this variable only contained the contents of ${RPROVIDES}. However, most recipes don't define RPROVIDES, they define RPROVIDES_<pkg> for each package they provide. Additionally, the recipe provides the packages in PACKAGES without them being included in ${RPROVIDES}.

Before this change, having a runtime dependency on a skipped non-recipe package would result in a build error stating that the build failed because the package was skipped, but without providing any reason for why it was skipped.

---
 bitbake/lib/bb/cooker.py | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)
bitbake/lib/bb/cooker.py +3 -1
index 1f4cc1e96d..83cfee7fb4 100644
@@ -73,7 +73,9 @@ class SkippedPackage:
             self.pn = info.pn
             self.skipreason = info.skipreason
             self.provides = info.provides
-            self.rprovides = info.rprovides
+            self.rprovides = info.packages + info.rprovides
+            for package in info.packages:
+                self.rprovides += info.rprovides_pkg[package]
         elif reason:
             self.skipreason = reason