All of lore.kernel.org
 help / color / mirror / Atom feed
From: Joshua Watt <jpewhacker@gmail.com>
To: openembedded-core@lists.openembedded.org
Subject: [PATCH] bash: Remove .build files for reproducible builds
Date: Thu, 20 Jun 2019 10:47:04 -0500	[thread overview]
Message-ID: <20190620154704.13940-1-JPEWhacker@gmail.com> (raw)

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>
---
 meta/recipes-extended/bash/bash.inc | 8 ++++++++
 1 file changed, 8 insertions(+)

diff --git a/meta/recipes-extended/bash/bash.inc b/meta/recipes-extended/bash/bash.inc
index c91cc8ada8d..e2844dffbad 100644
--- a/meta/recipes-extended/bash/bash.inc
+++ b/meta/recipes-extended/bash/bash.inc
@@ -39,6 +39,14 @@ RDEPENDS_${PN}-ptest_append_libc-glibc = " \
 
 CACHED_CONFIGUREVARS += "headersdir=${includedir}/${PN}"
 
+do_compile_prepend() {
+    # If reproducible builds are requested, remove any leftover .build files.
+    # This ensures that bash always has the same version number
+    if [ "${BUILD_REPRODUCIBLE_BINARIES}" == "1" ]; then
+        rm -f ${B}/.build
+    fi
+}
+
 do_compile_ptest () {
 	oe_runmake buildtest
 }
-- 
2.21.0



             reply	other threads:[~2019-06-20 15:47 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-06-20 15:47 Joshua Watt [this message]
2019-06-20 16:20 ` [PATCH] bash: Remove .build files for reproducible builds Burton, Ross
2019-06-20 16:24   ` Joshua Watt
2019-06-21 13:33 ` [PATCH v2] " Joshua Watt

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20190620154704.13940-1-JPEWhacker@gmail.com \
    --to=jpewhacker@gmail.com \
    --cc=openembedded-core@lists.openembedded.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.