summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRichard Purdie <richard.purdie@linuxfoundation.org>2021-02-02 23:45:18 +0000
committerRichard Purdie <richard.purdie@linuxfoundation.org>2021-02-03 21:42:44 +0000
commit6a9ca7aec4991eabd425e32fdf85f51bb1686b8b (patch)
tree849068d8e8e94ae20ddc4eee1ca43322b96f59e3
parent17df664a32a74f17baaef8c31ac23adec2d6255f (diff)
downloadopenembedded-core-6a9ca7aec4991eabd425e32fdf85f51bb1686b8b.tar.gz
openembedded-core-6a9ca7aec4991eabd425e32fdf85f51bb1686b8b.tar.bz2
openembedded-core-6a9ca7aec4991eabd425e32fdf85f51bb1686b8b.zip
opkg: Fix build reproducibility issue
A build date was leaking into the generated docs and makefile used for ptests leading to reproducibility issues each time the month changed. Add a patch to use SOURCE_DATE_EPOCH to derive it if available. Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
-rw-r--r--meta/recipes-devtools/opkg/opkg/sourcedateepoch.patch25
-rw-r--r--meta/recipes-devtools/opkg/opkg_0.4.4.bb1
2 files changed, 26 insertions, 0 deletions
diff --git a/meta/recipes-devtools/opkg/opkg/sourcedateepoch.patch b/meta/recipes-devtools/opkg/opkg/sourcedateepoch.patch
new file mode 100644
index 0000000000..285d258c63
--- /dev/null
+++ b/meta/recipes-devtools/opkg/opkg/sourcedateepoch.patch
@@ -0,0 +1,25 @@
+Having CLEAN_DATE come from the current date doesn't allow for build
+reproducibility. Add the option of using SOURCE_DATE_EPOCH if set
+which for OE, it will be.
+
+Upstream-Status: Pending
+RP 2021/2/2
+
+Index: opkg-0.4.4/configure.ac
+===================================================================
+--- opkg-0.4.4.orig/configure.ac
++++ opkg-0.4.4/configure.ac
+@@ -281,7 +281,12 @@ AC_FUNC_UTIME_NULL
+ AC_FUNC_VPRINTF
+ AC_CHECK_FUNCS([memmove memset mkdir regcomp strchr strcspn strdup strerror strndup strrchr strstr strtol strtoul sysinfo utime])
+
+-CLEAN_DATE=`date +"%B %Y" | tr -d '\n'`
++1607446883
++if [ ! -z "$SOURCE_DATE_EPOCH" ]; then
++ CLEAN_DATE=`LC_ALL=C date -d @$SOURCE_DATE_EPOCH +"%B %Y" | tr -d '\n'`
++else
++ CLEAN_DATE=`date +"%B %Y" | tr -d '\n'`
++fi
+
+ AC_SUBST([CLEAN_DATE])
+
diff --git a/meta/recipes-devtools/opkg/opkg_0.4.4.bb b/meta/recipes-devtools/opkg/opkg_0.4.4.bb
index f8034ca5fa..548e81962d 100644
--- a/meta/recipes-devtools/opkg/opkg_0.4.4.bb
+++ b/meta/recipes-devtools/opkg/opkg_0.4.4.bb
@@ -15,6 +15,7 @@ SRC_URI = "http://downloads.yoctoproject.org/releases/${BPN}/${BPN}-${PV}.tar.gz
file://opkg.conf \
file://0001-opkg_conf-create-opkg.lock-in-run-instead-of-var-run.patch \
file://0001-tests-let-the-OS-negotiate-relative-package-dirs.patch \
+ file://sourcedateepoch.patch \
file://run-ptest \
"