[OE-core] [PATCH 1/2] externalsrc.bbclas: remove nostamp from do_configure

Markus Lehtonen markus.lehtonen at linux.intel.com
Tue Jan 26 14:13:24 UTC 2016


Be a bit more intelligent than mindlessly re-compiling every time.
Instead of using 'nostamp' flag for do_compile add the whole source tree
as 'file-checksums' flag. This way, do_compile is only re-run if
something in the source tree content changes. Hidden files and
directories in the source tree root are ignored by the glob currently
used. This has the advantage of automatically ignoring .git directory,
for example.

This does not work perfectly, though, as many packages are built under
${S} which effectively changes the source tree causing some unwanted
re-compilations.  However, if do_compile of the recipe does not produce
new/different artefacts on every run (as commonly is and should be the
case) the re-compilation loop stops. Thus, you should usually see only
one re-compilation (if any) after which the source tree is "stabilized"
and no more re-compilations happen.

During the first bitbake run preparing of the task runqueue may take
much longer because all the files in the source tree are hashed.
Subsequent builds are not significantly slower because (most) file
hashes are found from the cache.

[YOCTO #8853]

Signed-off-by: Markus Lehtonen <markus.lehtonen at linux.intel.com>
---
 meta/classes/externalsrc.bbclass | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/meta/classes/externalsrc.bbclass b/meta/classes/externalsrc.bbclass
index f7ed66d..fe4963d 100644
--- a/meta/classes/externalsrc.bbclass
+++ b/meta/classes/externalsrc.bbclass
@@ -83,8 +83,7 @@ python () {
 
         d.prependVarFlag('do_compile', 'prefuncs', "externalsrc_compile_prefunc ")
 
-        # Ensure compilation happens every time
-        d.setVarFlag('do_compile', 'nostamp', '1')
+        d.setVarFlag('do_compile', 'file-checksums', externalsrc + '/*:True')
 }
 
 python externalsrc_compile_prefunc() {
-- 
2.1.4




More information about the Openembedded-core mailing list