]> code.ossystems Code Review - openembedded-core.git/commitdiff
bash: Remove .build files for reproducible builds
authorJoshua Watt <jpewhacker@gmail.com>
Fri, 21 Jun 2019 13:33:56 +0000 (08:33 -0500)
committerRichard Purdie <richard.purdie@linuxfoundation.org>
Fri, 21 Jun 2019 15:19:04 +0000 (16:19 +0100)
Bash has an internal "build number" that it tracks and automatically
increments ever time a given builds is made from the same sandbox.
However, this can make builds non-reproducible in the event that a build
directory is reused multiple times.

Remove the .build files after every build if reproducible builds have
been requested which will reset the build build number for the next
build.

Signed-off-by: Joshua Watt <JPEWhacker@gmail.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
meta/recipes-extended/bash/bash.inc

index c91cc8ada8db4ecf6a14fea4e459b9fda99681e1..039b8687a240dd0595fe1d3fa205acf12a5972e6 100644 (file)
@@ -39,6 +39,12 @@ RDEPENDS_${PN}-ptest_append_libc-glibc = " \
 
 CACHED_CONFIGUREVARS += "headersdir=${includedir}/${PN}"
 
+do_compile_prepend() {
+    # Remove any leftover .build files. This ensures that bash always has the
+    # same version number and keeps builds reproducible
+    rm -f ${B}/.build
+}
+
 do_compile_ptest () {
        oe_runmake buildtest
 }