Bug 11399

Summary: devtool modify does not work with S != "${WORKDIR}/git" and multiple git repos in play
Product: [Build System, Metadata & Runtime] OE-Core Reporter: Scott Branden <scott.branden>
Component: devtools / tool chainAssignee: Paul Eggleton <bluelightning>
Status: RESOLVED FIXED QA Contact:
Severity: normal    
Priority: Medium CC: jon.richardson, meta.mr.watcher, meta.watcher
Version: unspecified   
Target Milestone: 2.5   
Hardware: x86   
OS: Multiple   
Whiteboard:
OS type for building Yocto: --- Type of Regression: ---
Verified: Documentation change: Don't know

Description Scott Branden 2017-04-21 00:43:31 UTC
devtool modify does not work when multiple git repos are specified in the SRC_URI and S != "${WORKDIR}/git"

If S happens to be a valid subdirectory being checked out. S = "${WORKDIR}/git/misc" in the example brcm.bono.bb provided.  An error occurs:

devtool modify brcm-bono
Parsing recipes..done.
NOTE: Fetching brcm-bono...
NOTE: Unpacking...
NOTE: Patching...
Traceback (most recent call last):
  File "/mnt/2ndHDD/yocto/sxc/poky/scripts/devtool", line 344, in <module>
    ret = main()
  File "/mnt/2ndHDD/yocto/sxc/poky/scripts/devtool", line 331, in main
    ret = args.func(args, config, basepath, workspace)
  File "/mnt/2ndHDD/yocto/sxc/poky/scripts/lib/devtool/standard.py", line 786, in modify
    initial_rev = _extract_source(srctree, False, args.branch, False, rd)
  File "/mnt/2ndHDD/yocto/sxc/poky/scripts/lib/devtool/standard.py", line 634, in _extract_source
    task_executor.exec_func('do_patch', False)
  File "/mnt/2ndHDD/yocto/sxc/poky/scripts/lib/devtool/standard.py", line 463, in exec_func
    super(PatchTaskExecutor, self).exec_func(func, report)
  File "/mnt/2ndHDD/yocto/sxc/poky/scripts/lib/devtool/standard.py", line 431, in exec_func
    self.exec_func(taskdepfunc, True)
  File "/mnt/2ndHDD/yocto/sxc/poky/scripts/lib/devtool/standard.py", line 475, in exec_func
    bb.process.run('git add .; git %s commit -a -m "Committing changes from %s\n\n%s"' % (' '.join(self.useroptions), func, GitApplyTree.ignore_commit_prefix + ' - from %s' % func), cwd=srcsubdir)
  File "/mnt/2ndHDD/yocto/sxc/poky/bitbake/lib/bb/process.py", line 171, in run
    raise ExecutionError(cmd, pipe.returncode, stdout, stderr)
bb.process.ExecutionError: Execution of 'git add .; git -c user.name="OpenEmbedded" -c user.email="oe.patch@oe" commit -a -m "Committing changes from do_unpack

%% ignore - from do_unpack"' failed with exit code 1:
# On branch devtool
# Untracked files:
#	../ofono/
#
nothing added to commit but untracked files present


I trimmed down one of our internal recipes and replaced the git repos with external repos to reproduce the problem. brcm-bono.bb recipe as below.

DESCRIPTION = "Broadcom test"
SECTION = "firmware"
LICENSE = "Broadcom-Proprietary"
LIC_FILES_CHKSUM = "file://${WORKDIR}/LICENSE.txt;md5=8f548b18a631a33d76050774b431b1a1"

inherit autorev-pv

SRCREV = "${AUTOREV}"
SRC_URI = "git://git.kernel.org/pub/scm/fs/ext2/e2fsprogs.git;branch=master"
SRCREV_FORMAT = "git"

SRC_URI += "git://git.kernel.org/pub/scm/network/ofono/ofono.git;destsuffix=git/ofono"
SRCREV_FORMAT_ofono = "git"

S = "${WORKDIR}/git/misc"
Comment 1 Paul Eggleton 2017-10-31 01:12:57 UTC
I can't reproduce this in master/rocko, I believe this ended up being fixed as part of the reworking of devtool source extraction reworking. That was a complex set of changes so it's not an easily backportable fix, but here is the commit that would have changed this behaviour:

http://git.yoctoproject.org/cgit/cgit.cgi/poky/commit/?id=45adbe370908901d0d2e94b3c4daea821772e2ff
Comment 2 Scott Branden 2017-10-31 22:06:34 UTC
(In reply to comment #1)
> I can't reproduce this in master/rocko, I believe this ended up being fixed
> as part of the reworking of devtool source extraction reworking. That was a
> complex set of changes so it's not an easily backportable fix, but here is
> the commit that would have changed this behaviour:
> 
> http://git.yoctoproject.org/cgit/cgit.cgi/poky/commit/
> ?id=45adbe370908901d0d2e94b3c4daea821772e2ff

Yes - it is working in rocko.  Thanks.