[1/2] pulseaudio: improve reproducibility

Submitted by Hongxu Jia on Dec. 5, 2018, 2:11 a.m. | Patch ID: 156906

Details

Message ID 1543975908-38890-1-git-send-email-hongxu.jia@windriver.com
State New
Headers show

Commit Message

Hongxu Jia Dec. 5, 2018, 2:11 a.m.
Remove build host paths from generated binaries, the modification
is harmless for build time compiling and runtime executing.

[YOCTO #12638]

Signed-off-by: Hongxu Jia <hongxu.jia@windriver.com>
---
 .../pulseaudio/0001-improve-reproducibility.patch  | 50 ++++++++++++++++++++++
 .../pulseaudio/pulseaudio_12.2.bb                  |  1 +
 2 files changed, 51 insertions(+)
 create mode 100644 meta/recipes-multimedia/pulseaudio/pulseaudio/0001-improve-reproducibility.patch

Patch hide | download patch | download mbox

diff --git a/meta/recipes-multimedia/pulseaudio/pulseaudio/0001-improve-reproducibility.patch b/meta/recipes-multimedia/pulseaudio/pulseaudio/0001-improve-reproducibility.patch
new file mode 100644
index 0000000..b13adb2
--- /dev/null
+++ b/meta/recipes-multimedia/pulseaudio/pulseaudio/0001-improve-reproducibility.patch
@@ -0,0 +1,50 @@ 
+From e03d1d77471ee16c149590dd97085cf54be1e261 Mon Sep 17 00:00:00 2001
+From: Hongxu Jia <hongxu.jia@windriver.com>
+Date: Tue, 4 Dec 2018 16:29:18 +0800
+Subject: [PATCH] improve reproducibility
+
+- Do not define PA_CFLAGS with $CFLAGS which contains build host path,
+  macro PA_CFLAGS is used for debug log, the modification is harmless;
+
+- Tweak definition of PA_BUILDDIR and PA_SRCDIR with relative directory,
+  it is also harmless;
+
+Upstream-Status: Inappropriate [oe specific]
+
+Signed-off-by: Hongxu Jia <hongxu.jia@windriver.com>
+---
+ configure.ac    | 2 +-
+ src/Makefile.am | 4 ++--
+ 2 files changed, 3 insertions(+), 3 deletions(-)
+
+diff --git a/configure.ac b/configure.ac
+index c9c414f..94a2167 100644
+--- a/configure.ac
++++ b/configure.ac
+@@ -1452,7 +1452,7 @@ AS_IF([test "x$ax_pthread_ok" = "xyes"],
+ #            Output               #
+ ###################################
+ 
+-AC_DEFINE_UNQUOTED(PA_CFLAGS, "$CFLAGS", [The CFLAGS used during compilation])
++AC_DEFINE_UNQUOTED(PA_CFLAGS, "***", [The CFLAGS used during compilation])
+ 
+ # Check whether to build tests by default (as compile-test) or not
+ AC_ARG_ENABLE([default-build-tests],
+diff --git a/src/Makefile.am b/src/Makefile.am
+index f4464d2..1ec0bfc 100644
+--- a/src/Makefile.am
++++ b/src/Makefile.am
+@@ -48,8 +48,8 @@ AM_CPPFLAGS = \
+ 	-I$(top_builddir)/src/modules \
+ 	-DPA_ALSA_PATHS_DIR=\"$(alsapathsdir)\" \
+ 	-DPA_ALSA_PROFILE_SETS_DIR=\"$(alsaprofilesetsdir)\" \
+-	-DPA_SRCDIR=\"$(abs_srcdir)\" \
+-	-DPA_BUILDDIR=\"$(abs_builddir)\" \
++	-DPA_SRCDIR=\"$(ac_srcdir)\" \
++	-DPA_BUILDDIR=\"$(ac_builddir)\" \
+ 	-DPULSE_LOCALEDIR=\"$(localedir)\"
+ AM_CFLAGS = -std=gnu11 \
+ 	$(PTHREAD_CFLAGS)
+-- 
+2.7.4
+
diff --git a/meta/recipes-multimedia/pulseaudio/pulseaudio_12.2.bb b/meta/recipes-multimedia/pulseaudio/pulseaudio_12.2.bb
index 36d92bc..9cda50a 100644
--- a/meta/recipes-multimedia/pulseaudio/pulseaudio_12.2.bb
+++ b/meta/recipes-multimedia/pulseaudio/pulseaudio_12.2.bb
@@ -2,6 +2,7 @@  require pulseaudio.inc
 
 SRC_URI = "http://freedesktop.org/software/pulseaudio/releases/${BP}.tar.xz \
            file://0001-client-conf-Add-allow-autospawn-for-root.patch \
+           file://0001-improve-reproducibility.patch \
            file://volatiles.04_pulse \
            "
 SRC_URI[md5sum] = "c42f1f1465e8df9859d023dc184734bf"

Comments

Tanu Kaskinen Dec. 5, 2018, 11:17 a.m.
On Wed, 2018-12-05 at 10:11 +0800, Hongxu Jia wrote:
> Remove build host paths from generated binaries, the modification
> is harmless for build time compiling and runtime executing.
> 
> [YOCTO #12638]
> 
> Signed-off-by: Hongxu Jia <hongxu.jia@windriver.com>
> ---
>  .../pulseaudio/0001-improve-reproducibility.patch  | 50 ++++++++++++++++++++++
>  .../pulseaudio/pulseaudio_12.2.bb                  |  1 +
>  2 files changed, 51 insertions(+)
>  create mode 100644 meta/recipes-multimedia/pulseaudio/pulseaudio/0001-improve-reproducibility.patch
> 
> diff --git a/meta/recipes-multimedia/pulseaudio/pulseaudio/0001-improve-reproducibility.patch b/meta/recipes-multimedia/pulseaudio/pulseaudio/0001-improve-reproducibility.patch
> new file mode 100644
> index 0000000..b13adb2
> --- /dev/null
> +++ b/meta/recipes-multimedia/pulseaudio/pulseaudio/0001-improve-reproducibility.patch
> @@ -0,0 +1,50 @@
> +From e03d1d77471ee16c149590dd97085cf54be1e261 Mon Sep 17 00:00:00 2001
> +From: Hongxu Jia <hongxu.jia@windriver.com>
> +Date: Tue, 4 Dec 2018 16:29:18 +0800
> +Subject: [PATCH] improve reproducibility
> +
> +- Do not define PA_CFLAGS with $CFLAGS which contains build host path,
> +  macro PA_CFLAGS is used for debug log, the modification is harmless;
> +
> +- Tweak definition of PA_BUILDDIR and PA_SRCDIR with relative directory,
> +  it is also harmless;

I believe changing PA_BUILDDIR and PA_SRCDIR to relative directories
actually breaks the things that use those definitions. PA_BUILDDIR is
compared to the /proc/self/exe symlink target, which is an absolute
path. The definitions are needed when running PulseAudio from the
source tree without installing, so the breakage doesn't really matter
in OE, but it would be better to set them to values that clearly don't
work rather than something that looks like is intended to work but
actually doesn't.