diff options
author | Paul Eggleton <paul.eggleton@linux.intel.com> | 2018-02-01 08:32:07 +1300 |
---|---|---|
committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2018-02-06 11:06:27 +0000 |
commit | a1179425a95656b72ceadea06541f06f265a80c4 (patch) | |
tree | 6f7f9ab414f29a9dafb27a00cae883445cf2c463 /scripts | |
parent | fa9c077068a2acea04389fa2b44eb2e93548fce2 (diff) | |
download | poky-a1179425a95656b72ceadea06541f06f265a80c4.tar.gz |
devtool: set up git repos so that singletask.lock is ignored
singletask.lock is written out while certain tasks execute for recipes
that have externalsrc.bbclass enabled - this includes recipes in
devtool's workspace. It appears that there's a race where
singletask.lock will be there one minute and then when we try to get the
file checksum of it (since we want to know if anything in the source
tree has changed) it will be gone, and git chokes. To fix that, add
singletask.lock to .git/info/exclude in the repository, regardless of
whether we created the repository or not. In any case singletask.lock
should never be tracked by git, so this is a good thing to be doing for
that reason as well.
This fixes oe-selftest failures in test_devtool_modify that we've seen
on the Yocto Project autobuilder:
bb.data_smart.ExpansionError: Failure expanding variable
do_compile[file-checksums], expression was ${@srctree_hash_files(d)}
which triggered exception CalledProcessError: Command
'['git', 'add', '-A', '.']' returned non-zero exit status 128.
Note that this only fixes this issue for devtool; if you are using
externalsrc independently of devtool there's a chance this will still
be an issue unless you add singletask.lock to your .gitignore.
(From OE-Core rev: 334ba846c795fc0d8c73ce05a1b0882739c86650)
Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com>
Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'scripts')
-rw-r--r-- | scripts/lib/devtool/__init__.py | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/scripts/lib/devtool/__init__.py b/scripts/lib/devtool/__init__.py index 07d774dfb7..89f098a912 100644 --- a/scripts/lib/devtool/__init__.py +++ b/scripts/lib/devtool/__init__.py | |||
@@ -220,6 +220,20 @@ def setup_git_repo(repodir, version, devbranch, basetag='devtool-base', d=None): | |||
220 | commit_cmd += ['-m', commitmsg] | 220 | commit_cmd += ['-m', commitmsg] |
221 | bb.process.run(commit_cmd, cwd=repodir) | 221 | bb.process.run(commit_cmd, cwd=repodir) |
222 | 222 | ||
223 | # Ensure singletask.lock (as used by externalsrc.bbclass) is ignored by git | ||
224 | excludes = [] | ||
225 | excludefile = os.path.join(repodir, '.git', 'info', 'exclude') | ||
226 | try: | ||
227 | with open(excludefile, 'r') as f: | ||
228 | excludes = f.readlines() | ||
229 | except FileNotFoundError: | ||
230 | pass | ||
231 | if 'singletask.lock\n' not in excludes: | ||
232 | excludes.append('singletask.lock\n') | ||
233 | with open(excludefile, 'w') as f: | ||
234 | for line in excludes: | ||
235 | f.write(line) | ||
236 | |||
223 | bb.process.run('git checkout -b %s' % devbranch, cwd=repodir) | 237 | bb.process.run('git checkout -b %s' % devbranch, cwd=repodir) |
224 | bb.process.run('git tag -f %s' % basetag, cwd=repodir) | 238 | bb.process.run('git tag -f %s' % basetag, cwd=repodir) |
225 | 239 | ||