Bug 7771

Summary: gitsm fetcher don't fetches submodules which are not any longer included in .gitmodules
Product: [Build System, Metadata & Runtime] BitBake Reporter: betacentauri
Component: bitbakeAssignee: Richard Purdie <richard.purdie>
Status: CLOSED FIXED QA Contact:
Severity: normal    
Priority: Medium CC: poky.bs.watcher, poky.watcher
Version: unspecified   
Target Milestone: 1.9   
Hardware: x86   
OS: Multiple   
Whiteboard:
OS type for building Yocto: --- Type of Regression: ---
Verified: Documentation change: No (bug/feature does not impact docs)
Attachments:
Description Flags
Bitbake file
none
Patch none

Description betacentauri 2015-05-15 20:27:36 UTC
Created attachment 2514 [details]
Bitbake file

I have used:
SRC_URI = "gitsm://github.com/google/google-api-python-client.git"
SRCREV = "62af5a96988404207da9fc0e4aff2f6cefcb26c2"

Unpack throws this error:
ERROR: Function failed: Fetcher failure: Fetch command failed with exit code 1, output:
cp: cannot stat `....../git2/github.com.google.google-api-python-client.git/modules': No such file or directory

ERROR: Logfile of failure stored in: ....../python-api-python-client/1.2-r0/temp/log.do_unpack.17323

Problem is that current git has no submodules(https://github.com/google/google-api-python-client/blob/master/.gitmodules). But in old rev 62af5a96988404207da9fc0e4aff2f6cefcb26c2 there is a submodule (https://github.com/google/google-api-python-client/blob/62af5a96988404207da9fc0e4aff2f6cefcb26c2/.gitmodules). gitsm.py calls "git reset --hard" and then "git submodule init". So it looks in wrong rev.

Attached is a patch which worked for me. I don't know whether ud.revisions["default"] always contains the correct src rev. Please check.
Comment 1 betacentauri 2015-05-15 20:28:09 UTC
Created attachment 2515 [details]
Patch
Comment 2 Richard Purdie 2015-07-07 12:48:54 UTC
There was a version of this posted on the bitbake mailing list which used ud.names[0] instead of "default" so I've merged that and it should resolve this issue. Thanks for the patch!

http://git.yoctoproject.org/cgit.cgi/poky/commit/?id=62caaa4d6d1e3585c94c34af91e94d1b0deba8c3
Comment 3 betacentauri 2015-07-10 21:32:23 UTC
Thanks!