[neon/qt/pyside2/Neon/release] debian: Backport proposed upstream patch to fix qApp flags handling.

Dmitry Shachnev null at kde.org
Wed Oct 19 14:56:29 BST 2022


Git commit b5401ab6988624ff0b5fcad65ea07b18c71ebed1 by Dmitry Shachnev.
Committed on 25/12/2020 at 17:33.
Pushed by jriddell into branch 'Neon/release'.

Backport proposed upstream patch to fix qApp flags handling.

Unblacklist QtWidgets::bug_307 test, it should not fail anymore.

M  +2    -0    debian/changelog
M  +5    -10   debian/patches/blacklist-failing-tests.patch
A  +53   -0    debian/patches/qApp-fix-flag-handling.patch
M  +1    -0    debian/patches/series

https://invent.kde.org/neon/qt/pyside2/commit/b5401ab6988624ff0b5fcad65ea07b18c71ebed1

diff --git a/debian/changelog b/debian/changelog
index 038aaef1..5043bc83 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -2,6 +2,8 @@ pyside2 (5.15.2-1) UNRELEASED; urgency=medium
 
   [ Dmitry Shachnev ]
   * Add missing dependencies to make the autopkgtest pass again.
+  * Backport proposed upstream patch to fix qApp flags handling.
+    - Unblacklist QtWidgets::bug_307 test, it should not fail anymore.
 
  -- Debian Qt/KDE Maintainers <debian-qt-kde at lists.debian.org>  Wed, 23 Dec 2020 21:07:14 +0300
 
diff --git a/debian/patches/blacklist-failing-tests.patch b/debian/patches/blacklist-failing-tests.patch
index cfc228c6..fec53d43 100644
--- a/debian/patches/blacklist-failing-tests.patch
+++ b/debian/patches/blacklist-failing-tests.patch
@@ -5,14 +5,14 @@ Subject: Blacklist failing tests
 Forwarded:
 https://bugreports.qt.io/projects/PYSIDE/issues/PYSIDE-1146?filter=allopenissues
 ---
- build_history/blacklist.txt | 9 +++++++++
- 1 file changed, 9 insertions(+)
+ build_history/blacklist.txt | 6 ++++++
+ 1 file changed, 6 insertions(+)
 
 diff --git a/build_history/blacklist.txt b/build_history/blacklist.txt
-index 9b63f97..9346cfb 100644
+index 9b63f97..8b65253 100644
 --- a/build_history/blacklist.txt
 +++ b/build_history/blacklist.txt
-@@ -25,8 +25,14 @@
+@@ -25,6 +25,9 @@
      linux
      darwin
      win32
@@ -21,13 +21,8 @@ index 9b63f97..9346cfb 100644
 +    linux
  [QtGui::qmatrix_test]
      win32
-+# segfault on exit, https://bugreports.qt.io/browse/PYSIDE-1447
-+[QtWidgets::bug_307]
-+    linux
  [QtWidgets::bug_576]
-     linux
-     win32
-@@ -86,6 +92,9 @@
+@@ -86,6 +89,9 @@
      win32
      linux
      darwin
diff --git a/debian/patches/qApp-fix-flag-handling.patch b/debian/patches/qApp-fix-flag-handling.patch
new file mode 100644
index 00000000..b4fcaa3a
--- /dev/null
+++ b/debian/patches/qApp-fix-flag-handling.patch
@@ -0,0 +1,53 @@
+From: Christian Tismer <tismer at stackless.com>
+Date: Wed, 23 Dec 2020 13:28:16 +0200
+Subject: qApp: fix flag handling in Python 3.8+ and a Python 3.9 issue
+
+This is an old problem that was solved for Python 2.7.
+From Python 3.8 on, the behavior is the same with Python 3.
+
+The fix finally was to extend a Python 2.7 patch to Python 3
+as well. See the Jira issue for details.
+
+This patch includes also a small patch that was mentioned as
+necessary for Python 3.9: Python issue 40217. I have seen no
+effect of this change yet but applied the patch, anyway.
+
+Origin: https://codereview.qt-project.org/c/pyside/pyside-setup/+/328046
+---
+ sources/shiboken2/libshiboken/basewrapper.cpp | 12 ++++++++++--
+ 1 file changed, 10 insertions(+), 2 deletions(-)
+
+diff --git a/sources/shiboken2/libshiboken/basewrapper.cpp b/sources/shiboken2/libshiboken/basewrapper.cpp
+index d866d13..b38fb3a 100644
+--- a/sources/shiboken2/libshiboken/basewrapper.cpp
++++ b/sources/shiboken2/libshiboken/basewrapper.cpp
+@@ -319,6 +319,11 @@ static int SbkObject_traverse(PyObject *self, visitproc visit, void *arg)
+ 
+     if (sbkSelf->ob_dict)
+         Py_VISIT(sbkSelf->ob_dict);
++
++#if PY_VERSION_HEX >= 0x03090000
++    // This was not needed before Python 3.9 (Python issue 35810 and 40217)
++    Py_VISIT(Py_TYPE(self));
++#endif
+     return 0;
+ }
+ 
+@@ -769,12 +774,15 @@ PyObject *SbkQAppTpNew(PyTypeObject *subtype, PyObject *, PyObject *)
+     // PYSIDE-560:
+     // We avoid to use this in Python 3, because we have a hard time to get
+     // write access to these flags
+-#ifndef IS_PY3K
++
++    // PYSIDE-1447:
++    // Since Python 3.8, we have the same weird flags handling in Python 3.8
++    // as well. The singleton Python is no longer needed and we could remove
++    // the whole special handling, maybe in another checkin.
+     if (PyType_HasFeature(subtype, Py_TPFLAGS_HAVE_GC)) {
+         subtype->tp_flags &= ~Py_TPFLAGS_HAVE_GC;
+         subtype->tp_free = PyObject_Del;
+     }
+-#endif
+     auto self = reinterpret_cast<SbkObject *>(MakeQAppWrapper(subtype));
+     return self == nullptr ? nullptr : _setupNew(self, subtype);
+ }
diff --git a/debian/patches/series b/debian/patches/series
index 7c8d5a85..74fc5939 100644
--- a/debian/patches/series
+++ b/debian/patches/series
@@ -2,3 +2,4 @@ update-sip-import.patch
 fix-spelling-errors.patch
 blacklist-failing-tests.patch
 fix-reuse-build.patch
+qApp-fix-flag-handling.patch



More information about the Neon-commits mailing list