Bug 8911 - Storing build history in a Git submodule breaks due to a bad Git repository check
Summary: Storing build history in a Git submodule breaks due to a bad Git repository c...
Status: RESOLVED FIXED
Alias: None
Product: OE-Core
Classification: Build System, Metadata & Runtime
Component: deployment (show other bugs)
Version: 2.2
Hardware: x86 Multiple
: Medium normal
Target Milestone: 2.1
Assignee: Markus Lehtonen
QA Contact:
URL:
Whiteboard:
Depends on:
Blocks:
 
Reported: 2016-01-12 16:05 UTC by ulfalizer
Modified: 2016-02-01 06:59 UTC (History)
0 users

See Also:
OS type for building Yocto: ---
Type of Regression: ---
Verified:
Documentation change: No (bug/feature does not impact docs)


Attachments

Note You need to log in before you can comment on or make changes to this bug.
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