Git lfs support does not work if destsuffix is set. #bitbake
First off, this is my first ever post to the list. So, if I am doing something incorrectly please let me know. I also have very limited knowledge into the inner workings of bitbake.
This was done on the kirkstone release, but I do not think the relevant file has been changed since then for git LFS support.
I have a private git repository that requires LFS support. I setup the SRC_URI as:
SRC_URI = "git://[email protected]/BraneAudio/Image.git;branch=main;protocol=ssh;lfs=1;destsuffix=brane-files"
The relevant file is bitbake/lib/bb/fetch2/git.py.
When it gets to the do_unpack task, it fails since it cannot find the large files. This is because Git.download() calls Git.unpack to put items into a tmpdir. When it goes to check for and LFS into the repo, it assumes that the unpack put the repo into a "git" folder which is not the case if destsuffix is set.
I believe that ud.destdir would have the correct path if it were used instead.
It would mean changing the following lines (line numbers 424-425 in kirkstone):
if os.path.exists(os.path.join(tmpdir, "git", ".git", "lfs")):
runfetchcmd("tar -cf - lfs | tar -xf - -C %s" % ud.clonedir, d, workdir="%s/git/.git" % tmpdir)
to:
if os.path.exists(os.path.join(ud.destdir, ".git", "lfs")):
runfetchcmd("tar -cf - lfs | tar -xf - -C %s" % ud.clonedir, d, workdir="%s/.git" % ud.destdir)
I do not know enough about bitbake and all of the fetching code to know if it works for all cases. It does work for my case though.
It should be noted that if subdir is set to an absolute path, the Git.unpack() to the tmpdir will fail since there is no way for that absolute path to exist in the tmpdir. That does not affect me, and I would assume that to fix that for LFS support would be a lot more involved. If I were to make a patch, I would include a comment about that though.
Does anyone know if my fix can be applied in the general case, or if there are some potential problems with it?
Thanks for reading my first post.
Richard Greer