diff mbox series

[2/2] perf: Fix for recent kernel upgrades

Message ID 20220920221250.1544461-2-richard.purdie@linuxfoundation.org
State Accepted, archived
Commit cf33e2ab2693eafaf0e5fc45666355d60e084281
Headers show
Series [1/2,v2] rpm: Upgrade 4.17.1 -> 4.18rc1 | expand

Commit Message

Richard Purdie Sept. 20, 2022, 10:12 p.m. UTC
With recent kernel changes in stable, the full path to python was being
encoded into binaries and python install files. Add some workarounds
for both issues to fix build reproducibility issues.

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
---
 meta/recipes-kernel/perf/perf.bb | 6 ++++++
 1 file changed, 6 insertions(+)

Comments

Bruce Ashfield Sept. 20, 2022, 10:17 p.m. UTC | #1
On Tue, Sep 20, 2022 at 6:12 PM Richard Purdie
<richard.purdie@linuxfoundation.org> wrote:
>
> With recent kernel changes in stable, the full path to python was being
> encoded into binaries and python install files. Add some workarounds
> for both issues to fix build reproducibility issues.

Ack'd.

Looks good to me. I was looking into this, but had only barely figured
out what was being encoded .. much less fix.

Bruce

>
> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
> ---
>  meta/recipes-kernel/perf/perf.bb | 6 ++++++
>  1 file changed, 6 insertions(+)
>
> diff --git a/meta/recipes-kernel/perf/perf.bb b/meta/recipes-kernel/perf/perf.bb
> index 9f7c300a40e..31bc04635d8 100644
> --- a/meta/recipes-kernel/perf/perf.bb
> +++ b/meta/recipes-kernel/perf/perf.bb
> @@ -145,6 +145,9 @@ do_install() {
>         # we are checking for this make target to be compatible with older perf versions
>         if ${@bb.utils.contains('PACKAGECONFIG', 'scripting', 'true', 'false', d)} && grep -q install-python_ext ${S}/tools/perf/Makefile*; then
>             oe_runmake DESTDIR=${D} install-python_ext
> +           if [ -e ${D}${libdir}/python*/site-packages/perf-*/SOURCES.txt ]; then
> +               sed -i -e 's#${WORKDIR}##g' ${D}${libdir}/python*/site-packages/perf-*/SOURCES.txt
> +           fi
>         fi
>  }
>
> @@ -245,6 +248,9 @@ do_configure:prepend () {
>          # change the Makefile line to remove everything before 'tools/perf'
>          sed -i -e "s%srcdir_SQ = \$(subst ','\\\'',\$(srcdir))%srcdir_SQ = \$(patsubst \%tools/perf,tools/perf,\$(subst ','\\\'',\$(srcdir)))%g" \
>              ${S}/tools/perf/Makefile.config
> +        # Avoid hardcoded path to python-native
> +        sed -i -e 's#\(PYTHON_WORD := \)$(call shell-wordify,$(PYTHON))#\1 python3#g' \
> +            ${S}/tools/perf/Makefile.config
>      fi
>      if [ -e "${S}/tools/perf/tests/Build" ]; then
>          # OUTPUT is the full path, we have python on the path so we remove it from the
> --
> 2.34.1
>
diff mbox series

Patch

diff --git a/meta/recipes-kernel/perf/perf.bb b/meta/recipes-kernel/perf/perf.bb
index 9f7c300a40e..31bc04635d8 100644
--- a/meta/recipes-kernel/perf/perf.bb
+++ b/meta/recipes-kernel/perf/perf.bb
@@ -145,6 +145,9 @@  do_install() {
 	# we are checking for this make target to be compatible with older perf versions
 	if ${@bb.utils.contains('PACKAGECONFIG', 'scripting', 'true', 'false', d)} && grep -q install-python_ext ${S}/tools/perf/Makefile*; then
 	    oe_runmake DESTDIR=${D} install-python_ext
+	    if [ -e ${D}${libdir}/python*/site-packages/perf-*/SOURCES.txt ]; then
+		sed -i -e 's#${WORKDIR}##g' ${D}${libdir}/python*/site-packages/perf-*/SOURCES.txt
+	    fi
 	fi
 }
 
@@ -245,6 +248,9 @@  do_configure:prepend () {
         # change the Makefile line to remove everything before 'tools/perf'
         sed -i -e "s%srcdir_SQ = \$(subst ','\\\'',\$(srcdir))%srcdir_SQ = \$(patsubst \%tools/perf,tools/perf,\$(subst ','\\\'',\$(srcdir)))%g" \
             ${S}/tools/perf/Makefile.config
+        # Avoid hardcoded path to python-native
+        sed -i -e 's#\(PYTHON_WORD := \)$(call shell-wordify,$(PYTHON))#\1 python3#g' \
+            ${S}/tools/perf/Makefile.config
     fi
     if [ -e "${S}/tools/perf/tests/Build" ]; then
         # OUTPUT is the full path, we have python on the path so we remove it from the