Skip to contentSkip to conversation

meta: classes: externalsrc: stop rebuilds of 2+ externalsrc recipes sharing the same git repo

PATCH In review Quentin Schulz 2 participants 2 messages Sep 19, 2019

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 meta: classes: externalsrc: stop rebuilds of 2+ externalsrc recipes sharing the same git repo

externalsrc do_configure task watches oe-devtool-tree-sha1 file and its checksum. That file basically contains the result of git add -A ${EXTERNALSRC} && git write-tree which is the hash of temporary "commit" of the non committed changes. This file is stored in the .git directory of the git repo of the externalsrc recipe. do_configure then depends on the checksum of oe-devtool-tree-sha1 file.

If 2+ recipes with different externalsrc paths but same git repo (e.g. one recipe at /some/path and the other at /some/path/subdir) are parsed, this oe-devtool-tree-sha1 will be overwritten by those recipes at parsing time since .git is shared between those recipes.

If there is one non committed git change in /some/path but not in /some/path/subdir, the oe-devtool-tree-sha1 of both recipes will be different.

What will happen is that recipe1 will watch over the oe-devtool-tree-sha1 with a specific checksum, fill in file-checksums for do_configure correctly, then recipe2 will watch over the identically named file with different content also fill in the file-checksums varflag. When do_configure of recipe1 will be evaluated for re-execution, oe-devtool-tree-sha1 will be of the value of what is watched over by recipe2, thus triggering a rebuild of recipe1.

This behavior is not always reproducible which I'm guessing is due to a small window between recipe1 putting info into oe-devtool-tree-sha1 and calculating the checksum of that file and recipe2 putting its content into oe-devtool-tree-sha1.

By appending the name of the recipe to oe-devtool-tree-sha1, we make sure that a recipe won't have its oe-devtool-tree-sha1 overwritten by another recipe sharing the same externalsrc git repo.

---
 meta/classes/externalsrc.bbclass | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
meta/classes/externalsrc.bbclass +1 -1
index 3618b99a86..ea59d02ed9 100644
@@ -203,7 +203,7 @@ def srctree_hash_files(d, srcdir=None):
 
     ret = " "
     if git_dir is not None:
-        oe_hash_file = os.path.join(git_dir, 'oe-devtool-tree-sha1')
+        oe_hash_file = os.path.join(git_dir, 'oe-devtool-tree-sha1-%s' % d.getVar('PN'))
         with tempfile.NamedTemporaryFile(prefix='oe-devtool-index') as tmp_index:
             # Clone index
             shutil.copyfile(os.path.join(git_dir, 'index'), tmp_index.name)
Signature · 1 line
2.17.1
#1 lore raw

✗ patchtest: failure for meta: classes: externalsrc: stop rebuilds of 2+ externalsrc recipes sharing the same git repo

== Series Details ==

Series: meta: classes: externalsrc: stop rebuilds of 2+ externalsrc recipes sharing the same git repo
Revision: 1
URL : https://patchwork.openembedded.org/series/20060/
State : failure

== Summary ==

Thank you for submitting this patch series to OpenEmbedded Core. This is an automated response. Several tests have been executed on the proposed series by patchtest resulting in the following failures:

* Patch            meta: classes: externalsrc: stop rebuilds of 2+ externalsrc recipes sharing the same git repo
 Issue             Commit shortlog is too long [test_shortlog_length] 
  Suggested fix    Edit shortlog so that it is 90 characters or less (currently 93 characters)

If you believe any of these test results are incorrect, please reply to the mailing list ([email protected]) raising your concerns. Otherwise we would appreciate you correcting the issues and submitting a new version of the patchset if applicable. Please ensure you add/increment the version number when sending the new version (i.e. [PATCH] -> [PATCH v2] -> [PATCH v3] -> ...).

---

Guidelines:     https://www.openembedded.org/wiki/Commit_Patch_Message_Guidelines
Test framework: http://git.yoctoproject.org/cgit/cgit.cgi/patchtest
Test suite:     http://git.yoctoproject.org/cgit/cgit.cgi/patchtest-oe