Bug 14045

Summary: git fetcher deadlock with self-referencing sub-modules
Product: [Build System, Metadata & Runtime] BitBake Reporter: kenth.eriksson
Component: bitbakeAssignee: Richard Purdie <richard.purdie>
Status: RESOLVED FIXED QA Contact:
Severity: enhancement    
Priority: Medium+ CC: jonathan.crockett, kenth.eriksson, pavel, poky.bs.watcher, poky.watcher, randy.macleod
Version: 3.4   
Target Milestone: 4.2 M1   
Hardware: x86   
OS: Multiple   
Whiteboard:
OS type for building Yocto: --- Type of Regression: ---
Verified: Documentation change: No (bug/feature does not impact docs)

Description kenth.eriksson 2020-09-16 05:29:29 UTC
gitsm fetcher dead locks if submodule is self-referencing. The fetcher creates lock/done files in DL/git2 folder. Due to this design, it cannot handle repositories where submodule is a specific revision of the the parent repo.

As an example where a dead lock will happen, consider the following repository, https://github.com/gflags/gflags, where the doc folder is submodule of the parent repository.
Comment 1 Randy MacLeod 2020-09-17 07:37:10 UTC
We should add a check to avoid the deadlock.
Comment 3 Pavel Zhukov 2022-09-06 15:10:12 UTC
Resolved in https://git.openembedded.org/bitbake/commit/?id=0361ecf7eb82c386a9842cf1f3cb706c0a112e77

Test case added to cover possible regressions.
Comment 4 Jonathan Crockett 2022-10-13 17:23:30 UTC
This patch breaks cases where the parent repo matches the submodule except the submodule has additional chars to the repo name. 

E.g. parent is alpha and submodule is alpha-keys will now fail because the patch only looks at alpha not the end line, even though they are valid different repositories.
Comment 5 Randy MacLeod 2022-10-13 21:44:51 UTC
See Jonathan's comment.
Comment 8 Richard Purdie 2022-11-20 11:32:15 UTC
Thanks for the help Pavel!