[1/1] libtool: allow for use of reproducible_build bbclass

Submitted by Slater, Joseph on July 11, 2019, 8:27 p.m. | Patch ID: 163001

Details

Message ID 20190711202739.131168-1-joe.slater@windriver.com
State New
Headers show

Commit Message

Slater, Joseph July 11, 2019, 8:27 p.m.
In a reproducible build environment, do not put the build host
name into libtool.

Signed-off-by: Joe Slater <joe.slater@windriver.com>
---
 .../libtool/libtool/reproducible_build.patch       | 29 ++++++++++++++++++++++
 meta/recipes-devtools/libtool/libtool_2.4.6.bb     |  2 +-
 2 files changed, 30 insertions(+), 1 deletion(-)
 create mode 100644 meta/recipes-devtools/libtool/libtool/reproducible_build.patch

Patch hide | download patch | download mbox

diff --git a/meta/recipes-devtools/libtool/libtool/reproducible_build.patch b/meta/recipes-devtools/libtool/libtool/reproducible_build.patch
new file mode 100644
index 0000000..c770c24
--- /dev/null
+++ b/meta/recipes-devtools/libtool/libtool/reproducible_build.patch
@@ -0,0 +1,29 @@ 
+libtool: allow for reproducible build
+
+If we are in a reproducible build environment, do not put the build host
+name into libtool.
+
+Upstream-Status: Inappropriate [embedded specific]
+
+Signed-off-by: Joe Slater <joe.slater@windriver.com>
+
+--- a/m4/libtool.m4
++++ b/m4/libtool.m4
+@@ -728,7 +728,17 @@ _LT_CONFIG_SAVE_COMMANDS([
+     cat <<_LT_EOF >> "$cfgfile"
+ #! $SHELL
+ # Generated automatically by $as_me ($PACKAGE) $VERSION
++_LT_EOF
++    if test -n "${SOURCE_DATE_EPOCH}"; then
++        cat <<_LT_EOF >> "$cfgfile"
++# Libtool was configured for a reproducible build: ${SOURCE_DATE_EPOCH}
++_LT_EOF
++    else
++        cat <<_LT_EOF >> "$cfgfile"
+ # Libtool was configured on host `(hostname || uname -n) 2>/dev/null | sed 1q`:
++_LT_EOF
++    fi
++    cat <<_LT_EOF >> "$cfgfile"
+ # NOTE: Changes made to this file will be lost: look at ltmain.sh.
+ 
+ # Provide generalized library-building support services.
diff --git a/meta/recipes-devtools/libtool/libtool_2.4.6.bb b/meta/recipes-devtools/libtool/libtool_2.4.6.bb
index f5fdd00..a67d6dd 100644
--- a/meta/recipes-devtools/libtool/libtool_2.4.6.bb
+++ b/meta/recipes-devtools/libtool/libtool_2.4.6.bb
@@ -1,6 +1,6 @@ 
 require libtool-${PV}.inc
 
-SRC_URI += "file://multilib.patch"
+SRC_URI += "file://multilib.patch file://reproducible_build.patch"
 
 RDEPENDS_${PN} += "bash"
 

Comments

Adrian Bunk July 11, 2019, 8:44 p.m.
On Thu, Jul 11, 2019 at 01:27:39PM -0700, Joe Slater wrote:
> In a reproducible build environment, do not put the build host
> name into libtool.
>...
> +Upstream-Status: Inappropriate [embedded specific]
>...

This is not specific to embedded.

> +--- a/m4/libtool.m4
> ++++ b/m4/libtool.m4
> +@@ -728,7 +728,17 @@ _LT_CONFIG_SAVE_COMMANDS([
> +     cat <<_LT_EOF >> "$cfgfile"
> + #! $SHELL
> + # Generated automatically by $as_me ($PACKAGE) $VERSION
> ++_LT_EOF
> ++    if test -n "${SOURCE_DATE_EPOCH}"; then
> ++        cat <<_LT_EOF >> "$cfgfile"
> ++# Libtool was configured for a reproducible build: ${SOURCE_DATE_EPOCH}
> ++_LT_EOF
> ++    else
> ++        cat <<_LT_EOF >> "$cfgfile"
> + # Libtool was configured on host `(hostname || uname -n) 2>/dev/null | sed 1q`:
> ++_LT_EOF
> ++    fi
> ++    cat <<_LT_EOF >> "$cfgfile"
> + # NOTE: Changes made to this file will be lost: look at ltmain.sh.
> + 
>...

The Debian patch for the same purpose simply removes the problematic 
line - a comment with the build host was anyways not important information.

cu
Adrian
Ross Burton July 11, 2019, 9:55 p.m.
On Thu, 11 Jul 2019 at 21:45, Adrian Bunk <bunk@stusta.de> wrote:
> The Debian patch for the same purpose simply removes the problematic
> line - a comment with the build host was anyways not important information.

Agreed, it's just a comment, and replacing it with logic just means
more effort when we need to rebase.  Ideally, upstream remove that
comment too, as it doesn't have much value at all.

Ross
Slater, Joseph July 12, 2019, 1:51 a.m.
That's a question I have about things like this, where some information seems of minimal use, but is there and is now malignant.  Chuck it or modify it to be benign.

Joe

-----Original Message-----
From: Burton, Ross <ross.burton@intel.com> 
Sent: Thursday, July 11, 2019 2:56 PM
To: Adrian Bunk <bunk@stusta.de>
Cc: Slater, Joseph <joe.slater@windriver.com>; OE-core <openembedded-core@lists.openembedded.org>
Subject: Re: [OE-core] [oe-core][PATCH 1/1] libtool: allow for use of reproducible_build bbclass

On Thu, 11 Jul 2019 at 21:45, Adrian Bunk <bunk@stusta.de> wrote:
> The Debian patch for the same purpose simply removes the problematic 
> line - a comment with the build host was anyways not important information.

Agreed, it's just a comment, and replacing it with logic just means more effort when we need to rebase.  Ideally, upstream remove that comment too, as it doesn't have much value at all.

Ross
Adrian Bunk July 12, 2019, 6:30 a.m.
On Fri, Jul 12, 2019 at 01:51:26AM +0000, Slater, Joseph wrote:
> That's a question I have about things like this, where some information seems of minimal use, but is there and is now malignant.  Chuck it or modify it to be benign.

All such patches should be submitted upstream, and the final decision 
for that would be whatever upstream prefers.

If in doubt, I would start with whatever is the simplest correct change.
It is unlikely that someone will insist on keeping marginally relevant
information like in this case.

Debian has already done a lot of work regarding reproducible,
so checking there for existing patches first is always a good idea.

> Joe

cu
Adrian
Ross Burton July 12, 2019, 8:33 a.m.
On Fri, 12 Jul 2019 at 07:30, Adrian Bunk <bunk@stusta.de> wrote:
> Debian has already done a lot of work regarding reproducible,
> so checking there for existing patches first is always a good idea.

To expand on this for people who don't know how to mine Debian: first,
identify the source package.  In this case it's libtool but otherwise
you can search packages.debian.org.  Then search
https://sources.debian.org/patches for libtool and you find
https://sources.debian.org/patches/libtool/2.4.6-10/no_hostname.patch/.

Ross
Adrian Bunk July 12, 2019, 9:19 a.m.
On Fri, Jul 12, 2019 at 09:33:59AM +0100, Burton, Ross wrote:
> On Fri, 12 Jul 2019 at 07:30, Adrian Bunk <bunk@stusta.de> wrote:
> > Debian has already done a lot of work regarding reproducible,
> > so checking there for existing patches first is always a good idea.
> 
> To expand on this for people who don't know how to mine Debian: first,
> identify the source package.  In this case it's libtool but otherwise
> you can search packages.debian.org.  Then search
> https://sources.debian.org/patches for libtool and you find
> https://sources.debian.org/patches/libtool/2.4.6-10/no_hostname.patch/.

Another useful resource is https://tracker.debian.org/

https://tracker.debian.org/pkg/libtool has some useful links,
e.g. "browse source code" (links to sources.debian.org)
or "reproducibility" (see if it is reproducible in Debian unstable).

> Ross

cu
Adrian