Skip to contentSkip to conversation

license: Fix sstate hash conflict issues

PATCH Superseded Richard Purdie 1 participant 1 message Mar 17

v1 of 2 Superseded Latest is v2 →

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 license: Fix sstate hash conflict issues

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.

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

---
 meta/classes-global/license.bbclass | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)
meta/classes-global/license.bbclass +4 -4
index af5f1ed41df..0069c7219da 100644
@@ -18,14 +18,14 @@ LICENSE_CREATE_PACKAGE ??= "0"
 LICENSE_PACKAGE_SUFFIX ??= "-lic"
 LICENSE_FILES_DIRECTORY ??= "${datadir}/licenses/"
 
-LICENSE_DEPLOY_PATHCOMPONENT = "${SSTATE_PKGARCH}"
+LICENSE_DEPLOY_PATHCOMPONENT = "target"
 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 +35,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 +256,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}/${LICENSE_DEPLOY_PATHCOMPONENT}/"
 
 IMAGE_CLASSES:append = " license_image"