Skip to contentSkip to conversation

autoconf-doc: improve reproducibility

PATCH In review Juro Bystricky 2 participants 3 messages Feb 7, 2018

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 autoconf-doc: improve reproducibility

autoconf-doc package contains autoconf.info. This file contains date when this file was created, i.e:

     "This manual (31 January 2018) .."

Therefore, two builds done on two different days will show different dates for otherwise identical files, hence breaking reproducibility.
The date is obtained from mtime of "autoconf.texi", unfortunately we patch this file and change the mtime as a consequence.
The date serves as a document version identifier, so preserving the original mtime of "autoconf.texi" would be misleading, as we actually did modify the document on purpose. The fix is to set the mtime of "autoconf.texi" based on SOURCE_DATE_EPOCH.

[YOCTO #12524]

---
 meta/recipes-devtools/autoconf/autoconf.inc | 9 +++++++++
 1 file changed, 9 insertions(+)
meta/recipes-devtools/autoconf/autoconf.inc +9 -0
index df81bc6..f5156f7 100644
@@ -48,6 +48,15 @@ do_configure() {
 	oe_runconf
 }
 
+do_compile_prepend_class-target() {
+	# mtime of autoconf.texi will end up as embedded date in autoconf.info.
+	# We patch autoconf.texi, so that modifies mtime each time.
+	# To ensure reproducibility, set the mtime to SOURCE_DATE_EPOCH
+	if [ -n "${SOURCE_DATE_EPOCH}" ]; then
+		touch -d @${SOURCE_DATE_EPOCH} ${S}/doc/autoconf.texi
+	fi
+}
+
 do_install_append() {
     rm -rf ${D}${datadir}/emacs
 }
Signature · 1 line
2.7.4
#1 lore raw

A neater fix might be to drop the documentation change from the patch we're applying, as it's unlikely that people will be reading the autoconf documentation.

Ross

Quoted 55 lines · Juro Bystricky

autoconf-doc package contains autoconf.info. This file contains date when this file was created, i.e:

     "This manual (31 January 2018) .."

Therefore, two builds done on two different days will show different dates for
otherwise identical files, hence breaking reproducibility.
The date is obtained from mtime of "autoconf.texi", unfortunately we patch this
file and change the mtime as a consequence.
The date serves as a document version identifier, so preserving the original mtime of
"autoconf.texi" would be misleading, as we actually did modify the document on purpose.
The fix is to set the mtime of "autoconf.texi" based on SOURCE_DATE_EPOCH.

[YOCTO #12524]

---
 meta/recipes-devtools/autoconf/autoconf.inc | 9 +++++++++
 1 file changed, 9 insertions(+)
meta/recipes-devtools/autoconf/autoconf.inc +2 -0
index df81bc6..f5156f7 100644
@@ -48,6 +48,15 @@ do_configure() {
        oe_runconf
 }
 
+do_compile_prepend_class-target() {
+       # mtime of autoconf.texi will end up as embedded date in

autoconf.info.

meta/recipes-devtools/autoconf/autoconf.inc +7 -1
+       # We patch autoconf.texi, so that modifies mtime each time.
+       # To ensure reproducibility, set the mtime to SOURCE_DATE_EPOCH
+       if [ -n "${SOURCE_DATE_EPOCH}" ]; then
+               touch -d @${SOURCE_DATE_EPOCH} ${S}/doc/autoconf.texi
+       fi
+}
+
 do_install_append() {
     rm -rf ${D}${datadir}/emacs
 }
--

2.7.4

--
_______________________________________________
Openembedded-core mailing list
[email protected]
http://lists.openembedded.org/mailman/listinfo/openembedded-core

#2 lore raw
Quoted 3 lines

A neater fix might be to drop the documentation change from the patch we're applying, as it's unlikely that people will be reading the autoconf documentation.

Yes, I agree. That was my first thought, too. The less patches the better. I'll send a v2 of the patch to the ML and gauge the reaction.