Bug 8911

Summary: Storing build history in a Git submodule breaks due to a bad Git repository check
Product: [Build System, Metadata & Runtime] OE-Core Reporter: ulfalizer
Component: deploymentAssignee: Markus Lehtonen <markus.lehtonen>
Status: RESOLVED FIXED QA Contact:
Severity: normal    
Priority: Medium    
Version: 2.2   
Target Milestone: 2.1   
Hardware: x86   
OS: Multiple   
Whiteboard:
OS type for building Yocto: --- Type of Regression: ---
Verified: Documentation change: No (bug/feature does not impact docs)

Description ulfalizer 2016-01-12 16:05:18 UTC
buildhistory.bbclass checks whether BUILDHISTORY_DIR is an initialized Git repository with 'if [ ! -d .git ]'. This won't work when BUILDHISTORY_DIR is a Git submodule, since .git is a regular file in that case (containing something like 'gitdir: ../.git/modules/foo'). Changing the test to 'if [ ! -e .git ]' fixes the problem.

The broken test causes 'git init' to be rerun in the submodule, which for some reason turns 'worktree' in .git/modules/foo/config into an absolute path. This in turn makes the entire repository non-relocatable. (Commands like 'git diff' fail with "fatal: Could not switch to '/home/ulf/poky': No such file or directory".)
Comment 1 Markus Lehtonen 2016-02-01 06:59:42 UTC
Fixed in oe-core 'master' by this commit:
http://git.openembedded.org/openembedded-core/commit/?id=a5e931e0b1d941cc938fe2f49625c54b07fab0ce