From 2655f4b74ce18266c5a053f2a53c49b1a378f1f3 Mon Sep 17 00:00:00 2001 From: David Malcolm Date: Tue, 2 Apr 2013 16:51:25 -0400 Subject: [PATCH] 3.8.0-2: add workarounds for ppc64 (rhbz#924425) * Tue Apr 2 2013 David Malcolm - 3.8.0-2 - add workarounds for ppc64 (rhbz#924425) --- ...6516031d3c32abd640f09a4814ae4363f979.patch | 32 +++++++++++++++++++ pygobject-3.8.0-known-failures.txt | 24 ++++++++++++++ pygobject3.spec | 19 ++++++++++- 3 files changed, 74 insertions(+), 1 deletion(-) create mode 100644 c1fb6516031d3c32abd640f09a4814ae4363f979.patch create mode 100644 pygobject-3.8.0-known-failures.txt diff --git a/c1fb6516031d3c32abd640f09a4814ae4363f979.patch b/c1fb6516031d3c32abd640f09a4814ae4363f979.patch new file mode 100644 index 0000000..046ca4f --- /dev/null +++ b/c1fb6516031d3c32abd640f09a4814ae4363f979.patch @@ -0,0 +1,32 @@ +From c1fb6516031d3c32abd640f09a4814ae4363f979 Mon Sep 17 00:00:00 2001 +From: Simon Feltman +Date: Sun, 31 Mar 2013 08:32:34 +0000 +Subject: Fix stack corruption due to incorrect format for argument parser + +Fix call to PyArg_ParseTupleAndKeywords that used a format parser +of "l" meaning long (8 bytes) in combination with an output pointer +of guint (4 bytes). Change to use gulong with a format of "k". + +https://bugzilla.gnome.org/show_bug.cgi?id=696892 +--- +diff --git a/gi/_gobject/pygflags.c b/gi/_gobject/pygflags.c +index 83aa4dc..bdeaae7 100644 +--- a/gi/_gobject/pygflags.c ++++ b/gi/_gobject/pygflags.c +@@ -129,12 +129,12 @@ static PyObject * + pyg_flags_new(PyTypeObject *type, PyObject *args, PyObject *kwargs) + { + static char *kwlist[] = { "value", NULL }; +- guint value; ++ gulong value; + PyObject *pytc, *values, *ret, *pyint; + GType gtype; + GFlagsClass *eclass; + +- if (!PyArg_ParseTupleAndKeywords(args, kwargs, "l", kwlist, &value)) ++ if (!PyArg_ParseTupleAndKeywords(args, kwargs, "k", kwlist, &value)) + return NULL; + + pytc = PyObject_GetAttrString((PyObject *)type, "__gtype__"); +-- +cgit v0.9.1 diff --git a/pygobject-3.8.0-known-failures.txt b/pygobject-3.8.0-known-failures.txt new file mode 100644 index 0000000..28468b4 --- /dev/null +++ b/pygobject-3.8.0-known-failures.txt @@ -0,0 +1,24 @@ +diff -up pygobject-3.8.0/tests/test_gi.py.rhbz924425 pygobject-3.8.0/tests/test_gi.py +--- pygobject-3.8.0/tests/test_gi.py.rhbz924425 2013-04-02 15:12:13.023806151 -0400 ++++ pygobject-3.8.0/tests/test_gi.py 2013-04-02 15:18:08.320781858 -0400 +@@ -1507,6 +1507,20 @@ class TestEnumVFuncResults(unittest.Test + def do_vfunc_out_enum(self): + return GIMarshallingTests.Enum.VALUE3 + ++ # Failing on ppc64: ++ # https://bugzilla.redhat.com/show_bug.cgi?id=924425#c7 ++ # ++ # ====================================================================== ++ # FAIL: test_vfunc_return_enum (test_gi.TestEnumVFuncResults) ++ # ---------------------------------------------------------------------- ++ # Traceback (most recent call last): ++ # File "/builddir/build/BUILD/pygobject-3.8.0/tests/test_gi.py", line 1512, in test_vfunc_return_enum ++ # self.assertEqual(tester.vfunc_return_enum(), GIMarshallingTests.Enum.VALUE2) ++ # AssertionError: != ++ # ---------------------------------------------------------------------- ++ # ++ # Reported upstream as https://bugzilla.gnome.org/show_bug.cgi?id=697138 ++ @unittest.expectedFailure + def test_vfunc_return_enum(self): + tester = self.EnumTester() + self.assertEqual(tester.vfunc_return_enum(), GIMarshallingTests.Enum.VALUE2) diff --git a/pygobject3.spec b/pygobject3.spec index b7f951b..f7c2f3f 100644 --- a/pygobject3.spec +++ b/pygobject3.spec @@ -22,7 +22,7 @@ Name: pygobject3 Version: 3.8.0 -Release: 1%{?dist} +Release: 2%{?dist} License: LGPLv2+ and MIT Group: Development/Languages Summary: Python 2 bindings for GObject Introspection @@ -69,6 +69,18 @@ Patch2: pygobject-3.3.4-known-failures.patch # Not yet sent upstream: Patch3: test-list-marshalling.patch +# Cherrypick of enum-handling bug, needed to stop the test suite +# bombing out the Python interpreter on ppc64 (see rhbz#924425) +# This was: +# https://git.gnome.org/browse/pygobject/commit/?h=pygobject-3-8&id=c1fb6516031d3c32abd6 +Patch4: c1fb6516031d3c32abd640f09a4814ae4363f979.patch + +# Disable a test that still fails on ppc64 (see +# https://bugzilla.redhat.com/show_bug.cgi?id=924425#c7 ) +# Filed upstream as: +# https://bugzilla.gnome.org/show_bug.cgi?id=697138 +Patch5: pygobject-3.8.0-known-failures.txt + ### Build Dependencies ### BuildRequires: chrpath @@ -150,6 +162,8 @@ for use in Python 3 programs. %patch1 -p1 -b .ignore-more-pep8-errors %patch2 -p1 -b .known-failures %patch3 -p1 -b .test-list-marshalling +%patch4 -p1 -b .c1fb6516031d3c32abd640f09a4814ae4363f979 +%patch5 -p1 %if 0%{?with_python3} rm -rf %{py3dir} @@ -261,6 +275,9 @@ xvfb-run make DESTDIR=$RPM_BUILD_ROOT check %{verbosity} %endif # with_python3 %changelog +* Tue Apr 2 2013 David Malcolm - 3.8.0-2 +- add workarounds for ppc64 (rhbz#924425) + * Tue Mar 26 2013 Kalev Lember - 3.8.0-1 - Update to 3.8.0