Skip to contentSkip to conversation

quagga: fix reproducibily issue.

PATCH In review Jeremy A. Puhlman 2 participants 9 messages Mar 5, 2020 – Mar 7, 2020

lore
Share & tools
lore
#0 lore raw

PATCH 1/7 quagga: fix reproducibily issue.

From: Jeremy Puhlman <[email protected]>

version.h contains the options passed to configure, which includes the path to the recipe-sysroot on the build host.

---
 meta-networking/recipes-protocols/quagga/quagga.inc | 1 +
 1 file changed, 1 insertion(+)
meta-networking/recipes-protocols/quagga/quagga.inc +1 -0
index 310bc7eef..3494a4398 100644
@@ -106,6 +106,7 @@ do_install () {
     sed -i 's!/etc/!${sysconfdir}/!g' ${D}${sysconfdir}/init.d/* ${D}${sysconfdir}/default/watchquagga
     sed -i 's!/var/!${localstatedir}/!g' ${D}${sysconfdir}/init.d/* ${D}${sysconfdir}/default/volatiles/volatiles.03_quagga
     sed -i 's!^PATH=.*!PATH=${base_sbindir}:${sbindir}:${base_bindir}:${bindir}!' ${D}${sysconfdir}/init.d/*
+    sed -i 's!--with-libtool-sysroot=[^ "]*!!' ${D}${includedir}/quagga/version.h
 
     # For PAM
     for feature in ${DISTRO_FEATURES}; do
Signature · 1 line
2.20.1
#1 lore raw

PATCH 2/7 quagga: make version.h a multilib header

From: Jeremy Puhlman <[email protected]>

version.h contains the configure options passed during the build which differs between multilibs

---
 meta-networking/recipes-protocols/quagga/quagga.inc | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)
meta-networking/recipes-protocols/quagga/quagga.inc +3 -1
index 3494a4398..134a33d47 100644
@@ -40,7 +40,7 @@ PACKAGECONFIG ??= "${@bb.utils.filter('DISTRO_FEATURES', 'pam', d)}"
 PACKAGECONFIG[cap] = "--enable-capabilities,--disable-capabilities,libcap"
 PACKAGECONFIG[pam] = "--with-libpam, --without-libpam, libpam"
 
-inherit autotools update-rc.d useradd systemd pkgconfig
+inherit autotools update-rc.d useradd systemd pkgconfig multilib_header
 
 SYSTEMD_PACKAGES = "${PN} ${PN}-bgpd ${PN}-isisd ${PN}-ospf6d ${PN}-ospfd ${PN}-ripd ${PN}-ripngd"
 SYSTEMD_SERVICE_${PN}-bgpd = "bgpd.service"
@@ -108,6 +108,8 @@ do_install () {
     sed -i 's!^PATH=.*!PATH=${base_sbindir}:${sbindir}:${base_bindir}:${bindir}!' ${D}${sysconfdir}/init.d/*
     sed -i 's!--with-libtool-sysroot=[^ "]*!!' ${D}${includedir}/quagga/version.h
 
+    oe_multilib_header quagga/version.h
+
     # For PAM
     for feature in ${DISTRO_FEATURES}; do
         if [ "$feature" = "pam" ]; then
Signature · 1 line
2.20.1
#2 lore raw

PATCH 3/7 libdnet: make dnet-config a multilib_script

In reply to Jeremy A. Puhlman

From: Jeremy Puhlman <[email protected]>

Script encodes library paths.

---
 meta-networking/recipes-connectivity/libdnet/libdnet_1.12.bb | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)
meta-networking/recipes-connectivity/libdnet/libdnet_1.12.bb +3 -1
index 5b6e45c7b..5b27cfe15 100644
@@ -11,8 +11,10 @@ UPSTREAM_CHECK_GITTAGREGEX = "libdnet-(?P<pver>\d+(\.\d+)+)"
 
 S = "${WORKDIR}/git"
 
-inherit autotools
+inherit autotools multilib_script
 
 acpaths = "-I ./config/"
 
 BBCLASSEXTEND = "native"
+
+MULTILIB_SCRIPTS = "${PN}:${bindir}/dnet-config"
Signature · 1 line
2.20.1
#3 lore raw

PATCH 4/7 net-snmp: fix reproducibilty issues in net-snmp-config

In reply to Jeremy A. Puhlman

From: Jeremy Puhlman <[email protected]>

Both STAGING_HOST_DIR and -fmacro-prefix-map path to WORKDIR were encoded in the config.

---
 meta-networking/recipes-protocols/net-snmp/net-snmp_5.8.bb | 2 ++
 1 file changed, 2 insertions(+)
meta-networking/recipes-protocols/net-snmp/net-snmp_5.8.bb +2 -0
index 317350e94..91c50c4e3 100644
@@ -124,11 +124,13 @@ do_install_append() {
         -i ${D}${bindir}/net-snmp-create-v3-user
     sed -e 's@^NSC_SRCDIR=.*@NSC_SRCDIR=.@g' \
         -e 's@[^ ]*-fdebug-prefix-map=[^ "]*@@g' \
+        -e 's@[^ ]*-fmacro-prefix-map=[^ "]*@@g' \
         -e 's@[^ ]*--sysroot=[^ "]*@@g' \
         -e 's@[^ ]*--with-libtool-sysroot=[^ "]*@@g' \
         -e 's@[^ ]*--with-install-prefix=[^ "]*@@g' \
         -e 's@[^ ]*PKG_CONFIG_PATH=[^ "]*@@g' \
         -e 's@[^ ]*PKG_CONFIG_LIBDIR=[^ "]*@@g' \
+        -e 's@${STAGING_DIR_HOST}@@g' \
         -i ${D}${bindir}/net-snmp-config
 
     if [ "${HAS_PERL}" = "1" ]; then
Signature · 1 line
2.20.1
#4 lore raw

Re: [meta-networking][PATCH 4/7] net-snmp: fix reproducibilty issues in net-snmp-config

Hi Jeremy

Quoted 15 lines · Jeremy A. Puhlman

From: Jeremy Puhlman <[email protected]>

Both STAGING_HOST_DIR and -fmacro-prefix-map path to WORKDIR were encoded in the config.

---
  meta-networking/recipes-protocols/net-snmp/net-snmp_5.8.bb | 2 ++
  1 file changed, 2 insertions(+)
meta-networking/recipes-protocols/net-snmp/net-snmp_5.8.bb +0 -0
index 317350e94..91c50c4e3 100644

meta-networking/recipes-protocols/net-snmp/net-snmp_5.8.bb do_install_append() { · line 133

Quoted 10 lines
meta-networking/recipes-protocols/net-snmp/net-snmp_5.8.bb +2 -0
@@ -124,11 +124,13 @@ do_install_append() {
          -i ${D}${bindir}/net-snmp-create-v3-user
      sed -e 's@^NSC_SRCDIR=.*@NSC_SRCDIR=.@g' \
          -e 's@[^ ]*-fdebug-prefix-map=[^ "]*@@g' \
+        -e 's@[^ ]*-fmacro-prefix-map=[^ "]*@@g' \
          -e 's@[^ ]*--sysroot=[^ "]*@@g' \
          -e 's@[^ ]*--with-libtool-sysroot=[^ "]*@@g' \
          -e 's@[^ ]*--with-install-prefix=[^ "]*@@g' \
          -e 's@[^ ]*PKG_CONFIG_PATH=[^ "]*@@g' \
          -e 's@[^ ]*PKG_CONFIG_LIBDIR=[^ "]*@@g' \
+        -e 's@${STAGING_DIR_HOST}@@g' \

This is causing problems, indirectly like

https://errors.yoctoproject.org/Errors/Details/393851/
https://errors.yoctoproject.org/Errors/Details/393852/
https://errors.yoctoproject.org/Errors/Details/393853/

Since its editing out the paths, whats left is just /usr/lib and that gets added to compiler commandline as -L/usr/lib which thankfully gets caught by Build QA

perhaps this regexp can be made less greedy

#5 lore raw

Re: [meta-networking][PATCH 4/7] net-snmp: fix reproducibilty issues in net-snmp-config

Quoted 35 lines · Khem Raj

Hi Jeremy

Quoted 17 lines · Jeremy A. Puhlman

From: Jeremy Puhlman <[email protected]>

Both STAGING_HOST_DIR and -fmacro-prefix-map path to WORKDIR were encoded in the config.

---
  meta-networking/recipes-protocols/net-snmp/net-snmp_5.8.bb | 2 ++

  1 file changed, 2 insertions(+)
meta-networking/recipes-protocols/net-snmp/net-snmp_5.8.bb +0 -0
index 317350e94..91c50c4e3 100644
@@ -124,11 +124,13 @@ do_install_append() {

          -i ${D}${bindir}/net-snmp-create-v3-user sed -e 's@^NSC_SRCDIR=.*@NSC_SRCDIR=.@g' \

Quoted 8 lines

          -e 's@[^ ]*-fdebug-prefix-map=[^ "]*@@g' \
+        -e 's@[^ ]*-fmacro-prefix-map=[^ "]*@@g' \
          -e 's@[^ ]*--sysroot=[^ "]*@@g' \
          -e 's@[^ ]*--with-libtool-sysroot=[^ "]*@@g' \
          -e 's@[^ ]*--with-install-prefix=[^ "]*@@g' \
          -e 's@[^ ]*PKG_CONFIG_PATH=[^ "]*@@g' \
          -e 's@[^ ]*PKG_CONFIG_LIBDIR=[^ "]*@@g' \
+        -e 's@${STAGING_DIR_HOST}@@g' \

This is causing problems, indirectly like

https://errors.yoctoproject.org/Errors/Details/393851/
https://errors.yoctoproject.org/Errors/Details/393852/
https://errors.yoctoproject.org/Errors/Details/393853/

Quoted 5 lines

Since its editing out the paths, whats left is just /usr/lib and that gets added to compiler commandline as -L/usr/lib which thankfully gets caught by Build QA

perhaps this regexp can be made less greedy

Okay, no problem, I have some builds running locally to check.

Signature · 2 lines
Jeremy A. Puhlman
[email protected]
#6 lore raw

PATCH 5/7 net-snmp: multilib fixes

In reply to Jeremy A. Puhlman

From: Jeremy Puhlman <[email protected]>

net-snmp/net-snmp-config.h:
- encodes type sizes
- encodes pathing into the libdir net-snmp-config:
- encodes build configuration data and lib pathing.

---
 meta-networking/recipes-protocols/net-snmp/net-snmp_5.8.bb | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)
meta-networking/recipes-protocols/net-snmp/net-snmp_5.8.bb +5 -1
index 91c50c4e3..762dec48c 100644
@@ -35,7 +35,7 @@ SRC_URI[sha256sum] = "b2fc3500840ebe532734c4786b0da4ef0a5f67e51ef4c86b3345d697e4
 UPSTREAM_CHECK_URI = "https://sourceforge.net/projects/net-snmp/files/net-snmp/"
 UPSTREAM_CHECK_REGEX = "/net-snmp/(?P<pver>\d+(\.\d+)+)/"
 
-inherit autotools-brokensep update-rc.d siteinfo systemd pkgconfig perlnative ptest
+inherit autotools-brokensep update-rc.d siteinfo systemd pkgconfig perlnative ptest multilib_script multilib_header
 
 EXTRA_OEMAKE = "INSTALL_PREFIX=${D} OTHERLDFLAGS='${LDFLAGS}' HOST_CPPFLAGS='${BUILD_CPPFLAGS}'"
 
@@ -138,6 +138,8 @@ do_install_append() {
             -e "s@^NSC_LIBDIR=-L.*@NSC_LIBDIR=-L\$\{libdir\}@g" \
             -i ${D}${bindir}/net-snmp-config
     fi
+
+    oe_multilib_header net-snmp/net-snmp-config.h
 }
 
 do_install_ptest() {
@@ -270,3 +272,5 @@ RREPLACES_${PN}-server-snmptrapd += "${PN}-server-snmptrapd-systemd"
 RCONFLICTS_${PN}-server-snmptrapd += "${PN}-server-snmptrapd-systemd"
 
 LEAD_SONAME = "libnetsnmp.so"
+
+MULTILIB_SCRIPTS = "${PN}-dev:${bindir}/net-snmp-config"
Signature · 1 line
2.20.1
#7 lore raw

PATCH 6/7 proftpd: remove macro-prefix-map from prxs

In reply to Jeremy A. Puhlman

From: Jeremy Puhlman <[email protected]>

macro-prefix-map points to build WORKDIR which will cause reproducibilty failures.

---
 meta-networking/recipes-daemons/proftpd/proftpd_1.3.6.bb | 1 +
 1 file changed, 1 insertion(+)
meta-networking/recipes-daemons/proftpd/proftpd_1.3.6.bb +1 -0
index 409947265..a080bec81 100644
@@ -110,6 +110,7 @@ do_install () {
     sed -e 's|--sysroot=${STAGING_DIR_HOST}||g' \
         -e 's|${STAGING_DIR_NATIVE}||g' \
         -e 's|-fdebug-prefix-map=[^ ]*||g' \
+        -e 's|-fmacro-prefix-map=[^ ]*||g' \
         -i ${D}/${bindir}/prxs
 
     # ftpmail perl script, which reads the proftpd log file and sends
Signature · 1 line
2.20.1
#8 lore raw

PATCH 7/7 proftpd: make prxs a mulitlib script

In reply to Jeremy A. Puhlman

From: Jeremy Puhlman <[email protected]>

Script encodes compiler settings and compiler name.

my $compiler = q(x86_64-poky-linux-gcc -m64 -march=nehalem -mtune=generic -mfpmath=sse -msse4.2 );

---
 meta-networking/recipes-daemons/proftpd/proftpd_1.3.6.bb | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)
meta-networking/recipes-daemons/proftpd/proftpd_1.3.6.bb +3 -1
index a080bec81..d5bbdd374 100644
@@ -16,7 +16,7 @@ SRC_URI = "ftp://ftp.proftpd.org/distrib/source/${BPN}-${PV}.tar.gz \
 iSRC_URI[md5sum] = "13270911c42aac842435f18205546a1b"
 SRC_URI[sha256sum] = "91ef74b143495d5ff97c4d4770c6804072a8c8eb1ad1ecc8cc541b40e152ecaf"
 
-inherit autotools-brokensep useradd update-rc.d systemd
+inherit autotools-brokensep useradd update-rc.d systemd multilib_script
 
 PACKAGECONFIG ??= "shadow \
                    ${@bb.utils.filter('DISTRO_FEATURES', 'ipv6 pam', d)} \
@@ -134,6 +134,8 @@ GROUPADD_PARAM_${PN} = "--system ${FTPGROUP}"
 USERADD_PARAM_${PN} = "--system -g ${FTPGROUP} --home-dir /var/lib/${FTPUSER} --no-create-home \
                        --shell /bin/false ${FTPUSER}"
 
+MULTILIB_SCRIPTS = "${PN}:${bindir}/prxs"
+
 FILES_${PN} += "/home/${FTPUSER}"
 
 RDEPENDS_${PN} += "perl"
Signature · 1 line
2.20.1