diff mbox series

[v2] license: Fix sstate hash conflict issues

Message ID 20260317121307.935437-1-richard.purdie@linuxfoundation.org
State Under Review
Headers show
Series [v2] license: Fix sstate hash conflict issues | expand

Commit Message

Richard Purdie March 17, 2026, 12:13 p.m. UTC
Currently, SSTATE_PKGARCH is injected into the sstate packages themselves but
the output of do_populate_lic is meant to be architecture invariant.

Instead of putting it into the package, use that part of the path as the
installation location. This makes the sstate packages architecture invariant
and avoids hash mismatch issues.

Since the sstate install path isn't part of the task checksums, we can just
remove all the LICENSE_DEPLOY_PATHCOMPONENT code entirely. do_populate_lic doesn't
run for native/cross.

I suspect this was what I'd originally intended when I added SSTATE_PKGARCH to
the path but things weren't quite done correctly.

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
---
 meta/classes-global/license.bbclass | 12 +++---------
 1 file changed, 3 insertions(+), 9 deletions(-)
diff mbox series

Patch

diff --git a/meta/classes-global/license.bbclass b/meta/classes-global/license.bbclass
index af5f1ed41df..2d4ad6df267 100644
--- a/meta/classes-global/license.bbclass
+++ b/meta/classes-global/license.bbclass
@@ -18,14 +18,8 @@  LICENSE_CREATE_PACKAGE ??= "0"
 LICENSE_PACKAGE_SUFFIX ??= "-lic"
 LICENSE_FILES_DIRECTORY ??= "${datadir}/licenses/"
 
-LICENSE_DEPLOY_PATHCOMPONENT = "${SSTATE_PKGARCH}"
-LICENSE_DEPLOY_PATHCOMPONENT:class-cross = "native"
-LICENSE_DEPLOY_PATHCOMPONENT:class-native = "native"
-# Ensure the *value* of SSTATE_PKGARCH is captured as it is used in the output paths
-LICENSE_DEPLOY_PATHCOMPONENT[vardepvalue] += "${LICENSE_DEPLOY_PATHCOMPONENT}"
-
 addtask populate_lic after do_patch before do_build
-do_populate_lic[dirs] = "${LICSSTATEDIR}/${LICENSE_DEPLOY_PATHCOMPONENT}/${PN}"
+do_populate_lic[dirs] = "${LICSSTATEDIR}/${PN}"
 do_populate_lic[cleandirs] = "${LICSSTATEDIR}"
 
 python do_populate_lic() {
@@ -35,7 +29,7 @@  python do_populate_lic() {
     lic_files_paths = find_license_files(d)
 
     # The base directory we wrangle licenses to
-    destdir = os.path.join(d.getVar('LICSSTATEDIR'), d.getVar('LICENSE_DEPLOY_PATHCOMPONENT'), d.getVar('PN'))
+    destdir = os.path.join(d.getVar('LICSSTATEDIR'),  d.getVar('PN'))
     copy_license_files(lic_files_paths, destdir)
     info = get_recipe_info(d)
     with open(os.path.join(destdir, "recipeinfo"), "w") as f:
@@ -256,7 +250,7 @@  def find_license_files(d):
 
 SSTATETASKS += "do_populate_lic"
 do_populate_lic[sstate-inputdirs] = "${LICSSTATEDIR}"
-do_populate_lic[sstate-outputdirs] = "${LICENSE_DIRECTORY}/"
+do_populate_lic[sstate-outputdirs] = "${LICENSE_DIRECTORY}/${SSTATE_PKGARCH}/"
 
 IMAGE_CLASSES:append = " license_image"