summaryrefslogtreecommitdiffstats
path: root/bitbake
diff options
context:
space:
mode:
authorRichard Purdie <richard.purdie@linuxfoundation.org>2022-03-23 14:48:08 +0000
committerRichard Purdie <richard.purdie@linuxfoundation.org>2022-11-22 23:26:15 +0000
commit2b7d97af746e4713036050e730d28b9b13a3c4a2 (patch)
tree8d680a62d1caa1f6b72b56e319bdbfc711b0bb9c /bitbake
parent0711fd83cdc230d04144cda37a786b6470a78f37 (diff)
downloadpoky-2b7d97af746e4713036050e730d28b9b13a3c4a2.tar.gz
bitbake: utils: Fix lockfile path length issues
If the path to bitbake.lock is in a deep directory, bitbake will hang. The reason was that the max file length limiting code (to 255 chars) was including the directory name and it should only act on the filename within the directory. Fix it to just use the base filename. [YOCTO #14766] (Bitbake rev: e3db9c2e9eded3c5cb6040714a6054b44f6b3880) Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org> (cherry picked from commit 89d70e7b71eecfe06592202f326e566c579ba01d) Signed-off-by: Steve Sakoman <steve@sakoman.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'bitbake')
-rw-r--r--bitbake/lib/bb/utils.py9
1 files changed, 6 insertions, 3 deletions
diff --git a/bitbake/lib/bb/utils.py b/bitbake/lib/bb/utils.py
index 210e535f05..826024661b 100644
--- a/bitbake/lib/bb/utils.py
+++ b/bitbake/lib/bb/utils.py
@@ -461,13 +461,16 @@ def lockfile(name, shared=False, retry=True, block=False):
461 consider the possibility of sending a signal to the process to break 461 consider the possibility of sending a signal to the process to break
462 out - at which point you want block=True rather than retry=True. 462 out - at which point you want block=True rather than retry=True.
463 """ 463 """
464 if len(name) > 255: 464 basename = os.path.basename(name)
465 root, ext = os.path.splitext(name) 465 if len(basename) > 255:
466 name = root[:255 - len(ext)] + ext 466 root, ext = os.path.splitext(basename)
467 basename = root[:255 - len(ext)] + ext
467 468
468 dirname = os.path.dirname(name) 469 dirname = os.path.dirname(name)
469 mkdirhier(dirname) 470 mkdirhier(dirname)
470 471
472 name = os.path.join(dirname, basename)
473
471 if not os.access(dirname, os.W_OK): 474 if not os.access(dirname, os.W_OK):
472 logger.error("Unable to acquire lock '%s', directory is not writable", 475 logger.error("Unable to acquire lock '%s', directory is not writable",
473 name) 476 name)