path: root/scripts
diff options
authorTaras Kondratiuk <>2019-03-21 17:56:59 -0700
committerRichard Purdie <>2019-03-24 17:00:42 +0000
commit3da578a79195a63fb6d4bbd68d8f1548defd205f (patch)
tree3800b7e412d30ad579b6b79bc30682199bb09a81 /scripts
parent4babf396a91ba375fad9c4dc610cfbdef8d17d4f (diff)
devtool: prevent starting git gc in background
Devtool creates a git repository for extracted sources in a temporary directory and then moves it to a final destination after patching is done. Unfortunately devtool is not aware that some of its git operations may have caused git garbage collector to start in background. If timing is just right a repository move fails because GC is removing git objects while they are being moved. The issue was hit on Krogoth release, but the code that moves created git repository is still the same. Disable gc.autodetach to make GC run synchronously and block git until it is done. Traceback (most recent call last): File "<snip>/openembedded-core/scripts/devtool", line 342, in <module> ret = main() File "<snip>/openembedded-core/scripts/devtool", line 329, in main ret = args.func(args, config, basepath, workspace) File "<snip>/openembedded-core/scripts/lib/devtool/", line 352, in extract initial_rev = _extract_source(srctree, args.keep_temp, args.branch, False, rd) File "<snip>/openembedded-core/scripts/lib/devtool/", line 644, in _extract_source shutil.move(srcsubdir, srctree) File "/usr/lib/python2.7/", line 299, in move copytree(src, real_dst, symlinks=True) File "/usr/lib/python2.7/", line 208, in copytree raise Error, errors Error: [('/tmp/devtool5RXkuX/workdir/grpc-1.2.5/.git/objects/5e', '<snip>/build/grpc/grpc_src/.git/objects/5e', "[Errno 2] No such file or directory: '/tmp/devtool5RXkuX/workdir/grpc-1.2.5/.git/objects/5e'"), ('/tmp/devtool5RXkuX/workdir/grpc-1.2.5/.git/objects/57', '<snip>/build/grpc/grpc_src/.git/objects/57', "[Errno 2] No such file or directory: '/tmp/devtool5RXkuX/workdir/grpc-1.2.5/.git/objects/57'"), many git objects ... ] Signed-off-by: Taras Kondratiuk <> Signed-off-by: Richard Purdie <>
Diffstat (limited to 'scripts')
1 files changed, 1 insertions, 0 deletions
diff --git a/scripts/lib/devtool/ b/scripts/lib/devtool/
index 89f098a912..8fc7fffcd6 100644
--- a/scripts/lib/devtool/
+++ b/scripts/lib/devtool/
@@ -205,6 +205,7 @@ def setup_git_repo(repodir, version, devbranch, basetag='devtool-base', d=None):
import oe.patch
if not os.path.exists(os.path.join(repodir, '.git')):'git init', cwd=repodir)
+'git config --local gc.autodetach 0', cwd=repodir)'git add .', cwd=repodir)
commit_cmd = ['git']
oe.patch.GitApplyTree.gitCommandUserOptions(commit_cmd, d=d)