From 109d276fe24e9e381cc2599347063cd7276fb63e Mon Sep 17 00:00:00 2001 From: Friedemann Kleint Date: Thu, 10 Jun 2021 11:46:08 +0200 Subject: build_scripts/Linux: Try to determine library dependencies with ldd first MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The build scripts used a reimplementation of ldd to determine library dependencies in case ldd is not installed which may fail on recent systems. Try ldd first and fall back to the reimplementation only if it fails. Change-Id: Icca16c2fae0ce6086284eb0194a28d8ec32daae6 Reviewed-by: Simo Fält (cherry picked from commit 2b1cc890293592c9f40dcc14119b726886a20fe8) Reviewed-by: Cristian Maureira-Fredes --- build_scripts/utils.py | 57 +++++++++++++++++++++++++++++++++++++++++++++++++- 1 file changed, 56 insertions(+), 1 deletion(-) diff --git a/build_scripts/utils.py b/build_scripts/utils.py index 002d6ae5b..5d62d4307 100644 --- a/build_scripts/utils.py +++ b/build_scripts/utils.py @@ -813,7 +813,36 @@ def ldd_get_paths_for_dependencies(dependencies_regex, executable_path=None, dep return paths -def ldd(executable_path): +def _ldd_ldd(executable_path): + """Helper for ldd(): + Returns ldd output of shared library dependencies for given + `executable_path`. + + Parameters + ---------- + executable_path : str + path to executable or shared library. + + Returns + ------- + output : str + the raw output retrieved from the dynamic linker. + """ + + output = '' + error = '' + try: + output_lines = run_process_output(['ldd', executable_path]) + output = '\n'.join(output_lines) + except Exception as e: + error = str(e) + if not output: + message = "ldd failed to query for dependent shared libraries of {}: {}".format(executable_path, error) + raise RuntimeError(message) + return output + + +def _ldd_ldso(executable_path): """ Returns ld.so output of shared library dependencies for given `executable_path`. @@ -873,6 +902,32 @@ def ldd(executable_path): "libraries of {} ".format(executable_path)) +def ldd(executable_path): + """ + Returns ldd output of shared library dependencies for given `executable_path`, + using either ldd or ld.so depending on availability. + + Parameters + ---------- + executable_path : str + path to executable or shared library. + + Returns + ------- + output : str + the raw output retrieved from the dynamic linker. + """ + result = '' + try: + result = _ldd_ldd(executable_path) + except RuntimeError as e: + message = "ldd: Falling back to ld.so ({})".format(str(e)) + log.warn(message) + if not result: + result = _ldd_ldso(executable_path) + return result + + def find_files_using_glob(path, pattern): """ Returns list of files that matched glob `pattern` in `path`. """ final_pattern = os.path.join(path, pattern) -- cgit v1.2.3 From 4a2ef3a73ba16f154c68dd871893ab36957e6992 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Simo=20F=C3=A4lt?= Date: Tue, 25 Jan 2022 11:07:19 +0200 Subject: Disable MacOS 11.0 configs from CI Change-Id: Ie56083203b775ad3bc772898e728656975aea87f Reviewed-by: Friedemann Kleint --- coin/module_config.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/coin/module_config.yaml b/coin/module_config.yaml index 99778cce6..d736b2355 100644 --- a/coin/module_config.yaml +++ b/coin/module_config.yaml @@ -18,7 +18,7 @@ accept_configuration: not_contains_value: -no-gui - condition: property # Following configs are not supported property: target.osVersion - not_in_values: [OPENSUSE_13_01, QEMU, WebAssembly, Ubuntu_18_04, SLES_12, SLES_15, MacOS_10_15] + not_in_values: [OPENSUSE_13_01, QEMU, WebAssembly, Ubuntu_18_04, SLES_12, SLES_15, MacOS_10_15, MacOS_11_00] - condition: property # MibnGW and msvc2015 are not supported property: target.compiler not_in_values: [Mingw, MSVC2015] -- cgit v1.2.3 From a670099bef5faac92fdcc2fffde372d419f488b7 Mon Sep 17 00:00:00 2001 From: Friedemann Kleint Date: Mon, 24 Jan 2022 13:56:05 +0100 Subject: shiboken6: Fix broken if statement when setting allow-thread allow-thread is unrelated to exception handling. Amends 099f3f46ca9ec1362f211278df4b3e4949b0a339. As a drive-by, rearrange the allow-thread such that "Unspecified" is 0. Task-number: PYSIDE-931 Change-Id: I8cea3e6428ec1feecc358042e54e5a8185ddfbfa Reviewed-by: Qt CI Bot Reviewed-by: Christian Tismer (cherry picked from commit 8daf85c871384db7a130415578873e73f3c04d84) --- sources/shiboken2/ApiExtractor/abstractmetabuilder.cpp | 2 +- sources/shiboken2/ApiExtractor/typesystem_enums.h | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/sources/shiboken2/ApiExtractor/abstractmetabuilder.cpp b/sources/shiboken2/ApiExtractor/abstractmetabuilder.cpp index b664c508d..5f4558814 100644 --- a/sources/shiboken2/ApiExtractor/abstractmetabuilder.cpp +++ b/sources/shiboken2/ApiExtractor/abstractmetabuilder.cpp @@ -1911,7 +1911,7 @@ AbstractMetaFunction *AbstractMetaBuilderPrivate::traverseFunction(const Functio for (const FunctionModification &mod : functionMods) { if (mod.exceptionHandling() != TypeSystem::ExceptionHandling::Unspecified) metaFunction->setExceptionHandlingModification(mod.exceptionHandling()); - else if (mod.allowThread() != TypeSystem::AllowThread::Unspecified) + if (mod.allowThread() != TypeSystem::AllowThread::Unspecified) metaFunction->setAllowThreadModification(mod.allowThread()); } diff --git a/sources/shiboken2/ApiExtractor/typesystem_enums.h b/sources/shiboken2/ApiExtractor/typesystem_enums.h index f47500dd9..4ac184629 100644 --- a/sources/shiboken2/ApiExtractor/typesystem_enums.h +++ b/sources/shiboken2/ApiExtractor/typesystem_enums.h @@ -37,10 +37,10 @@ enum Language { }; enum class AllowThread { + Unspecified, Allow, Disallow, - Auto, - Unspecified + Auto }; enum Ownership { -- cgit v1.2.3 From 59397d27834cc8eec5b1e77ec3b19c1c3558ebf1 Mon Sep 17 00:00:00 2001 From: Friedemann Kleint Date: Wed, 2 Feb 2022 18:07:07 +0100 Subject: Prospective fix for broken QByteArray::__msetitem__() on big endian architectures Remove a dubious cast from long to const char * which depends on byte order. Fixes: PYSIDE-1804 Change-Id: Iee2d809d4e9362b89439b9c56a5fb18e1f91d6fd Reviewed-by: Shyamnath Premnadh Reviewed-by: Christian Tismer (cherry picked from commit 0cfddaa56fb560c4ffb3809b7924a0fbb6f3889f) --- sources/pyside2/PySide2/glue/qtcore.cpp | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/sources/pyside2/PySide2/glue/qtcore.cpp b/sources/pyside2/PySide2/glue/qtcore.cpp index e8fd163d3..f19cb057d 100644 --- a/sources/pyside2/PySide2/glue/qtcore.cpp +++ b/sources/pyside2/PySide2/glue/qtcore.cpp @@ -1047,9 +1047,10 @@ if (PyIndex_Check(_key)) { if (PyLong_Check(item) || PyInt_Check(item)) { #endif int overflow; - long ival = PyLong_AsLongAndOverflow(item, &overflow); - // Not suppose to bigger than 255 because only bytes, bytearray, QByteArray were accept - temp = QByteArray(reinterpret_cast(&ival)); + const long ival = PyLong_AsLongAndOverflow(item, &overflow); + // Not supposed to be bigger than 255 because only bytes, + // bytearray, QByteArray were accepted + temp.append(char(ival)); } else { temp = %CONVERTTOCPP[QByteArray](item); } -- cgit v1.2.3 From 23ffa5906717e064f8fac27e3f402832fcdc1689 Mon Sep 17 00:00:00 2001 From: Friedemann Kleint Date: Wed, 16 Feb 2022 08:56:04 +0100 Subject: Update license year in the generated license Change-Id: Iaf63965069639e52e6c6d9c5c2f88cb98553e485 Reviewed-by: Shyamnath Premnadh Reviewed-by: Christian Tismer (cherry picked from commit e0f42f49c037c07a50820832f600997a621dd3c6) --- sources/pyside2/PySide2/licensecomment.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sources/pyside2/PySide2/licensecomment.txt b/sources/pyside2/PySide2/licensecomment.txt index 9dee056b1..96f567a98 100644 --- a/sources/pyside2/PySide2/licensecomment.txt +++ b/sources/pyside2/PySide2/licensecomment.txt @@ -1,6 +1,6 @@ /**************************************************************************** ** -** Copyright (C) 2021 The Qt Company Ltd. +** Copyright (C) 2022 The Qt Company Ltd. ** Contact: https://www.qt.io/licensing/ ** ** This file is part of Qt for Python. -- cgit v1.2.3 From 1b22fa59bffb2aedfdd106169b7501f0daeca3c5 Mon Sep 17 00:00:00 2001 From: Friedemann Kleint Date: Fri, 25 Feb 2022 21:21:24 +0100 Subject: Fix UNICODE conversion with Python3/Non-Limited API The code does not work the same way in Python2/3. Port the Python 3 code from PySide6. Fixes: PYSIDE-1835 Change-Id: I2859180e103492f6b10b2f658db3055593b49e43 Reviewed-by: Christian Tismer --- sources/pyside2/PySide2/glue/qtcore.cpp | 26 ++++++++++++++++++++------ 1 file changed, 20 insertions(+), 6 deletions(-) diff --git a/sources/pyside2/PySide2/glue/qtcore.cpp b/sources/pyside2/PySide2/glue/qtcore.cpp index f19cb057d..1d5b90ce5 100644 --- a/sources/pyside2/PySide2/glue/qtcore.cpp +++ b/sources/pyside2/PySide2/glue/qtcore.cpp @@ -1734,7 +1734,25 @@ Py_END_ALLOW_THREADS // @snippet conversion-pylong-quintptr // @snippet conversion-pyunicode -#ifndef Py_LIMITED_API +#if defined(Py_LIMITED_API) + wchar_t *temp = PyUnicode_AsWideCharString(%in, NULL); + %out = QString::fromWCharArray(temp); + PyMem_Free(temp); +#elif defined(IS_PY3K) + void *data = PyUnicode_DATA(%in); + Py_ssize_t len = PyUnicode_GetLength(%in); + switch (PyUnicode_KIND(%in)) { + case PyUnicode_1BYTE_KIND: + %out = QString::fromLatin1(reinterpret_cast(data)); + break; + case PyUnicode_2BYTE_KIND: + %out = QString::fromUtf16(reinterpret_cast(data), len); + break; + case PyUnicode_4BYTE_KIND: + %out = QString::fromUcs4(reinterpret_cast(data), len); + break; + } +#else // IS_PY3K Py_UNICODE *unicode = PyUnicode_AS_UNICODE(%in); # if defined(Py_UNICODE_WIDE) // cast as Py_UNICODE can be a different type @@ -1750,11 +1768,7 @@ Py_UNICODE *unicode = PyUnicode_AS_UNICODE(%in); %out = QString::fromUtf16(reinterpret_cast(unicode), PepUnicode_GetLength(%in)); # endif // Qt 6 # endif -#else -wchar_t *temp = PyUnicode_AsWideCharString(%in, NULL); -%out = QString::fromWCharArray(temp); -PyMem_Free(temp); -#endif +#endif // !IS_PY3K // @snippet conversion-pyunicode // @snippet conversion-pystring -- cgit v1.2.3 From b4f0822d68099fbcdbfdd1aa93d7192cc9db83e4 Mon Sep 17 00:00:00 2001 From: Friedemann Kleint Date: Wed, 16 Feb 2022 15:42:44 +0100 Subject: PySide6: Fix parent relationship in QWizard::setPage() Similar to QWizard::addPage() Change-Id: I4702d044551353b373ac4da9a0cd5692dd685ca9 Reviewed-by: Christian Tismer (cherry picked from commit aaf93cb34f30f36fa9622b29c21aaef29be02676) --- sources/pyside2/PySide2/QtWidgets/typesystem_widgets_common.xml | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/sources/pyside2/PySide2/QtWidgets/typesystem_widgets_common.xml b/sources/pyside2/PySide2/QtWidgets/typesystem_widgets_common.xml index 91458e313..6a6845f58 100644 --- a/sources/pyside2/PySide2/QtWidgets/typesystem_widgets_common.xml +++ b/sources/pyside2/PySide2/QtWidgets/typesystem_widgets_common.xml @@ -548,6 +548,11 @@ + + + + + -- cgit v1.2.3 From 7f91a72734d1fa5c37a07bc2e0db4d1dfc40b5c1 Mon Sep 17 00:00:00 2001 From: Friedemann Kleint Date: Wed, 23 Mar 2022 14:00:19 +0100 Subject: PySide6: Fix crash when implementing QQuickFramebufferObject.createRenderer() Pass the ownership to C++. Fixes: PYSIDE-1868 Change-Id: I52c0c7778a2d89b38406d6c1e15482855057fb5c Reviewed-by: Cristian Maureira-Fredes (cherry picked from commit 45002cd9d60b03045584d5dc210e8499ec11a996) --- sources/pyside2/PySide2/QtQuick/typesystem_quick.xml | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/sources/pyside2/PySide2/QtQuick/typesystem_quick.xml b/sources/pyside2/PySide2/QtQuick/typesystem_quick.xml index 4f6d9086c..9e3b50cbc 100644 --- a/sources/pyside2/PySide2/QtQuick/typesystem_quick.xml +++ b/sources/pyside2/PySide2/QtQuick/typesystem_quick.xml @@ -57,6 +57,11 @@ + + + + + -- cgit v1.2.3 From 070ca71cdf43bee931576cc7e91056fb9bac81df Mon Sep 17 00:00:00 2001 From: Friedemann Kleint Date: Mon, 28 Mar 2022 09:40:39 +0200 Subject: Fix endless recursion querying __doc__ of a property Add a check for None Fixes: PYSIDE-1874 Change-Id: I0127ba77ef2017dae232f2a1db1410d9cfe62405 Reviewed-by: Shyamnath Premnadh Reviewed-by: Cristian Maureira-Fredes (cherry picked from commit 370e5c712cafb1ff3ca22cc1f9794904f6d7a14a) --- sources/pyside2/libpyside/pysideproperty.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sources/pyside2/libpyside/pysideproperty.cpp b/sources/pyside2/libpyside/pysideproperty.cpp index cd87c1e1b..f929f085e 100644 --- a/sources/pyside2/libpyside/pysideproperty.cpp +++ b/sources/pyside2/libpyside/pysideproperty.cpp @@ -355,7 +355,7 @@ static PyObject *qPropertyDocGet(PyObject *self, void *) if (pData->fget != nullptr) { // PYSIDE-1019: Fetch the default `__doc__` from fget. We do it late. AutoDecRef get_doc(PyObject_GetAttr(pData->fget, PyMagicName::doc())); - if (!get_doc.isNull()) { + if (!get_doc.isNull() && get_doc.object() != Py_None) { pData->doc = String::toCString(get_doc); pData->getter_doc = true; if (Py_TYPE(self) == PySidePropertyTypeF()) -- cgit v1.2.3 From 15c46c0f590d3b4eb4606378ccc8e311ee44f4c0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Simo=20F=C3=A4lt?= Date: Mon, 28 Mar 2022 16:21:43 +0300 Subject: Use different mirror if download.qt.io fails MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Pick-to: 6.2 Change-Id: I36303943a6559ad7ff20e54478ec93a2d997651a Reviewed-by: Cristian Maureira-Fredes (cherry picked from commit 192909a77f9c8caa4cd6d24987761fbca7ea199e) Reviewed-by: Simo Fält --- build_scripts/platforms/windows_desktop.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/build_scripts/platforms/windows_desktop.py b/build_scripts/platforms/windows_desktop.py index 6b92c0823..4750015ab 100644 --- a/build_scripts/platforms/windows_desktop.py +++ b/build_scripts/platforms/windows_desktop.py @@ -274,7 +274,7 @@ def copy_msvc_redist_files(vars, redist_target_path): download_and_extract_7z(redist_url + zip_file, redist_target_path) except: print("download.qt.io is down, try with mirror") - redist_url = "https://www.funet.fi/pub/mirrors/download.qt-project.org/development_releases/prebuilt/vcredist/" + redist_url = "https://master.qt.io/development_releases/prebuilt/vcredist/" download_and_extract_7z(redist_url + zip_file, redist_target_path) else: print("Qt dependency DLLs (MSVC redist) will not be downloaded and extracted.") -- cgit v1.2.3 From ee11074ac2d391981e4def026b03604d4732c9f6 Mon Sep 17 00:00:00 2001 From: Christian Tismer Date: Fri, 1 Apr 2022 17:57:49 +0200 Subject: Support a Python 3.10 build in 5.15 without limited API The original patch worked with limited API, only. This one adds the missing _Py_Mangle function as in PySide 6.X and modernizes and fixes the modern embedding support. A remaining problem is building with debug Python 3.10 . There are many refcount errors which need to be found again, because they all were solved in PySide 6.X . With the same limited quality of the solution for 5.15 and the limited API, this is a fix, the debug problem comes later. Task-number: PYSIDE-1749 Fixes: PYSIDE-1775 Change-Id: I18a9b6756e49850c5d2d2e65b65e1ae934154905 Reviewed-by: Qt CI Bot Reviewed-by: Friedemann Kleint --- .../libshiboken/embed/signature_bootstrap.py | 42 +++++++++++----------- sources/shiboken2/libshiboken/pep384impl.cpp | 4 +-- 2 files changed, 24 insertions(+), 22 deletions(-) diff --git a/sources/shiboken2/libshiboken/embed/signature_bootstrap.py b/sources/shiboken2/libshiboken/embed/signature_bootstrap.py index b461ea229..508dd3fae 100644 --- a/sources/shiboken2/libshiboken/embed/signature_bootstrap.py +++ b/sources/shiboken2/libshiboken/embed/signature_bootstrap.py @@ -44,6 +44,11 @@ recursion_trap = 0 # Python 2 is not able to import when the extension import is still active. # Phase 1 simply defines the functions, which will be used in Phase 2. +import sys +if sys.version_info[0] >= 3: + from importlib.machinery import ModuleSpec + + def bootstrap(): import sys import os @@ -186,31 +191,28 @@ class EmbeddableZipImporter(object): return None self.zfile = zip_file - self._path2mod = {_.filename : p2m(_.filename) for _ in zip_file.filelist} - self._mod2path = {_[1] : _[0] for _ in self._path2mod.items()} + self._mod2path = {p2m(_.filename) : _.filename for _ in zip_file.filelist} - def find_module(self, fullname, path): - return self if self._mod2path.get(fullname) else None + def find_spec(self, fullname, path, target=None): + path = self._mod2path.get(fullname) + return ModuleSpec(fullname, self) if path else None - def load_module(self, fullname): - import importlib - import sys + def create_module(self, spec): + return None - filename = self._mod2path.get(fullname) - if filename not in self._path2mod: - raise ImportError(fullname) - module_spec = importlib.machinery.ModuleSpec(fullname, None) - new_module = importlib.util.module_from_spec(module_spec) + def exec_module(self, module): + fullname = module.__spec__.name + filename = self._mod2path[fullname] with self.zfile.open(filename, "r") as f: # "rb" not for zipfile - exec(f.read(), new_module.__dict__) - new_module.__file__ = filename - new_module.__loader__ = self + codeob = compile(f.read(), filename, "exec") + exec(codeob, module.__dict__) + module.__file__ = filename + module.__loader__ = self if filename.endswith("/__init__.py"): - new_module.__path__ = [] - new_module.__package__ = fullname + module.__path__ = [] + module.__package__ = fullname else: - new_module.__package__ = fullname.rpartition('.')[0] - sys.modules[fullname] = new_module - return new_module + module.__package__ = fullname.rpartition('.')[0] + sys.modules[fullname] = module # eof diff --git a/sources/shiboken2/libshiboken/pep384impl.cpp b/sources/shiboken2/libshiboken/pep384impl.cpp index 629d5d84c..5b95b35ac 100644 --- a/sources/shiboken2/libshiboken/pep384impl.cpp +++ b/sources/shiboken2/libshiboken/pep384impl.cpp @@ -733,7 +733,7 @@ _Pep_PrivateMangle(PyObject *self, PyObject *name) #endif // IS_PY2 Shiboken::AutoDecRef privateobj(PyObject_GetAttr( reinterpret_cast(Py_TYPE(self)), Shiboken::PyMagicName::name())); -#ifndef Py_LIMITED_API +#ifdef IS_PY2 return _Py_Mangle(privateobj, name); #else // PYSIDE-1436: _Py_Mangle is no longer exposed; implement it always. @@ -771,7 +771,7 @@ _Pep_PrivateMangle(PyObject *self, PyObject *name) if (amount > big_stack) free(resbuf); return result; -#endif // else Py_LIMITED_API +#endif // else IS_PY2 } /***************************************************************************** -- cgit v1.2.3 From d51a393db5e1414e9f07b4f9f8f6c968a98920cb Mon Sep 17 00:00:00 2001 From: Friedemann Kleint Date: Fri, 8 Apr 2022 09:04:21 +0200 Subject: Fix crashes with named parameters Cherry-pick 5f1459ac96ab97f85d1391b7d3ec424c782e5b52 of 3d9fa77b9fd556fdd87125aa33ce0a3bf8dda3f9 failed to remove Py_DECREF(kwds_dup). Task-number: PYSIDE-1697 Fixes: PYSIDE-1881 Change-Id: I352df489a15d2c799d177226bad7c5e00fb71a91 Reviewed-by: Shyamnath Premnadh --- sources/shiboken2/generator/shiboken2/cppgenerator.cpp | 5 ----- 1 file changed, 5 deletions(-) diff --git a/sources/shiboken2/generator/shiboken2/cppgenerator.cpp b/sources/shiboken2/generator/shiboken2/cppgenerator.cpp index 0a8db80f6..fa225035a 100644 --- a/sources/shiboken2/generator/shiboken2/cppgenerator.cpp +++ b/sources/shiboken2/generator/shiboken2/cppgenerator.cpp @@ -3301,11 +3301,6 @@ void CppGenerator::writeNamedArgumentResolution(QTextStream &s, const AbstractMe else s << INDENT << "// fall through to handle extra keyword signals and properties\n"; } - s << INDENT << "} else {\n"; - { - Indentation indent(INDENT); - s << INDENT << "Py_DECREF(kwds_dup);\n"; - } s << INDENT << "}\n"; } s << INDENT << "}\n"; -- cgit v1.2.3 From 0487dfdde2e1cdebbff5aef8479359b5a56b01a0 Mon Sep 17 00:00:00 2001 From: Friedemann Kleint Date: Thu, 24 Mar 2022 14:10:24 +0100 Subject: Add changelog for 5.15.9 Change-Id: I81ab3773383f922ab9b9db3a8f39b99247fbe65b Reviewed-by: Cristian Maureira-Fredes --- dist/changes-5.15.9 | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) create mode 100644 dist/changes-5.15.9 diff --git a/dist/changes-5.15.9 b/dist/changes-5.15.9 new file mode 100644 index 000000000..e31f9b206 --- /dev/null +++ b/dist/changes-5.15.9 @@ -0,0 +1,26 @@ +Qt for Python 5.15.9 is a bug-fix release. + +For more details, refer to the online documentation included in this +distribution. The documentation is also available online: + +https://doc.qt.io/qtforpython/ + +Some of the changes listed in this file include issue tracking numbers +corresponding to tasks in the Qt Bug Tracker: + +https://bugreports.qt.io/ + +Each of these identifiers can be entered in the bug tracker to obtain more +information about a particular change. + +**************************************************************************** +* PySide2 * +**************************************************************************** + + - [PYSIDE-1804] QByteArray::__msetitem__() was fixed for big endian + architectures + - [PYSIDE-1835] UNICODE conversion with Python3/Non-Limited API was fixed. + +**************************************************************************** +* Shiboken2 * +**************************************************************************** -- cgit v1.2.3 From c88381da918dc7eb12a47e4caac1d2ff2f196888 Mon Sep 17 00:00:00 2001 From: Luc Touraille Date: Thu, 7 Apr 2022 11:38:15 +0200 Subject: Fix uninitialized variable causing crash when using shiboken.delete The isQAppSingleton flag was not initialized, meaning that any shiboken wrapper could be randomly considered as a QCoreApp one. Change-Id: I96c836762a2ad2a6e8978dee10965c086bd50645 Reviewed-by: Friedemann Kleint (cherry picked from commit fca1416b4f4aedc640f05a8183e04b67ea117495) --- sources/shiboken2/libshiboken/basewrapper.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/sources/shiboken2/libshiboken/basewrapper.cpp b/sources/shiboken2/libshiboken/basewrapper.cpp index d84302458..6ed64e562 100644 --- a/sources/shiboken2/libshiboken/basewrapper.cpp +++ b/sources/shiboken2/libshiboken/basewrapper.cpp @@ -786,6 +786,7 @@ static PyObject *_setupNew(SbkObject *self, PyTypeObject *subtype) d->parentInfo = nullptr; d->referredObjects = nullptr; d->cppObjectCreated = 0; + d->isQAppSingleton = 0; self->ob_dict = nullptr; self->weakreflist = nullptr; self->d = d; -- cgit v1.2.3 From ed759eaa5665d3c9f134ffd75d41edc3fc22a462 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Simo=20F=C3=A4lt?= Date: Tue, 29 Mar 2022 14:12:37 +0300 Subject: Update qt5 dependency Pinned to Qt5#lts-5.15.9 sha1. Change-Id: Ic3905b02a5288dab77b767cbe37b442b0efa44c2 Reviewed-by: Cristian Maureira-Fredes --- coin/dependencies.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/coin/dependencies.yaml b/coin/dependencies.yaml index 8eaa2318f..4652d72b6 100644 --- a/coin/dependencies.yaml +++ b/coin/dependencies.yaml @@ -1,6 +1,6 @@ product_dependency: ../../qt/tqtc-qt5.git: - ref: "tqtc/lts-5.15" + ref: "36519195612b6596da28e19ea369c22c26ea4ba2" dependency_source: supermodule dependencies: [ "../../qt/qt3d", -- cgit v1.2.3 From 4187f1d7bfba5b519cfa0880fce6f793c0ffb6f1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Simo=20F=C3=A4lt?= Date: Thu, 25 Nov 2021 16:08:21 +0200 Subject: Build macOS universal binary Collection of bits and pieces to enable MacOS universal wheel creation in Qt CI. Change-Id: I0a889258ec4f89ca3a26c8bf2ee76f0d5c676a7a Reviewed-by: Cristian Maureira-Fredes --- build_scripts/utils.py | 16 ++++++++- coin/instructions/common_environment.yaml | 30 +++++++++++++++-- coin/instructions/execute_build_instructions.yaml | 29 +++++++++++++--- coin/instructions/execute_test_instructions.yaml | 30 ++++++++++++++--- coin/module_config.yaml | 12 ++++++- coin_build_instructions.py | 40 ++++++++++++++++++----- coin_test_instructions.py | 32 +++++++++++------- 7 files changed, 157 insertions(+), 32 deletions(-) diff --git a/build_scripts/utils.py b/build_scripts/utils.py index 5d62d4307..49839e2de 100644 --- a/build_scripts/utils.py +++ b/build_scripts/utils.py @@ -47,6 +47,7 @@ import subprocess import fnmatch import itertools import glob +from os.path import expanduser # There is no urllib.request in Python2 try: @@ -1157,7 +1158,7 @@ def install_pip_dependencies(env_pip, packages, upgrade=True): def get_qtci_virtualEnv(python_ver, host, hostArch, targetArch): - _pExe = "python" + _pExe = "python2" _env = "env{}".format(str(python_ver)) env_python = _env + "/bin/python" env_pip = _env + "/bin/pip" @@ -1229,3 +1230,16 @@ def get_ci_qmake_path(ci_install_dir, ci_host_os): return qmake_path + "\\bin\\qmake.exe" else: return qmake_path + "/bin/qmake" + + +def provisioning(): + home = expanduser("~") + file = "https://download.qt.io/development_releases/prebuilt/libclang/libclang-release_100-based-dyn-mac-universal.7z" + target = os.path.join(home, "libclang-dynlibs-10.0-universal") + try: + download_and_extract_7z(file, target) + except RuntimeError as e: + print("debug: Exception error: {}".format(e)) + file = file.replace("s://download","://master") + print("New url: {}".format(file)) + download_and_extract_7z(file, target) \ No newline at end of file diff --git a/coin/instructions/common_environment.yaml b/coin/instructions/common_environment.yaml index 41ab0059c..cf391324e 100644 --- a/coin/instructions/common_environment.yaml +++ b/coin/instructions/common_environment.yaml @@ -119,6 +119,32 @@ instructions: variableName: LLVM_INSTALL_DIR variableValue: "{{.Env.LLVM_DYNAMIC_LIBS_100}}" disable_if: + condition: and + conditions: + - condition: property + property: target.arch + equals_value: X86_64-ARM64 # When target arch is universal binary, we can use the default libclang + - condition: property + property: host.os + equals_value: MacOS + - type: EnvironmentVariable + variableName: LLVM_INSTALL_DIR + variableValue: "/Users/qt/libclang-dynlibs-10.0-universal/libclang-dynlibs-10.0" + enable_if: + condition: and + conditions: + - condition: property + property: target.arch + equals_value: X86_64-ARM64 # When target arch is universal binary, we can use the default libclang + - condition: property + property: host.os + equals_value: MacOS + - type: PrependToEnvironmentVariable + variableName: PATH + variableValue: "/Library/Frameworks/Python.framework/Versions/3.9/bin:" + enable_if: condition: property - property: host.osVersion - equals_value: openSUSE_15_1 + property: host.os + equals_value: MacOS + + diff --git a/coin/instructions/execute_build_instructions.yaml b/coin/instructions/execute_build_instructions.yaml index e940e9250..ffd1ad5cc 100644 --- a/coin/instructions/execute_build_instructions.yaml +++ b/coin/instructions/execute_build_instructions.yaml @@ -1,13 +1,34 @@ type: Group instructions: - type: ExecuteCommand - command: "python -u coin_build_instructions.py --os={{.Env.CI_OS}} {{.Env.CI_PACKAGING_FEATURE}} --instdir=/Users/qt/work/install --targetOs={{.Env.CI_OS}} --hostArch=X86_64 --targetArch={{.Env.CI_TARGET_ARCHITECTURE}} --phase=ALL" + command: "python -u coin_build_instructions.py --os={{.Env.CI_OS}} {{.Env.CI_PACKAGING_FEATURE}} --instdir=/Users/qt/work/install --targetOs={{.Env.CI_OS}} --hostArch={{.Env.HOS_ARCH_COIN}} --targetArch={{.Env.TARGET_ARCH_COIN}} --phase=ALL" maxTimeInSeconds: 14400 maxTimeBetweenOutput: 1200 enable_if: - condition: property - property: host.os - equals_value: MacOS + condition: and + conditions: + - condition: property + property: target.arch + equals_value: X86_64 + - condition: property + property: host.os + equals_value: MacOS + userMessageOnFailure: > + Failed to execute build instructions on osx + + - type: ExecuteCommand + command: "python3 -u coin_build_instructions.py --os={{.Env.CI_OS}} {{.Env.CI_PACKAGING_FEATURE}} {{.Env.CI_USE_SCCACHE}} --instdir=/Users/qt/work/install --targetOs={{.Env.CI_OS}} --hostArch=={{.Env.HOST_ARCH_COIN}} --targetArch=X86_64-ARM64 --phase=ALL" + maxTimeInSeconds: 14400 + maxTimeBetweenOutput: 1200 + enable_if: + condition: and + conditions: + - condition: property + property: target.arch + equals_value: X86_64-ARM64 + - condition: property + property: host.os + equals_value: MacOS userMessageOnFailure: > Failed to execute build instructions on osx - type: ExecuteCommand diff --git a/coin/instructions/execute_test_instructions.yaml b/coin/instructions/execute_test_instructions.yaml index f5dd7aa50..b30ec2b92 100644 --- a/coin/instructions/execute_test_instructions.yaml +++ b/coin/instructions/execute_test_instructions.yaml @@ -8,15 +8,35 @@ instructions: variableName: QTEST_ENVIRONMENT variableValue: "ci" - type: ExecuteCommand - command: "python -u coin_test_instructions.py --os={{.Env.CI_OS}} {{.Env.CI_PACKAGING_FEATURE}} --instdir=/Users/qt/work/install --targetOs={{.Env.CI_OS}} --hostArch=X86_64 --targetArch={{.Env.CI_TARGET_ARCHITECTURE}}" + command: "python -u coin_test_instructions.py --os={{.Env.CI_OS}} {{.Env.CI_PACKAGING_FEATURE}} --instdir=/Users/qt/work/install --targetOs={{.Env.CI_OS}} --hostArch=X86_64 --targetArch={{.Env.TARGET_ARCH_COIN}}" maxTimeInSeconds: 14400 maxTimeBetweenOutput: 1200 enable_if: - condition: property - property: host.os - equals_value: MacOS + condition: and + conditions: + - condition: property + property: target.arch + equals_value: X86_64 + - condition: property + property: host.os + equals_value: MacOS + userMessageOnFailure: > + Failed to execute test instructions on osx + - type: ExecuteCommand + command: "python -u coin_test_instructions.py --os={{.Env.CI_OS}} {{.Env.CI_PACKAGING_FEATURE}} --instdir=/Users/qt/work/install --targetOs={{.Env.CI_OS}} --hostArch=X86_64 --targetArch=X86_64-ARM64" + maxTimeInSeconds: 14400 + maxTimeBetweenOutput: 1200 + enable_if: + condition: and + conditions: + - condition: property + property: target.arch + equals_value: X86_64-ARM64 + - condition: property + property: host.os + equals_value: MacOS userMessageOnFailure: > - Failed to execute test instructions on osx + Failed to execute test instructions on osx - type: ExecuteCommand command: "python -u coin_test_instructions.py --os={{.Env.CI_OS}} {{.Env.CI_PACKAGING_FEATURE}} --instdir=/home/qt/work/install --targetOs={{.Env.CI_OS}} --hostArch=X86_64 --targetArch={{.Env.CI_TARGET_ARCHITECTURE}}" maxTimeInSeconds: 14400 diff --git a/coin/module_config.yaml b/coin/module_config.yaml index d736b2355..ce6b58a7d 100644 --- a/coin/module_config.yaml +++ b/coin/module_config.yaml @@ -18,10 +18,20 @@ accept_configuration: not_contains_value: -no-gui - condition: property # Following configs are not supported property: target.osVersion - not_in_values: [OPENSUSE_13_01, QEMU, WebAssembly, Ubuntu_18_04, SLES_12, SLES_15, MacOS_10_15, MacOS_11_00] + not_in_values: [openSUSE_15_1, OPENSUSE_13_01, QEMU, WebAssembly, Ubuntu_18_04, SLES_12, SLES_15, MacOS_10_15, MacOS_11_00, Windows_11_21H2] - condition: property # MibnGW and msvc2015 are not supported property: target.compiler not_in_values: [Mingw, MSVC2015] + + - condition: and + conditions: + - condition: property + property: target.osVersion + equals_value: Windows_11_21H2 + - condition: property + property: features + contains_value: Packaging + - condition: and conditions: - condition: property diff --git a/coin_build_instructions.py b/coin_build_instructions.py index 6a4d5dfd7..663633bf0 100644 --- a/coin_build_instructions.py +++ b/coin_build_instructions.py @@ -44,6 +44,7 @@ from build_scripts.utils import run_instruction from build_scripts.utils import rmtree from build_scripts.utils import get_python_dict from build_scripts.utils import get_ci_qmake_path +from build_scripts.utils import provisioning import os import datetime import calendar @@ -125,10 +126,18 @@ def call_setup(python_ver, phase): v_env = "virtualenv" run_instruction([v_env, "-p", _pExe, _env], "Failed to create virtualenv") # When the 'python_ver' variable is empty, we are using Python 2 - # Pip is always upgraded when CI template is provisioned, upgrading it in later phase may cause perm issue + try: + print("Upgrade pip") + run_instruction([env_python, "--m", "pip", "install", "--upgrade", "pip"]) + except Exception as e: + print("Failed to upgrade pip") + pass + run_instruction([env_pip, "install", "-r", "requirements.txt"], "Failed to install dependencies") if sys.platform == "win32": run_instruction([env_pip, "install", "numpy==1.19.3"], "Failed to install numpy 1.19.3") + elif os.environ.get("HOST_OSVERSION_COIN") == "macos_10_13" and python_ver == "3": + run_instruction([env_pip, "install", "numpy==1.19.4"], "Failed to install numpy") else: run_instruction([env_pip, "install", "numpy"], "Failed to install numpy") @@ -141,6 +150,12 @@ def call_setup(python_ver, phase): cmd += ["--build-tests", "--parallel=4", "--verbose-build"] + + if CI_TARGET_ARCH == "X86_64-ARM64": + cmd += ["--macos-arch='x86_64;arm64'"] + if CI_HOST_ARCH != "arm64": + cmd += ["--macos-deployment-target=10.14"] + if python_ver == "3": cmd += ["--limited-api=yes"] else: @@ -165,19 +180,28 @@ def call_setup(python_ver, phase): def run_build_instructions(phase): - # Uses default python, hopefully we have python2 installed on all hosts - # Skip building using Python 2 on Windows, because of different MSVC C runtimes (VS2008 vs VS2015+) - if CI_HOST_OS != "Windows": - call_setup("", phase) - # In case of packaging build, we have to build also python3 wheel - - if CI_RELEASE_CONF and CI_HOST_OS_VER not in ["RHEL_6_6"]: + if CI_TARGET_ARCH == "X86_64-ARM64": + # For universal wheels there will be only python3 wheel call_setup("3", phase) + else: + # Uses default python, hopefully we have python2 installed on all hosts + # Skip building using Python 2 on Windows, because of different MSVC C runtimes (VS2008 vs VS2015+) + if CI_HOST_OS != "Windows": + call_setup("2", phase) + # In case of packaging build, we have to build also python3 wheel + + if CI_RELEASE_CONF and CI_HOST_OS_VER not in ["RHEL_6_6"]: + call_setup("3", phase) + if __name__ == "__main__": # Remove some environment variables that impact cmake arch = '32' if CI_TARGET_ARCH and CI_TARGET_ARCH == 'X86' else '64' + # With 5.15.9 we are missing correct libclang so we need to install it for mac + # to create universal binaries. + if CI_HOST_OS == "MacOS" and CI_TARGET_ARCH == "X86_64-ARM64": + provisioning() expand_clang_variables(arch) for env_var in ['CC', 'CXX']: if os.environ.get(env_var): diff --git a/coin_test_instructions.py b/coin_test_instructions.py index 4ba5ac9ff..abb465223 100644 --- a/coin_test_instructions.py +++ b/coin_test_instructions.py @@ -43,6 +43,8 @@ from build_scripts.utils import get_qtci_virtualEnv from build_scripts.utils import run_instruction from build_scripts.utils import rmtree from build_scripts.utils import get_ci_qmake_path +from build_scripts.utils import provisioning + import os import site import sys @@ -85,6 +87,8 @@ def call_testrunner(python_ver, buildnro): run_instruction([env_pip, "install", "-r", "requirements.txt"], "Failed to install dependencies") if sys.platform == "win32": run_instruction([env_pip, "install", "numpy==1.19.3"], "Failed to install numpy 1.19.3") + elif os.environ.get("HOST_OSVERSION_COIN") == "macos_10_13" and python_ver == "3": + run_instruction([env_pip, "install", "numpy==1.19.4"], "Failed to install numpy") else: run_instruction([env_pip, "install", "numpy"], "Failed to install numpy") @@ -96,7 +100,7 @@ def call_testrunner(python_ver, buildnro): qmake_path = get_ci_qmake_path(CI_ENV_INSTALL_DIR, CI_HOST_OS) # Try to install built wheels, and build some buildable examples. - if CI_RELEASE_CONF: + if CI_RELEASE_CONF and CI_HOST_OS != "MacOS": wheel_tester_path = os.path.join("testing", "wheel_tester.py") cmd = [env_python, wheel_tester_path, qmake_path] run_instruction(cmd, "Error while running wheel_tester.py") @@ -104,6 +108,12 @@ def call_testrunner(python_ver, buildnro): def run_test_instructions(): # Remove some environment variables that impact cmake arch = '32' if CI_TARGET_ARCH and CI_TARGET_ARCH == 'X86' else '64' + + if CI_TARGET_ARCH == "X86_64-ARM64": + print("Install Libclang supporting universal binary") + provisioning() + else: + print("Using preinstalled libclang. While target arch was:" + str(CI_TARGET_ARCH)) expand_clang_variables(arch) for env_var in ['CC', 'CXX']: if os.environ.get(env_var): @@ -111,18 +121,18 @@ def run_test_instructions(): os.chdir(CI_ENV_AGENT_DIR) testRun = 0 - # We didn't build for Python 2 in win - if CI_HOST_OS != "Windows": + # In win machines, there are additional python versions to test with + if CI_HOST_OS == "Windows": + call_testrunner("3.6.1", str(testRun)) + call_testrunner("3.8.1", str(testRun)) + elif CI_HOST_OS == "MacOS" and CI_TARGET_ARCH=="X86_64-ARM64": + call_testrunner("3", str(testRun)) + else: call_testrunner("", str(testRun)) testRun =+ 1 - # We know that second build was with python3 - if CI_RELEASE_CONF: - # In win machines, there are additional python versions to test with - if CI_HOST_OS == "Windows": - call_testrunner("3.6.1", str(testRun)) - call_testrunner("3.8.1", str(testRun)) - else: - call_testrunner("3", str(testRun)) + call_testrunner("3", str(testRun)) if __name__ == "__main__": + print("HOST OS " + str(CI_HOST_OS)) + print("TARGET ARCH " + str(CI_TARGET_ARCH)) run_test_instructions() -- cgit v1.2.3 From 927c0d3e625455a8e5fedef3ed6662c8acba1858 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Simo=20F=C3=A4lt?= Date: Mon, 11 Apr 2022 17:44:00 +0300 Subject: Update version numbers for release Change-Id: I8a206834c20e44d126e6532323da58a82d894a52 Reviewed-by: Cristian Maureira-Fredes --- sources/pyside2/pyside_version.py | 2 +- sources/shiboken2/shiboken_version.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/sources/pyside2/pyside_version.py b/sources/pyside2/pyside_version.py index 390f4cdc5..f381be193 100644 --- a/sources/pyside2/pyside_version.py +++ b/sources/pyside2/pyside_version.py @@ -21,7 +21,7 @@ major_version = "5" minor_version = "15" -patch_version = "6" +patch_version = "9" # For example: "a", "b", "rc" # (which means "alpha", "beta", "release candidate"). diff --git a/sources/shiboken2/shiboken_version.py b/sources/shiboken2/shiboken_version.py index 390f4cdc5..f381be193 100644 --- a/sources/shiboken2/shiboken_version.py +++ b/sources/shiboken2/shiboken_version.py @@ -21,7 +21,7 @@ major_version = "5" minor_version = "15" -patch_version = "6" +patch_version = "9" # For example: "a", "b", "rc" # (which means "alpha", "beta", "release candidate"). -- cgit v1.2.3