From 152b1b5d6ee6dea47f1295c9813c6b4a0b2db2d7 Mon Sep 17 00:00:00 2001 From: Michel Alexandre Salim Date: Fri, 5 Aug 2022 12:18:20 -0500 Subject: [PATCH] Update to latest Git snapshot Signed-off-by: Michel Alexandre Salim --- .gitignore | 2 +- fix-python-311-tests.diff | 69 +++++++ libkdumpfile-0.4.1-fix-for-gcc12.patch | 11 - libkdumpfile-disable-erroring-tests.patch | 24 --- libkdumpfile-disable-failing-tests.patch | 195 ------------------ ...umpfile-disable-python-test_addrxlat.patch | 35 ---- libkdumpfile.spec | 51 +++-- s390x-disable-diskdump-split.diff | 18 ++ series | 6 +- sources | 2 +- 10 files changed, 116 insertions(+), 297 deletions(-) create mode 100644 fix-python-311-tests.diff delete mode 100644 libkdumpfile-0.4.1-fix-for-gcc12.patch delete mode 100644 libkdumpfile-disable-erroring-tests.patch delete mode 100644 libkdumpfile-disable-failing-tests.patch delete mode 100644 libkdumpfile-disable-python-test_addrxlat.patch create mode 100644 s390x-disable-diskdump-split.diff diff --git a/.gitignore b/.gitignore index dc01141..cdbcbbb 100644 --- a/.gitignore +++ b/.gitignore @@ -1 +1 @@ -/libkdumpfile-0.4.1.tar.gz +/libkdumpfile-*.tar.gz diff --git a/fix-python-311-tests.diff b/fix-python-311-tests.diff new file mode 100644 index 0000000..96b4cd2 --- /dev/null +++ b/fix-python-311-tests.diff @@ -0,0 +1,69 @@ +From 04d7211140b1ed1e0bd6b2927a0b36824febe987 Mon Sep 17 00:00:00 2001 +From: Michel Alexandre Salim +Date: Fri, 5 Aug 2022 14:51:06 -0500 +Subject: [PATCH] Fix Python tests for Python 3.11 + +The exception raised has changed: + +``` +====================================================================== +FAIL: test_lookup_tbl (__main__.TestMethod.test_lookup_tbl) +---------------------------------------------------------------------- +TypeError: int() argument must be a string, a bytes-like object or a real number, not 'NoneType' + +During handling of the above exception, another exception occurred: + +Traceback (most recent call last): + File "/builddir/build/BUILD/libkdumpfile-4829feb8a46e76ac2f2bc98f47b2f3f1d32300df/python/./test_addrxlat.py", line 293, in test_lookup_tbl + with self.assertRaisesRegexp(TypeError, 'must be.* a number'): +AssertionError: "must be.* a number" does not match "int() argument must be a string, a bytes-like object or a real number, not 'NoneType'" + +====================================================================== +FAIL: test_step_idx (__main__.TestStep.test_step_idx) +---------------------------------------------------------------------- +TypeError: int() argument must be a string, a bytes-like object or a real number, not 'NoneType' + +During handling of the above exception, another exception occurred: + +Traceback (most recent call last): + File "/builddir/build/BUILD/libkdumpfile-4829feb8a46e76ac2f2bc98f47b2f3f1d32300df/python/./test_addrxlat.py", line 595, in test_step_idx + with self.assertRaisesRegexp(TypeError, 'must be.* a number'): +AssertionError: "must be.* a number" does not match "int() argument must be a string, a bytes-like object or a real number, not 'NoneType'" +``` + +Signed-off-by: Michel Alexandre Salim +--- + python/test_addrxlat.py | 8 ++++---- + 1 file changed, 4 insertions(+), 4 deletions(-) + +diff --git a/python/test_addrxlat.py b/python/test_addrxlat.py +index 7a413c2..610cb29 100644 +--- a/python/test_addrxlat.py ++++ b/python/test_addrxlat.py +@@ -290,11 +290,11 @@ class TestMethod(unittest.TestCase): + meth.tbl = ((1,),) + with self.assertRaisesRegexp(ValueError, 'must be integer pairs'): + meth.tbl = ((1, 2, 3),) +- with self.assertRaisesRegexp(TypeError, 'must be.* a number'): ++ with self.assertRaisesRegexp(TypeError, 'must be.* a .*number'): + meth.tbl = ((None, None),) +- with self.assertRaisesRegexp(TypeError, 'must be.* a number'): ++ with self.assertRaisesRegexp(TypeError, 'must be.* a .*number'): + meth.tbl = ((1, None),) +- with self.assertRaisesRegexp(TypeError, 'must be.* a number'): ++ with self.assertRaisesRegexp(TypeError, 'must be.* a .*number'): + meth.tbl = ((None, 1),) + + def test_memarr_defaults(self): +@@ -592,7 +592,7 @@ class TestStep(unittest.TestCase): + step.idx = None + with self.assertRaisesRegexp(ValueError, 'more than [0-9]+ indices'): + step.idx = (0,) * (addrxlat.FIELDS_MAX + 2) +- with self.assertRaisesRegexp(TypeError, 'must be.* a number'): ++ with self.assertRaisesRegexp(TypeError, 'must be.* a .*number'): + step.idx = (None,) + + class TestOperator(unittest.TestCase): +-- +2.37.1 + diff --git a/libkdumpfile-0.4.1-fix-for-gcc12.patch b/libkdumpfile-0.4.1-fix-for-gcc12.patch deleted file mode 100644 index b4efc4f..0000000 --- a/libkdumpfile-0.4.1-fix-for-gcc12.patch +++ /dev/null @@ -1,11 +0,0 @@ -diff '--color=auto' -ruN libkdumpfile-0.4.1/src/kdumpfile/devmem.c libkdumpfile-0.4.1-fix-for-gcc12/src/kdumpfile/devmem.c ---- libkdumpfile-0.4.1/src/kdumpfile/devmem.c 2020-02-13 06:48:02.000000000 -0800 -+++ libkdumpfile-0.4.1-fix-for-gcc12/src/kdumpfile/devmem.c 2022-04-21 16:54:42.830664327 -0700 -@@ -84,6 +84,7 @@ - } - } - -+__attribute__((__noipa__)) - static int - xen_cpuid(uint32_t leaf, uint32_t subleaf, - uint32_t *eax, uint32_t *ebx, uint32_t *ecx, uint32_t *edx) diff --git a/libkdumpfile-disable-erroring-tests.patch b/libkdumpfile-disable-erroring-tests.patch deleted file mode 100644 index bd4199e..0000000 --- a/libkdumpfile-disable-erroring-tests.patch +++ /dev/null @@ -1,24 +0,0 @@ -Index: libkdumpfile-0.4.1/tests/Makefile.am -=================================================================== ---- libkdumpfile-0.4.1.orig/tests/Makefile.am -+++ libkdumpfile-0.4.1/tests/Makefile.am -@@ -206,7 +206,6 @@ test_scripts = \ - lkcd-short-page-gzip \ - lkcd-gap \ - lkcd-unordered \ -- lkcd-unordered-faroff \ - sys-xlat-x86_64-linux \ - sys-xlat-x86_64-linux-xen \ - xlatmap-check \ -Index: libkdumpfile-0.4.1/tests/Makefile.in -=================================================================== ---- libkdumpfile-0.4.1.orig/tests/Makefile.in -+++ libkdumpfile-0.4.1/tests/Makefile.in -@@ -857,7 +857,6 @@ test_scripts = \ - lkcd-short-page-gzip \ - lkcd-gap \ - lkcd-unordered \ -- lkcd-unordered-faroff \ - sys-xlat-x86_64-linux \ - sys-xlat-x86_64-linux-xen \ - xlatmap-check \ diff --git a/libkdumpfile-disable-failing-tests.patch b/libkdumpfile-disable-failing-tests.patch deleted file mode 100644 index 32a3f9e..0000000 --- a/libkdumpfile-disable-failing-tests.patch +++ /dev/null @@ -1,195 +0,0 @@ -Index: libkdumpfile-0.4.1/tests/Makefile.am -=================================================================== ---- libkdumpfile-0.4.1.orig/tests/Makefile.am -+++ libkdumpfile-0.4.1/tests/Makefile.am -@@ -162,7 +162,6 @@ test_scripts = \ - addrxlat-invalid-s390x-5l \ - addrxlat-invalid-x86_64 \ - addrxlat-linear \ -- addrxlat-table \ - addrxlat-memarr \ - diskdump-empty-i386 \ - diskdump-empty-ppc64 \ -@@ -174,7 +173,6 @@ test_scripts = \ - diskdump-basic-snappy \ - diskdump-multiread \ - diskdump-excluded \ -- early-version-code \ - elf-empty-aarch64 \ - elf-empty-i386 \ - elf-empty-i386-elf64 \ -@@ -185,7 +183,6 @@ test_scripts = \ - elf-empty-x86_64 \ - elf-prstatus-aarch64 \ - elf-prstatus-i386 \ -- elf-prstatus-ppc64 \ - elf-prstatus-x86_64 \ - elf-basic \ - elf-be \ -@@ -195,16 +192,12 @@ test_scripts = \ - elf-fractional \ - elf-multiread \ - elf-virt-phys-clash \ -- elf-vmcoreinfo \ -- elf-dom0-no-phys_base \ -- elf-xen_prstatus \ - lkcd-empty-i386 \ - lkcd-empty-ppc64 \ - lkcd-empty-x86_64 \ - lkcd-basic-raw \ - lkcd-basic-rle \ - lkcd-basic-gzip \ -- lkcd-multiread \ - lkcd-long-page-raw \ - lkcd-long-page-rle \ - lkcd-long-page-gzip \ -@@ -214,10 +207,6 @@ test_scripts = \ - lkcd-gap \ - lkcd-unordered \ - lkcd-unordered-faroff \ -- lkcd-duplicate \ -- lkcd-duplicate-middle \ -- multixlat-elf \ -- multixlat-same \ - sys-xlat-x86_64-linux \ - sys-xlat-x86_64-linux-xen \ - xlatmap-check \ -@@ -228,15 +217,8 @@ test_scripts = \ - xlat-os-s390x-4l \ - xlat-os-s390x-5l \ - xlat-os-x86_64-none \ -- xlat-linux-aarch64-5.2-va39 \ -- xlat-linux-aarch64-5.8-va39 \ -- xlat-linux-aarch64-5.8-va48 \ - xlat-linux-ia32 \ - xlat-linux-ia32-pae \ -- xlat-linux-ppc64-64k \ -- xlat-linux-s390x-2l \ -- xlat-linux-s390x-3l \ -- xlat-linux-s390x-4l \ - xlat-linux-x86_64-ktext-crosspage \ - xlat-linux-x86_64-ktext-pgt \ - xlat-linux-x86_64-ktext-1G \ -@@ -251,16 +233,12 @@ test_scripts = \ - xlat-linux-x86_64-2.6.11 \ - xlat-linux-x86_64-2.6.11-nover \ - xlat-linux-x86_64-2.6.27 \ -- xlat-linux-x86_64-2.6.27-cr3-xen \ - xlat-linux-x86_64-2.6.27-nover \ - xlat-linux-x86_64-2.6.31 \ -- xlat-linux-x86_64-2.6.31-cr3 \ - xlat-linux-x86_64-2.6.31-kvaddr \ - xlat-linux-x86_64-2.6.31-reloc \ - xlat-linux-x86_64-2.6.31-nover \ - xlat-linux-x86_64-2.6.31-nover-reloc \ -- xlat-linux-x86_64-2.6.31-nover-xen \ -- xlat-linux-x86_64-4.12-sme \ - xlat-linux-x86_64-4.13-nover \ - xlat-linux-x86_64-4.13-kaslr \ - xlat-linux-x86_64-5l \ -@@ -471,7 +449,6 @@ TESTS = $(test_scripts) \ - subattr \ - thread-errstr \ - typed-attr \ -- vmci-cleanup \ - vmci-lines-post \ - vmci-post \ - xlatop -Index: libkdumpfile-0.4.1/tests/Makefile.in -=================================================================== ---- libkdumpfile-0.4.1.orig/tests/Makefile.in -+++ libkdumpfile-0.4.1/tests/Makefile.in -@@ -100,7 +100,7 @@ check_PROGRAMS = addrxlat$(EXEEXT) addrm - TESTS = $(test_scripts) attriter$(EXEEXT) clearattr$(EXEEXT) \ - custom-meth$(EXEEXT) err-addrxlat$(EXEEXT) nometh$(EXEEXT) \ - subattr$(EXEEXT) thread-errstr$(EXEEXT) typed-attr$(EXEEXT) \ -- vmci-cleanup$(EXEEXT) vmci-lines-post$(EXEEXT) \ -+ vmci-lines-post$(EXEEXT) \ - vmci-post$(EXEEXT) xlatop$(EXEEXT) - subdir = tests - ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 -@@ -813,7 +813,6 @@ test_scripts = \ - addrxlat-invalid-s390x-5l \ - addrxlat-invalid-x86_64 \ - addrxlat-linear \ -- addrxlat-table \ - addrxlat-memarr \ - diskdump-empty-i386 \ - diskdump-empty-ppc64 \ -@@ -825,7 +824,6 @@ test_scripts = \ - diskdump-basic-snappy \ - diskdump-multiread \ - diskdump-excluded \ -- early-version-code \ - elf-empty-aarch64 \ - elf-empty-i386 \ - elf-empty-i386-elf64 \ -@@ -836,7 +834,6 @@ test_scripts = \ - elf-empty-x86_64 \ - elf-prstatus-aarch64 \ - elf-prstatus-i386 \ -- elf-prstatus-ppc64 \ - elf-prstatus-x86_64 \ - elf-basic \ - elf-be \ -@@ -846,16 +843,12 @@ test_scripts = \ - elf-fractional \ - elf-multiread \ - elf-virt-phys-clash \ -- elf-vmcoreinfo \ -- elf-dom0-no-phys_base \ -- elf-xen_prstatus \ - lkcd-empty-i386 \ - lkcd-empty-ppc64 \ - lkcd-empty-x86_64 \ - lkcd-basic-raw \ - lkcd-basic-rle \ - lkcd-basic-gzip \ -- lkcd-multiread \ - lkcd-long-page-raw \ - lkcd-long-page-rle \ - lkcd-long-page-gzip \ -@@ -865,10 +858,6 @@ test_scripts = \ - lkcd-gap \ - lkcd-unordered \ - lkcd-unordered-faroff \ -- lkcd-duplicate \ -- lkcd-duplicate-middle \ -- multixlat-elf \ -- multixlat-same \ - sys-xlat-x86_64-linux \ - sys-xlat-x86_64-linux-xen \ - xlatmap-check \ -@@ -879,15 +868,8 @@ test_scripts = \ - xlat-os-s390x-4l \ - xlat-os-s390x-5l \ - xlat-os-x86_64-none \ -- xlat-linux-aarch64-5.2-va39 \ -- xlat-linux-aarch64-5.8-va39 \ -- xlat-linux-aarch64-5.8-va48 \ - xlat-linux-ia32 \ - xlat-linux-ia32-pae \ -- xlat-linux-ppc64-64k \ -- xlat-linux-s390x-2l \ -- xlat-linux-s390x-3l \ -- xlat-linux-s390x-4l \ - xlat-linux-x86_64-ktext-crosspage \ - xlat-linux-x86_64-ktext-pgt \ - xlat-linux-x86_64-ktext-1G \ -@@ -902,16 +884,12 @@ test_scripts = \ - xlat-linux-x86_64-2.6.11 \ - xlat-linux-x86_64-2.6.11-nover \ - xlat-linux-x86_64-2.6.27 \ -- xlat-linux-x86_64-2.6.27-cr3-xen \ - xlat-linux-x86_64-2.6.27-nover \ - xlat-linux-x86_64-2.6.31 \ -- xlat-linux-x86_64-2.6.31-cr3 \ - xlat-linux-x86_64-2.6.31-kvaddr \ - xlat-linux-x86_64-2.6.31-reloc \ - xlat-linux-x86_64-2.6.31-nover \ - xlat-linux-x86_64-2.6.31-nover-reloc \ -- xlat-linux-x86_64-2.6.31-nover-xen \ -- xlat-linux-x86_64-4.12-sme \ - xlat-linux-x86_64-4.13-nover \ - xlat-linux-x86_64-4.13-kaslr \ - xlat-linux-x86_64-5l \ diff --git a/libkdumpfile-disable-python-test_addrxlat.patch b/libkdumpfile-disable-python-test_addrxlat.patch deleted file mode 100644 index 5333d53..0000000 --- a/libkdumpfile-disable-python-test_addrxlat.patch +++ /dev/null @@ -1,35 +0,0 @@ -Description: disable test_addrxlat.py - In the Debian build environment, it can't find the built object files. - And because this is built with autotools the python helpers don't apply either. -Author: Michel Alexandre Salim -Last-Update: 2022-05-11 ---- -This patch header follows DEP-3: http://dep.debian.net/deps/dep3/ -Index: libkdumpfile-0.4.1/python/Makefile.am -=================================================================== ---- libkdumpfile-0.4.1.orig/python/Makefile.am 2020-09-26 11:29:19.000000000 +0000 -+++ libkdumpfile-0.4.1/python/Makefile.am 2022-05-11 20:38:48.799039477 +0000 -@@ -89,8 +89,7 @@ - noinst_HEADERS = \ - addrxlatmod.h - --test_scripts = \ -- test_addrxlat.py -+test_scripts = - - dist_check_SCRIPTS = \ - $(test_scripts) -Index: libkdumpfile-0.4.1/python/Makefile.in -=================================================================== ---- libkdumpfile-0.4.1.orig/python/Makefile.in 2021-11-04 10:37:35.000000000 +0000 -+++ libkdumpfile-0.4.1/python/Makefile.in 2022-05-11 20:38:40.042798711 +0000 -@@ -590,8 +590,7 @@ - noinst_HEADERS = \ - addrxlatmod.h - --test_scripts = \ -- test_addrxlat.py -+test_scripts = - - dist_check_SCRIPTS = \ - $(test_scripts) diff --git a/libkdumpfile.spec b/libkdumpfile.spec index fd1f3a5..ee6c9fd 100644 --- a/libkdumpfile.spec +++ b/libkdumpfile.spec @@ -1,34 +1,38 @@ -# some tests are failing, toggle this to try building without the -# patches disabling them -%bcond_with all_tests +%global mainlibsover 10 +%global addrlibsover 3 -%global mainlibsover 9 -%global addrlibsover 2 +%global upstream_ver 0.4.1 +%global commit 4829feb8a46e76ac2f2bc98f47b2f3f1d32300df +%global shortcommit %(c=%{commit}; echo ${c:0:7}) +%global date 20220714 Name: libkdumpfile -Version: 0.4.1 +Version: %{upstream_ver}^%{date}%{shortcommit} Release: %autorelease Summary: Kernel coredump file access License: LGPLv3+ or GPLv2+ URL: https://github.com/ptesarik/libkdumpfile -Source: %{url}/releases/download/v%{version}/%{name}-%{version}.tar.gz -# disable the union of failing tests. Reported upstream: -# https://github.com/ptesarik/libkdumpfile/issues/40 -Source1: %{name}-disable-failing-tests.patch -# this only applies to %%{ix86} -Source2: %{name}-disable-erroring-tests.patch -Patch1: %{name}-0.4.1-fix-for-gcc12.patch -Patch2: %{name}-disable-python-test_addrxlat.patch +# Source: %%{url}/releases/download/v%%{version}/%%{name}-%%{version}.tar.gz +Source0: %{url}/archive/%{commit}/%{name}-%{shortcommit}.tar.gz +# https://github.com/ptesarik/libkdumpfile/issues/44 +Source1: s390x-disable-diskdump-split.diff +# https://github.com/ptesarik/libkdumpfile/pull/45 +Patch: fix-python-311-tests.diff BuildRequires: gcc-c++ BuildRequires: doxygen BuildRequires: make BuildRequires: sed +BuildRequires: libzstd-devel BuildRequires: lzo-devel BuildRequires: python3-devel BuildRequires: snappy-devel BuildRequires: zlib-devel +# for non-release builds +BuildRequires: autoconf +BuildRequires: automake +BuildRequires: libtool %global _description %{expand: libkdumpfile is a library to read kdump-compressed kernel core dumps.} @@ -71,19 +75,14 @@ The %{name}-devel package contains misc utilities built with %{name}. %prep -%autosetup -p1 -%if %{without all_tests} -%ifnarch x86_64 -# patch disabling union of tests failing on other arches -cat %{SOURCE1} | patch -p1 -%endif -%ifarch %{ix86} -# this test errors out only on 32-bit x86 -cat %{SOURCE2} | patch -p1 -%endif -%endif +%autosetup -p1 -n %{name}-%{commit} # Remove unneeded shebang sed -e "\|#!/usr/bin/env python|d" -i python/*/*.py +%ifarch s390x +cat %{SOURCE1} | patch -p1 +%endif +# non-release builds +autoreconf -fiv %build @@ -122,7 +121,7 @@ find $RPM_BUILD_ROOT -name '*.a' -exec rm -f {} ';' %doc doc/html %files -n python3-%{name} -%{python3_sitearch}/%{name}-%{version}-*.egg-info +%{python3_sitearch}/%{name}-%{upstream_ver}-*.egg-info %{python3_sitearch}/addrxlat/ %{python3_sitearch}/_addrxlat.*.so %{python3_sitearch}/kdumpfile/ diff --git a/s390x-disable-diskdump-split.diff b/s390x-disable-diskdump-split.diff new file mode 100644 index 0000000..af50dbe --- /dev/null +++ b/s390x-disable-diskdump-split.diff @@ -0,0 +1,18 @@ +Description: disable diskdump-split test + This should be applied on s390x only, where this test is failing +Author: Michel Alexandre Salim +Origin: other +Bug: https://github.com/ptesarik/libkdumpfile/issues/44 +Last-Update: 2022-08-05 +--- +This patch header follows DEP-3: http://dep.debian.net/deps/dep3/ +--- a/tests/Makefile.am ++++ b/tests/Makefile.am +@@ -184,7 +184,6 @@ test_scripts = \ + diskdump-basic-zstd \ + diskdump-multiread \ + diskdump-excluded \ +- diskdump-split \ + early-version-code \ + elf-empty-aarch64 \ + elf-empty-i386 \ diff --git a/series b/series index 05aeb0e..3cb9f6b 100644 --- a/series +++ b/series @@ -1,4 +1,2 @@ -libkdumpfile-0.4.1-fix-for-gcc12.patch -libkdumpfile-disable-failing-tests.patch -libkdumpfile-disable-erroring-tests.patch -libkdumpfile-disable-python-test_addrxlat.patch +fix-python-311-tests.diff +s390x-disable-diskdump-split.diff diff --git a/sources b/sources index 5373bd3..b0699f9 100644 --- a/sources +++ b/sources @@ -1 +1 @@ -SHA512 (libkdumpfile-0.4.1.tar.gz) = 48aaa53d3c977b02e155a0586eb6e3eb66e7c885bdb1beeeeabbdae47fe1770fb48eb7b923945d8b3cb0949676b27f4a9f1f434cf1f837b4af50210294816e96 +SHA512 (libkdumpfile-4829feb.tar.gz) = 43c7433ac8cabef6d620ee1bd53958527cabb88af9508ae8a14cddcbeb723752babcaefb99a6c1abb753a8138e34df930cb445392907b9b02474a0c11a578d69