fetch2/git: Ensure gitsrcname is not too long
PATCH 1/1 fetch2/git: Ensure gitsrcname is not too long
If SRC_URI is pointing to local repository, it can happen that the path will be over 255 characters. When transformed into filename, bitbake will fail/hang on e.g. trying to create lockfile based on this name.
Thus we make sure to truncate this string to last 230 characters (arbitrary number) when it exceeds this limit.
--- lib/bb/fetch2/git.py | 2 ++ 1 file changed, 2 insertions(+)
lib/bb/fetch2/git.py +2 -0
@@ -259,6 +259,8 @@ class Git(FetchMethod): ud.revisions[name] = self.latest_revision(ud, d, name) gitsrcname = '%s%s' % (ud.host.replace(':', '.'), ud.path.replace('/', '.').replace('*', '.').replace(' ','_')) + if len(gitsrcname) > 230: + gitsrcname = gitsrcname[-230:] if gitsrcname.startswith('.'): gitsrcname = gitsrcname[1:]
Signature · 1 line
2.30.0
Quoted 19 lines · Jan Brzezanski
If
SRC_URIis pointing to local repository, it can happen that the path will be over 255 characters. When transformed into filename, bitbake will fail/hang on e.g. trying to create lockfile based on this name.Thus we make sure to truncate this string to last 230 characters (arbitrary number) when it exceeds this limit.
Signed-off-by Jan Brzezanski <[email protected]>Signed-off-by Tomasz Dziendzielski <[email protected]>--- lib/bb/fetch2/git.py | 2 ++ 1 file changed, 2 insertions(+)lib/bb/fetch2/git.py +0
-0
lib/bb/fetch2/git.py class Git(FetchMethod): · line 266
Quoted 8 lines
lib/bb/fetch2/git.py +2
-0@@ -259,6 +259,8 @@ class Git(FetchMethod): ud.revisions[name] = self.latest_revision(ud, d, name) gitsrcname = '%s%s' % (ud.host.replace(':', '.'), ud.path.replace('/', '.').replace('*', '.').replace(' ','_')) + if len(gitsrcname) > 230: + gitsrcname = gitsrcname[-230:] if gitsrcname.startswith('.'): gitsrcname = gitsrcname[1:]
Which release of the project is this with? I ask since there is this code:
https://git.yoctoproject.org/poky/commit/bitbake/lib/bb/utils.py?id=09e826cfb021731c1b139046665d2d9fa24baa88
https://git.yoctoproject.org/poky/commit/bitbake/lib/bb/utils.py?id=273b124bf6acd77b074fde2421be331721a68c11
Are you saying that isn't working?
Cheers,
Richard