Skip to contentSkip to conversation

postgresql: improve reproducibility

PATCH New Hongxu Jia 1 participant 2 messages Jun 4, 2019

lore
Share & tools
lore

Hongxu Jia

author
#0 lore raw

PATCH 1/2 postgresql: improve reproducibility

- Make pg_config not record var-CC, var-CFLAGS, and configure which contains build paths

- Split pgxs in which Makefile.global contains build path from package postgresql to postgresql-server-dev, it refers ubuntu
Here is we got from Ubuntu 18.04

$ dpkg -c /var/cache/apt/archives/postgresql-server-dev-10_10.8-0ubuntu0.18.04.1_amd64.deb
-rwxr-xr-x root/root     30792 2019-05-07 17:20 ./usr/lib/postgresql/10/bin/pg_config
drwxr-xr-x root/root         0 2019-05-07 17:20 ./usr/lib/postgresql/10/lib/
drwxr-xr-x root/root         0 2019-05-07 17:20 ./usr/lib/postgresql/10/lib/pgxs/
drwxr-xr-x root/root         0 2019-05-07 17:20 ./usr/lib/postgresql/10/lib/pgxs/config/
drwxr-xr-x root/root         0 2019-05-07 17:20 ./usr/lib/postgresql/10/lib/pgxs/src/
-rw-r--r-- root/root     31309 2019-05-07 17:20 ./usr/lib/postgresql/10/lib/pgxs/src/Makefile.global
---
 .../files/0001-Improve-reproducibility.patch       | 39 ++++++++++++++++++++++
 meta-oe/recipes-dbs/postgresql/postgresql.inc      |  4 ++-
 meta-oe/recipes-dbs/postgresql/postgresql_11.3.bb  |  1 +
 3 files changed, 43 insertions(+), 1 deletion(-)
 create mode 100644 meta-oe/recipes-dbs/postgresql/files/0001-Improve-reproducibility.patch
meta-oe/recipes-dbs/postgresql/files/0001-Improve-reproducibility.patch new file +39 -0
new file mode 100644
index 0000000..32b7f42
@@ -0,0 +1,39 @@
+From 3c13315447fa175da6c9ebe59a039e611cdb5bd1 Mon Sep 17 00:00:00 2001
+From: Hongxu Jia <[email protected]>
+Date: Tue, 4 Jun 2019 13:45:30 +0800
+Subject: [PATCH] Improve reproducibility,
+
+Remove build patch from binaries which pg_config do
+not record var-CC, var-CFLAGS, and configure
+
+$ /usr/bin/pg_config --cc
+not recorded
+
+$ /usr/bin/pg_config --configure
+not recorded
+
+Upstream-Status: Inappropriate [oe specific]
+
+Signed-off-by: Hongxu Jia <[email protected]>
+---
+ src/common/Makefile | 4 ----
+ 1 file changed, 4 deletions(-)
+
+diff --git a/src/common/Makefile b/src/common/Makefile
+index 1fc2c66..5e6c457 100644
+--- a/src/common/Makefile
++++ b/src/common/Makefile
+@@ -27,10 +27,6 @@ include $(top_builddir)/src/Makefile.global
+ # don't include subdirectory-path-dependent -I and -L switches
+ STD_CPPFLAGS := $(filter-out -I$(top_srcdir)/src/include -I$(top_builddir)/src/include,$(CPPFLAGS))
+ STD_LDFLAGS := $(filter-out -L$(top_builddir)/src/common -L$(top_builddir)/src/port,$(LDFLAGS))
+-override CPPFLAGS += -DVAL_CONFIGURE="\"$(configure_args)\""
+-override CPPFLAGS += -DVAL_CC="\"$(CC)\""
+-override CPPFLAGS += -DVAL_CPPFLAGS="\"$(STD_CPPFLAGS)\""
+-override CPPFLAGS += -DVAL_CFLAGS="\"$(CFLAGS)\""
+ override CPPFLAGS += -DVAL_CFLAGS_SL="\"$(CFLAGS_SL)\""
+ override CPPFLAGS += -DVAL_LDFLAGS="\"$(STD_LDFLAGS)\""
+ override CPPFLAGS += -DVAL_LDFLAGS_EX="\"$(LDFLAGS_EX)\""
+-- 
+2.7.4
+
meta-oe/recipes-dbs/postgresql/postgresql.inc +3 -1
index 6e20231..0fe5d58 100644
@@ -280,7 +280,9 @@ FILES_${PN}-timezone = "${datadir}/${BPN}/timezone \
     ${datadir}/${BPN}/timezonesets \
 "
 RDEPENDS_${PN} += "${PN}-timezone"
-FILES_${PN}-server-dev = "${includedir}/${BPN}/server"
+FILES_${PN}-server-dev = "${includedir}/${BPN}/server \
+                          ${libdir}/${BPN}/pgxs \
+"
 
 FILES_libecpg = "${libdir}/libecpg*${SOLIBS}"
 FILES_libecpg-dev = "${libdir}/libecpg*${SOLIBSDEV} \
meta-oe/recipes-dbs/postgresql/postgresql_11.3.bb +1 -0
index ff9306c..a18eca3 100644
@@ -5,6 +5,7 @@ LIC_FILES_CHKSUM = "file://COPYRIGHT;md5=87da2b84884860b71f5f24ab37e7da78"
 SRC_URI += "\
    file://not-check-libperl.patch \
    file://0001-Add-support-for-RISC-V.patch \
+   file://0001-Improve-reproducibility.patch \
 "
 
 SRC_URI[md5sum] = "c2a729b754b8de86a969c86ec25db076"
Signature · 1 line
2.7.4
author
#1 lore raw

PATCH 2/2 net-snmp: split net-snmp-config to package net-snmp-dev

Move net-snmp-config in which contains build path from package net-snmp to net-snmp-dev.

It refers ubuntu, here are we got from Ubuntu 18.04

$ dpkg -c /var/cache/apt/archives/libsnmp-dev_5.7.3+dfsg-1.8ubuntu3.1_amd64.deb
drwxr-xr-x root/root         0 2018-10-15 22:16 ./usr/bin/
-rwxr-xr-x root/root     43797 2018-10-15 22:16 ./usr/bin/mib2c
-rwxr-xr-x root/root      8780 2018-10-15 22:16 ./usr/bin/mib2c-update
-rwxr-xr-x root/root     29427 2018-10-15 22:16 ./usr/bin/net-snmp-config
-rwxr-xr-x root/root      3688 2018-10-15 22:16 ./usr/bin/net-snmp-create-v3-user
---
 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 673142b..f0acaa8 100644
@@ -214,7 +214,11 @@ FILES_${PN}-lib-trapd = "${libdir}/libnetsnmptrapd${SOLIBS}"
 FILES_${PN} = ""
 FILES_${PN}-client = "${bindir}/* ${datadir}/snmp/"
 FILES_${PN}-dbg += "${libdir}/.debug/ ${sbindir}/.debug/ ${bindir}/.debug/"
-FILES_${PN}-dev += "${bindir}/mib2c ${bindir}/mib2c-update"
+FILES_${PN}-dev += "${bindir}/mib2c \
+                    ${bindir}/mib2c-update \
+                    ${bindir}/net-snmp-config \
+                    ${bindir}/net-snmp-create-v3-user \
+"
 
 CONFFILES_${PN}-server-snmpd = "${sysconfdir}/snmp/snmpd.conf"
 CONFFILES_${PN}-server-snmptrapd = "${sysconfdir}/snmp/snmptrapd.conf"
Signature · 1 line
2.7.4