summaryrefslogtreecommitdiffstats
path: root/meta/classes-global
diff options
context:
space:
mode:
authorRichard Purdie <richard.purdie@linuxfoundation.org>2023-09-18 17:39:48 +0100
committerRichard Purdie <richard.purdie@linuxfoundation.org>2023-09-22 07:45:17 +0100
commita599437629b6e1cd412fc58e5e1d68120909a68a (patch)
tree609dd2878288f8b585b50b755163377bf654a53e /meta/classes-global
parentb0b0b89ad763a50cb02429b31f24400ddd4491b7 (diff)
downloadpoky-a599437629b6e1cd412fc58e5e1d68120909a68a.tar.gz
sstate: Stop allowing overlapping symlinks from sstate
When originally implemented, overlapping symlinks in DEPLOY_DIR were common. That is no longer the case and these overlapping links are causing bugs in other areas (e.g. bug 14123). Therefore start showing errors for overlapping symlinks in shared areas. Whilst here, fix a broken file reference in the grep command to match current file layouts and update the message shown to users to match current times. Most of the message content is obsolete now due to other advances and changes in the way the staging code now works. (From OE-Core rev: 15f98f72e1730fed5164fcd539737a7a7b96a1a2) Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'meta/classes-global')
-rw-r--r--meta/classes-global/sstate.bbclass30
1 files changed, 6 insertions, 24 deletions
diff --git a/meta/classes-global/sstate.bbclass b/meta/classes-global/sstate.bbclass
index 13ac844272..2676f18e0a 100644
--- a/meta/classes-global/sstate.bbclass
+++ b/meta/classes-global/sstate.bbclass
@@ -267,7 +267,7 @@ def sstate_install(ss, d):
267 overlap_allowed = (d.getVar("SSTATE_ALLOW_OVERLAP_FILES") or "").split() 267 overlap_allowed = (d.getVar("SSTATE_ALLOW_OVERLAP_FILES") or "").split()
268 match = [] 268 match = []
269 for f in sharedfiles: 269 for f in sharedfiles:
270 if os.path.exists(f) and not os.path.islink(f): 270 if os.path.exists(f):
271 f = os.path.normpath(f) 271 f = os.path.normpath(f)
272 realmatch = True 272 realmatch = True
273 for w in overlap_allowed: 273 for w in overlap_allowed:
@@ -277,36 +277,18 @@ def sstate_install(ss, d):
277 break 277 break
278 if realmatch: 278 if realmatch:
279 match.append(f) 279 match.append(f)
280 sstate_search_cmd = "grep -rlF '%s' %s --exclude=master.list | sed -e 's:^.*/::'" % (f, d.expand("${SSTATE_MANIFESTS}")) 280 sstate_search_cmd = "grep -rlF '%s' %s --exclude=index-* | sed -e 's:^.*/::'" % (f, d.expand("${SSTATE_MANIFESTS}"))
281 search_output = subprocess.Popen(sstate_search_cmd, shell=True, stdout=subprocess.PIPE).communicate()[0] 281 search_output = subprocess.Popen(sstate_search_cmd, shell=True, stdout=subprocess.PIPE).communicate()[0]
282 if search_output: 282 if search_output:
283 match.append(" (matched in %s)" % search_output.decode('utf-8').rstrip()) 283 match.append(" (matched in %s)" % search_output.decode('utf-8').rstrip())
284 else: 284 else:
285 match.append(" (not matched to any task)") 285 match.append(" (not matched to any task)")
286 if match: 286 if match:
287 bb.error("The recipe %s is trying to install files into a shared " \ 287 bb.fatal("Recipe %s is trying to install files into a shared " \
288 "area when those files already exist. Those files and their manifest " \ 288 "area when those files already exist. The files and the manifests listing " \
289 "location are:\n %s\nPlease verify which recipe should provide the " \ 289 "them are:\n %s\n"
290 "above files.\n\nThe build has stopped, as continuing in this scenario WILL " \ 290 "Please adjust the recipes so only one recipe provides a given file. " % \
291 "break things - if not now, possibly in the future (we've seen builds fail " \
292 "several months later). If the system knew how to recover from this " \
293 "automatically it would, however there are several different scenarios " \
294 "which can result in this and we don't know which one this is. It may be " \
295 "you have switched providers of something like virtual/kernel (e.g. from " \
296 "linux-yocto to linux-yocto-dev), in that case you need to execute the " \
297 "clean task for both recipes and it will resolve this error. It may be " \
298 "you changed DISTRO_FEATURES from systemd to udev or vice versa. Cleaning " \
299 "those recipes should again resolve this error, however switching " \
300 "DISTRO_FEATURES on an existing build directory is not supported - you " \
301 "should really clean out tmp and rebuild (reusing sstate should be safe). " \
302 "It could be the overlapping files detected are harmless in which case " \
303 "adding them to SSTATE_ALLOW_OVERLAP_FILES may be the correct solution. It could " \
304 "also be your build is including two different conflicting versions of " \
305 "things (e.g. bluez 4 and bluez 5 and the correct solution for that would " \
306 "be to resolve the conflict. If in doubt, please ask on the mailing list, " \
307 "sharing the error and filelist above." % \
308 (d.getVar('PN'), "\n ".join(match))) 291 (d.getVar('PN'), "\n ".join(match)))
309 bb.fatal("If the above message is too much, the simpler version is you're advised to wipe out tmp and rebuild (reusing sstate is fine). That will likely fix things in most (but not all) cases.")
310 292
311 if ss['fixmedir'] and os.path.exists(ss['fixmedir'] + "/fixmepath.cmd"): 293 if ss['fixmedir'] and os.path.exists(ss['fixmedir'] + "/fixmepath.cmd"):
312 sharedfiles.append(ss['fixmedir'] + "/fixmepath.cmd") 294 sharedfiles.append(ss['fixmedir'] + "/fixmepath.cmd")