bash: Remove .build files for reproducible builds
PATCH 1/1 bash: Remove .build files for reproducible builds
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.
--- meta/recipes-extended/bash/bash.inc | 8 ++++++++ 1 file changed, 8 insertions(+)
meta/recipes-extended/bash/bash.inc +8 -0
@@ -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 }
Signature · 1 line
2.21.0
Is it easier to just always delete those files? Do they serve any useful purpose?
Ross
Quoted 42 lines · Joshua Watt
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 <[email protected]>--- meta/recipes-extended/bash/bash.inc | 8 ++++++++ 1 file changed, 8 insertions(+)meta/recipes-extended/bash/bash.inc +8
-1@@ -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
--
_______________________________________________
Openembedded-core mailing list
[email protected]
http://lists.openembedded.org/mailman/listinfo/openembedded-core
Quoted 3 lines · Ross
Is it easier to just always delete those files? Do they serve any useful purpose?
Probably not for our uses. I'll post a V2 unless someone complains
Quoted 48 lines
Ross
Quoted 10 lines · Joshua Watt
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.
Review
Quoted 6 lines
Signed-off-by Joshua Watt <[email protected]>--- meta/recipes-extended/bash/bash.inc | 8 ++++++++ 1 file changed, 8 insertions(+)(quoted diff) +0
-0b/meta/recipes-extended/bash/bash.inc
meta/recipes-extended/bash/bash.inc RDEPENDS_${PN}-ptest_append_libc-glibc = " \ · line 43
Quoted 9 lines
index
c91cc8ada8d..e2844dffbad100644meta/recipes-extended/bash/bash.inc +2
-0@@ -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 .buildfiles.
Quoted 17 lines
meta/recipes-extended/bash/bash.inc +6
-1+ # 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
--
_______________________________________________
Openembedded-core mailing list
[email protected]
http://lists.openembedded.org/mailman/listinfo/openembedded-core
PATCH v2 1/1 bash: Remove .build files for reproducible builds
In reply to Joshua WattBash 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.
--- meta/recipes-extended/bash/bash.inc | 6 ++++++ 1 file changed, 6 insertions(+)
meta/recipes-extended/bash/bash.inc +6 -0
@@ -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 }
Signature · 1 line
2.21.0