Skip to contentSkip to conversation

sstate: Setup fetcher environment in advance

PATCH New Richard Purdie 1 participant 3 messages Feb 19, 2022

lore
Share & tools
lore
#0 lore raw

PATCH 1/3 sstate: Setup fetcher environment in advance

The threading code here can race as the fetcher changes the environment which is shared between the threads. By setting it up in advance, it isn't changed and therefore no longer races.

---
 meta/classes/sstate.bbclass | 21 ++++++++++++---------
 1 file changed, 12 insertions(+), 9 deletions(-)
meta/classes/sstate.bbclass +12 -9
index 2e1d9428c27..787172b408d 100644
@@ -1022,15 +1022,18 @@ def sstate_checkhashes(sq_data, d, siginfo=False, currentcount=0, summary=True,
                 msg = "Checking sstate mirror object availability"
                 bb.event.fire(bb.event.ProcessStarted(msg, len(tasklist)), d)
 
-            bb.event.enable_threadlock()
-            pool = oe.utils.ThreadedPool(nproc, len(tasklist),
-                    worker_init=checkstatus_init, worker_end=checkstatus_end,
-                    name="sstate_checkhashes-")
-            for t in tasklist:
-                pool.add_task(checkstatus, t)
-            pool.start()
-            pool.wait_completion()
-            bb.event.disable_threadlock()
+            # Have to setup the fetcher environment here rather than in each thread as it would race
+            fetcherenv = bb.fetch2.get_fetcher_environment(d)
+            with bb.utils.environment(**fetcherenv):
+                bb.event.enable_threadlock()
+                pool = oe.utils.ThreadedPool(nproc, len(tasklist),
+                        worker_init=checkstatus_init, worker_end=checkstatus_end,
+                        name="sstate_checkhashes-")
+                for t in tasklist:
+                    pool.add_task(checkstatus, t)
+                pool.start()
+                pool.wait_completion()
+                bb.event.disable_threadlock()
 
             if progress:
                 bb.event.fire(bb.event.ProcessFinished(msg), d)
Signature · 1 line
2.32.0
#1 lore raw

PATCH 2/3 expat: Upgrade 2.4.4 -> 2.4.5

This is a security fix release containing fixes for CVE-2022-25235, CVE-2022-25236, CVE-2022-25313, CVE-2022-25314 and CVE-2022-25315.

---
 meta/recipes-core/expat/{expat_2.4.4.bb => expat_2.4.5.bb} | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
 rename meta/recipes-core/expat/{expat_2.4.4.bb => expat_2.4.5.bb} (91%)
meta/recipes-core/expat/expat_2.4.5.bb renamed from meta/recipes-core/expat/expat_2.4.4.bb +1 -1
similarity index 91%
rename from meta/recipes-core/expat/expat_2.4.4.bb
rename to meta/recipes-core/expat/expat_2.4.5.bb
index 14080220d2c..83ba3a23291 100644
@@ -14,7 +14,7 @@ SRC_URI = "https://github.com/libexpat/libexpat/releases/download/R_${VERSION_TA
 
 UPSTREAM_CHECK_URI = "https://github.com/libexpat/libexpat/releases/"
 
-SRC_URI[sha256sum] = "14c58c2a0b5b8b31836514dfab41bd191836db7aa7b84ae5c47bc0327a20d64a"
+SRC_URI[sha256sum] = "fbb430f964c7a2db2626452b6769e6a8d5d23593a453ccbc21701b74deabedff"
 
 EXTRA_OECMAKE:class-native += "-DEXPAT_BUILD_DOCS=OFF"
 
Signature · 1 line
2.32.0
#2 lore raw

PATCH 3/3 oeqa/selftest/bbtests: Update after license changes

In reply to Richard Purdie

Update the test to match the renamed license in the recipe.

---
 meta/lib/oeqa/selftest/cases/bbtests.py | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
meta/lib/oeqa/selftest/cases/bbtests.py +2 -2
index e2b9290200a..ce72c4bcc69 100644
@@ -228,8 +228,8 @@ INHERIT:remove = \"report-error\"
         result = bitbake('selftest-ed', ignore_status=True)
         self.assertEqual(result.status, 0, "Bitbake failed, exit code %s, output %s" % (result.status, result.output))
         lic_dir = get_bb_var('LICENSE_DIRECTORY')
-        self.assertFalse(os.path.isfile(os.path.join(lic_dir, 'selftest-ed/generic_GPLv3')))
-        self.assertTrue(os.path.isfile(os.path.join(lic_dir, 'selftest-ed/generic_GPLv2')))
+        self.assertFalse(os.path.isfile(os.path.join(lic_dir, 'selftest-ed/generic_GPL-3.0-or-later')))
+        self.assertTrue(os.path.isfile(os.path.join(lic_dir, 'selftest-ed/generic_GPL-2.0-or-later')))
 
     def test_setscene_only(self):
         """ Bitbake option to restore from sstate only within a build (i.e. execute no real tasks, only setscene)"""
Signature · 1 line
2.32.0