]> code.ossystems Code Review - openembedded-core.git/commitdiff
OELAYOUT_ABI: bump, avoid tmp/ breakage by removing old cross manifests
authorAlexander Kanavin <alex.kanavin@gmail.com>
Sat, 26 Feb 2022 15:02:17 +0000 (16:02 +0100)
committerRichard Purdie <richard.purdie@linuxfoundation.org>
Wed, 2 Mar 2022 18:41:52 +0000 (18:41 +0000)
Signed-off-by: Alexander Kanavin <alex@linutronix.de>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
meta/classes/sanity.bbclass
meta/conf/abi_version.conf

index 773902e619df3b478d6439ed03237b95c0180524..92807dc88e91c8b1307ef8eafea78fb83e99d421 100644 (file)
@@ -559,6 +559,24 @@ def sanity_check_conffiles(d):
                 bb.fatal(str(e))
             d.setVar("BB_INVALIDCONF", True)
 
+def drop_v14_cross_builds(d):
+    import glob
+    indexes = glob.glob(d.expand("${SSTATE_MANIFESTS}/index-${BUILD_ARCH}_*"))
+    for i in indexes:
+        with open(i, "r") as f:
+            lines = f.readlines()
+            for l in reversed(lines):
+                try:
+                    (stamp, manifest, workdir) = l.split()
+                except ValueError:
+                    bb.fatal("Invalid line '%s' in sstate manifest '%s'" % (l, i))
+                for m in glob.glob(manifest + ".*"):
+                    if m.endswith(".postrm"):
+                        continue
+                    sstate_clean_manifest(m, d)
+                bb.utils.remove(stamp + "*")
+                bb.utils.remove(workdir, recurse = True)
+
 def sanity_handle_abichanges(status, d):
     #
     # Check the 'ABI' of TMPDIR
@@ -577,7 +595,10 @@ def sanity_handle_abichanges(status, d):
             status.addresult("The layout of TMPDIR changed for Recipe Specific Sysroots.\nConversion doesn't make sense and this change will rebuild everything so please delete TMPDIR (%s).\n" % d.getVar("TMPDIR"))
         elif int(abi) <= 13 and current_abi == "14":
             status.addresult("TMPDIR changed to include path filtering from the pseudo database.\nIt is recommended to use a clean TMPDIR with the new pseudo path filtering so TMPDIR (%s) would need to be removed to continue.\n" % d.getVar("TMPDIR"))
-
+        elif int(abi) == 14 and current_abi == "15":
+            drop_v14_cross_builds(d)
+            with open(abifile, "w") as f:
+                f.write(current_abi)
         elif (abi != current_abi):
             # Code to convert from one ABI to another could go here if possible.
             status.addresult("Error, TMPDIR has changed its layout version number (%s to %s) and you need to either rebuild, revert or adjust it at your own risk.\n" % (abi, current_abi))
index 66df69bb8d5d197810a7e828ca8e64327e8f4d34..2a08b1208b10866069a44b8fa4f019c089b8ab56 100644 (file)
@@ -4,7 +4,7 @@
 # that breaks the format and have been previously discussed on the mailing list 
 # with general agreement from the core team.
 #
-OELAYOUT_ABI = "14"
+OELAYOUT_ABI = "15"
 
 #
 # HASHEQUIV_HASH_VERSION is injected into the output hash calculation used by