summaryrefslogtreecommitdiffstats
path: root/bitbake/lib/bb/utils.py
diff options
context:
space:
mode:
Diffstat (limited to 'bitbake/lib/bb/utils.py')
-rw-r--r--bitbake/lib/bb/utils.py13
1 files changed, 10 insertions, 3 deletions
diff --git a/bitbake/lib/bb/utils.py b/bitbake/lib/bb/utils.py
index b282d09abf..2a150fe9c7 100644
--- a/bitbake/lib/bb/utils.py
+++ b/bitbake/lib/bb/utils.py
@@ -16,7 +16,8 @@ import bb.msg
16import multiprocessing 16import multiprocessing
17import fcntl 17import fcntl
18import importlib 18import importlib
19from importlib import machinery 19import importlib.machinery
20import importlib.util
20import itertools 21import itertools
21import subprocess 22import subprocess
22import glob 23import glob
@@ -451,6 +452,10 @@ def lockfile(name, shared=False, retry=True, block=False):
451 consider the possibility of sending a signal to the process to break 452 consider the possibility of sending a signal to the process to break
452 out - at which point you want block=True rather than retry=True. 453 out - at which point you want block=True rather than retry=True.
453 """ 454 """
455 if len(name) > 255:
456 root, ext = os.path.splitext(name)
457 name = root[:255 - len(ext)] + ext
458
454 dirname = os.path.dirname(name) 459 dirname = os.path.dirname(name)
455 mkdirhier(dirname) 460 mkdirhier(dirname)
456 461
@@ -487,7 +492,7 @@ def lockfile(name, shared=False, retry=True, block=False):
487 return lf 492 return lf
488 lf.close() 493 lf.close()
489 except OSError as e: 494 except OSError as e:
490 if e.errno == errno.EACCES: 495 if e.errno == errno.EACCES or e.errno == errno.ENAMETOOLONG:
491 logger.error("Unable to acquire lock '%s', %s", 496 logger.error("Unable to acquire lock '%s', %s",
492 e.strerror, name) 497 e.strerror, name)
493 sys.exit(1) 498 sys.exit(1)
@@ -1616,7 +1621,9 @@ def load_plugins(logger, plugins, pluginpath):
1616 logger.debug('Loading plugin %s' % name) 1621 logger.debug('Loading plugin %s' % name)
1617 spec = importlib.machinery.PathFinder.find_spec(name, path=[pluginpath] ) 1622 spec = importlib.machinery.PathFinder.find_spec(name, path=[pluginpath] )
1618 if spec: 1623 if spec:
1619 return spec.loader.load_module() 1624 mod = importlib.util.module_from_spec(spec)
1625 spec.loader.exec_module(mod)
1626 return mod
1620 1627
1621 logger.debug('Loading plugins from %s...' % pluginpath) 1628 logger.debug('Loading plugins from %s...' % pluginpath)
1622 1629