aboutsummaryrefslogtreecommitdiffstats
path: root/build_scripts
Commit message (Collapse)AuthorAgeFilesLines
...
* build: remove directories in 'package_for_wheels/' on re-runCristián Maureira-Fredes2022-06-011-13/+30
| | | | | | | | | | | | | | The 'package_for_wheels' directory remains populated on a second build, so to make sure that there are no conflicts, we remove the directories inside in case it exists. This means that 'shiboken6', 'shiboken6_generator', and 'pyside6' directories inside 'package_for_wheels' will be removed when found. Pick-to: 6.3 Change-Id: Idccbf1d2ab67e046e7d6288c8daa4e0a264ad08c Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
* Limited_API: Fix PyIndex_Check once and for allChristian Tismer2022-05-271-4/+18
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | PyIndex_Check was left as a macro for Python <= 3.7 . This was fixed for Python 3.8 (I failed to submit the patch in time :( ) The problem is a bit weird, because we cannot do a compile time decision which Python version it is, because exactly that is only known at runtime. Therefore: - we cannot use a builtin version of PyIndex_Check, because this would create a link error with Python < 3.8 - PyType_GetSlot would help with this, but unfortunately this worked only with heap types, and the use case is on normal integers. The solution is quite ok: ------------------------- The structure of the type objects from Python 3.6 on is compatible enough for the field offset that we need here, so on old Python versions, the old type structure can be used. From Python 3.10 on, PyType_GetSlot is extended to non-heap types, and we can simply use that. This patch can be removed completely when we drop Python 3.7 . An automated warning that suggests this removal was added. [ChangeLog][shiboken6] The handling of a complex Limited API bug was fixed for different combinations of PySide/Python versions. Change-Id: I945aa5ae1ea5cd9de7c6e140c32a1e9467735a8e Fixes: PYSIDE-1797 Pick-to: 6.2 6.3 Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
* flake8: fix style issues to build_scripts, amended: fix main.pyChristian Tismer2022-05-271-12/+14
| | | | | | | | | | | | | | | This cosmetic change caused plain Python builds without virtual env to break, again. The change was sorting the imports of main.py in some arbitrary way that caused problems. It would be much more convenient if changes to the setup scripts were tested with and without venv or virtualenv. These repeated errors are an annoying waste of time. Change-Id: I84335be874cc96128fa192a288a8a7909af13e99 Pick-to: 6.3 Fixes: PYSIDE-1760 Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
* Use SPDX license identifiersLucie Gérard2022-05-2717-646/+34
| | | | | | | | | | | Replace the current license disclaimer in files by a SPDX-License-Identifier. Files that have to be modified by hand are modified. License files are organized under LICENSES directory. Task-number: QTBUG-67283 Change-Id: I065150015bdb84a3096b5b39c061cf0a20ab637d Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io> Reviewed-by: Cristian Maureira-Fredes <cristian.maureira-fredes@qt.io>
* Enable numpy support by defaultFriedemann Kleint2022-05-172-5/+27
| | | | | | | | | | | | | | | | | | | | | | This effectively undoes 36431b071095b8999347df87621bf23ffcc2ac3d which disabled numpy support in libpyside due to - break cx_freeeze - Cause embedding applications to fail to load with "undefined symbol: PyExc_RecursionError" Auto-detection along with --enable/--disable options is introduced instead. All numpy code is now located in libshiboken and it cleanly recovers when numpy cannot be found on the target system. The PyExc_RecursionError issue could not longer be reproduced. [ChangeLog][PySide6] Numpy support is now enabled by default. Task-number: PYSIDE-1924 Change-Id: I0fdb3612471971afa49ac3141845cf5d6dbfa7e0 Reviewed-by: Shyamnath Premnadh <Shyamnath.Premnadh@qt.io> Reviewed-by: Christian Tismer <tismer@stackless.com>
* build: copy instead of move the package directoryCristián Maureira-Fredes2022-04-221-2/+4
| | | | | | | | | | this had the effect that the 'setup.py install' command was failing to copy the built modules into the Python's site-packages. Pick-to: 6.3 6.3.0 Change-Id: Ifc5a94a43d68783a71efe29baa73f068a4c418a3 Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
* Fix typos in entry points definitionFriedemann Kleint2022-04-141-3/+3
| | | | | | | | Amends ce847a38201eaf99d90af71522c4b492f4c78e26. Pick-to: 6.3 Change-Id: Id3a401315c997172d5a3e45b3b553b5656618251 Reviewed-by: Cristian Maureira-Fredes <cristian.maureira-fredes@qt.io>
* flake8: fix style issues to build_scripts/Cristián Maureira-Fredes2022-04-1315-113/+115
| | | | | | Pick-to: 6.3 Change-Id: Ie56b054ca32869a488356b31eea49cc985fc463e Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
* PyPySide: Enable PySide build with PyPy 3.9Christian Tismer2022-04-121-1/+3
| | | | | | | | | | The PyPy implementation for Python 3.9 changed the version for libpypy3-c.dylib a bit into libpypy3.9-c.dylib . Change-Id: I7c004ccc91ec4e8647fe020b7e9286437ac93614 Pick-to: 6.3 Task-number: PYSIDE-353 Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
* PySide6: Optimize for SizeShyamnath Premnadh2022-04-112-0/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | build: use the following flag with setup.py to turn off size optimization --no-size-optimization Added the following compiler optimization flags and their corresponding flags on other platforms GCC - -ffunction-sections -fdata-section which segretates data and function section and linker flag --gc-section which removes unused code. - -fno-exceptions to disable exception handling - -Os - Optimize for size. Basically same as -O2 but removes some flags that cause increase in size. (Ran a couple of example and did not see difference in execution time) MSVC - /Gy /Gw /OPT:REF - same as -ffunction-sections, -fdata-section, -Wl, --gc-section - /EHsc same as -fno-exceptions - /O1 instead of /Os because for MSVC /O1 gave the best results. Clang - Same as GCC except for using -Oz instead of -Os. Experiments: Built a wheel with QtCore and noticed a 300kb reduction in size on both Windows and Linux. Built a complete wheel(except QTest) and it gives me a 4 mb size reduction with unaffected performance. Task-number: PYSIDE-1860 Change-Id: Ia5dfa2c4bfde92994c939b5fac0d0831fa3a73ab Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io> Reviewed-by: Christian Tismer <tismer@stackless.com>
* doc: skip the documentation build by defaultCristián Maureira-Fredes2022-04-092-7/+17
| | | | | | | | | | | | | This reverse the current approach of building the documentation by default, and replace the skip-docs parameter by a build-docs one. A warning is printed when the --skip-docs is used, and another warning is displayed when using --doc-build-online without the --build-docs option. Change-Id: I2bf8302881b51e9831795a7e881b106022cdffa8 Reviewed-by: Venugopal Shivashankar <Venugopal.Shivashankar@qt.io> Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
* Add readBytes and writeBytes functions from QDataStreamShyamnath Premnadh2022-04-081-0/+1
| | | | | | | | | | | - along with the addition of these functions, a common.xml is created to stores all the common templates Task-number: PYSIDE-890 Pick-to: 6.2 Change-Id: I4fadfe77a38635f15a7aef04adeac949c2d61b5d Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io> Reviewed-by: Cristian Maureira-Fredes <cristian.maureira-fredes@qt.io>
* doc: use https in some source code filesCristián Maureira-Fredes2022-03-311-1/+1
| | | | | | | Pick-to: 6.2 Change-Id: Ic48c1016638cb6fca544139ef589223b45c656c7 Reviewed-by: Christian Tismer <tismer@stackless.com> Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
* build: update wheel namesCristián Maureira-Fredes2022-03-302-28/+28
| | | | | | | | | | | | - Removing extra cpX arguments from the wheel name - Use PEP600 to include the glibc version on the wheel name, instead of manylinux1. - Use 'abi3' on windows instead of 'none', because it's already supported on Windows Change-Id: I312586b72d38f2c5c4835ba5040d064e44c80e29 Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: Christian Tismer <tismer@stackless.com>
* linguist: fix rpath on macosCristián Maureira-Fredes2022-03-301-0/+1
| | | | | | Pick-to: 6.2 Change-Id: If83404731096e17889523ded362be31e5398a441 Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
* build: script to create wheelsCristián Maureira-Fredes2022-03-292-0/+911
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This approach intends to avoid modifying the current structure we have in build_scripts, and can replace the call: python setup.py bdist_wheel mainly encouraged by PEP517, and the need of having incremental wheels, to replace the current single PySide6 one. The current configuration allows to create two new wheels: PySide6_Essentials, and PySide6_Addons that contain all the essential and addons Qt modules defined by the Qt Installer tool, with some modifications due to the dependencies of certain tools. Check the README files for more info. The known PySide6 wheel is also generated, but it's empty in favor of using the previous two wheels as requirements, installing them automatically, to avoid modifying the usage of 'pip install pyside6' The strategy is based on the current logic behing 'prepare_packages' that we have been using. Once the modules are built, instead of removing those directories currently in 'build/your_env/package', we rename them. Inside this new directory, one can have the 'shiboken6', 'shiboken6_generator', and 'PySide6' directories, with eveything already packed with the required wheel structure. The main difference is that instead of using the content of PySide6 to build one build, we select some files with the MANIFEST.in to create another wheel. The wheel tag drops the old assumption of needing: cp36.cp37.cp38.cp39.cp310-abi3 and only uses: cp36-abi3 Additionally, for Linux, we follow PEP600 to use the GLIBC version in the wheel name instead of manylinux1, manylinux2010, etc... For the current CI configuration, we know we are using 2.28, which is the minimum supported version for Qt6, so the wheel will look like: PySide6-6.3.0-cp36-abi3-manylinux_2_28_x86_64.whl The coin scripts were configured as well, to add the call of the new create_wheels.py script, and test them via wheel_tester.py Note: This script is not intended to be used as a general purpose wheel creation tool, and it's purely focused on the current Qt CI. There are many ad-hoc configurations used in different functions, like the structure of a Qt installation, the usage of 'a' on the environment for limited-api, etc. Task-number: PYSIDE-1115 Fixes: PYSIDE-692 Change-Id: Ic12e428b8b9b64bbe2facb1c520595ccd2384497 Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
* Use different mirror if download.qt.io failsSimo Fält2022-03-281-1/+1
| | | | | | Pick-to: 6.2 Change-Id: I36303943a6559ad7ff20e54478ec93a2d997651a Reviewed-by: Cristian Maureira-Fredes <cristian.maureira-fredes@qt.io>
* flake8: improve codestyling of build scriptsCristián Maureira-Fredes2022-03-2210-88/+40
| | | | | | | | | | | - Fixing f-strings - Fixing indentation of some lines - Removing unused variables and imports - Changing the way of verifying if sphinx is installed Change-Id: I3f361759682324c9b0c9d33c24583435f137f05a Pick-to: 6.2 Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
* Use python 3.8 when running CI integrations in Linux - take 2Simo Fält2022-03-221-1/+5
| | | | | | Pick-to: 6.2 Change-Id: Ia78ca23984a08ff93dbf9c64ee96706478f8c93d Reviewed-by: Cristian Maureira-Fredes <cristian.maureira-fredes@qt.io>
* Long live pyside6-project!Friedemann Kleint2022-03-143-2/+3
| | | | | | | | | | | | Add a tool to build Qt Designer forms, resource files and QML type files in a .pyproject. [ChangeLog][PySide6] pyside6-project, a tool for building projects and running QML checks, has been added. Task-number: PYSIDE-1709 Change-Id: I101ef04cb07c00a1ac75d18d81a2856305253109 Reviewed-by: Cristian Maureira-Fredes <cristian.maureira-fredes@qt.io>
* Strip libraries in release modeFriedemann Kleint2022-03-142-3/+9
| | | | | | | | | [ChangeLog][PySide6] Libraries are now stripped. Task-number: PYSIDE-661 Change-Id: I20ea056b8e91cca917017afa62811208c297d51d Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io> Reviewed-by: Shyamnath Premnadh <Shyamnath.Premnadh@qt.io>
* Fix exclusion of QML plugin debug symbols on LinuxFriedemann Kleint2022-03-031-1/+1
| | | | | | | | | | | | | | Adapts 623a7e19c09233858435ecbb09b3ccc44356a9d7 to Qt 6; the files are now named .debug. [ChangeLog][PySide6] QML plugin debug symbols are no longer shipped to reduce the wheel size. Pick-to: 6.2 Task-number: PYSIDE-661 Change-Id: I1dbb0bfc9cca6c8e42ce4cc329af1cf70f234741 Reviewed-by: Shyamnath Premnadh <Shyamnath.Premnadh@qt.io> Reviewed-by: Cristian Maureira-Fredes <cristian.maureira-fredes@qt.io>
* PySide6: Do not install Qt Designer plugin when using PyPyFriedemann Kleint2022-02-253-15/+21
| | | | | | Task-number: PYSIDE-535 Change-Id: I681a79b684e15802294fd5094afe35de0ce92c8a Reviewed-by: Christian Tismer <tismer@stackless.com>
* Build system: Add build_info_collector to project fileFriedemann Kleint2022-02-121-1/+2
| | | | | | | | | | Complements 57866a57586d401c784f809f9f7994b0e4623706. Task-number: PYSIDE-802 Task-number: PYSIDE-1033 Task-number: PYSIDE-1814 Change-Id: Ia4a279da92ef61d88eddc89c8db33e8228544699 Reviewed-by: Christian Tismer <tismer@stackless.com>
* Bundle the metatype json files of QtFriedemann Kleint2022-02-042-0/+12
| | | | | | | | They are required for qmllint. Task-number: PYSIDE-1709 Change-Id: Iedf115c810b305a05cf2b1e3bfd2ed84c2b17af8 Reviewed-by: Cristian Maureira-Fredes <cristian.maureira-fredes@qt.io>
* setup.py: Add support for cross-buildingAlexandru Croitor2022-02-049-196/+868
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | setup.py can now be used to cross-compile PySide to a target Linux distribution from a Linux host. For example you could cross-compile PySide targeting an arm64 Raspberry Pi4 sysroot on an Ubuntu x86_64 host machine. Cross-compiling PySide has a few requirements: - a sysroot to cross-compile against, with a pre-installed Qt, Python interpreter, library and development packages (which provides C++ headers) - a host Qt installation of the same version that is in the target sysroot - a host Python installation, preferably of the same version as the target one (to run setup.py) - a working cross-compiling toolchain (cross-compiler, linker, etc) - a custom written CMake toolchain file - CMake version 3.17+ - Qt version 6.3+ The CMake toolchain file is required to set up all the relevant cross-compilation information: where the sysroot is, where the toolchain is, the compiler name, compiler flags, etc. Once are requirements are met, to cross-compile one has to specify a few additional options when calling setup.py: the path to the cmake toolchain file, the path to the host Qt installation and the target python platform name. An example setup.py invocation to build a wheel for an armv7 machine might look like the following: python setup.py bdist_wheel --parallel=8 --ignore-git --reuse-build --cmake-toolchain-file=$PWD/rpi/toolchain_armv7.cmake --qt-host-path=/opt/Qt/6.3.0/gcc_64 --plat-name=linux_armv7l --limited-api=yes --standalone Sample platform names that can be used are: linux_armv7, linux_aarch64. If the auto-detection code fails to find the target Python or Qt installation, one can specify their location by providing the --python-target-path=<path> and --qt-target-path=<path> options to setup.py. If the automatic build of the host shiboken code generator fails, one can specify the path to a custom built host shiboken via the --shiboken-host-path option. Documentation about the build process and a sample CMake toolchain file will be added in a separate change. Implementation details. Internally, setup.py will build a host shiboken executable using the provided host Qt path, and then use it for the cross-build. This is achieved via an extra setup.py sub-invocation with some heuristics on which options should be passed to the sub-invocation. The host shiboken is not included in the target wheels. Introspection of where the host / target Qt and Python are located is done via CMake compile tests, because we can't query information from a qmake that is built for a different architecture / platform. When limited API is enabled, we modify the wheel name to contain the manylinux2014 tag, despite the wheel not fully qualifying for that tag. When copying the Qt libraries / plugins from the target sysroot in a standalone build, we need to adjust all their rpaths to match the destination directory layout of the wheel. Fixes: PYSIDE-802 Task-number: PYSIDE-1033 Change-Id: I6e8c51ef5127d85949de650396d615ca95194db0 Reviewed-by: Cristian Maureira-Fredes <cristian.maureira-fredes@qt.io> Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
* Allow empty PRE_RELEASE_VERSION for release wheelsSimo Fält2022-01-281-4/+5
| | | | | | | Change-Id: If53fb034ee0c62b25e9a672ff687a0e1f4c592f4 Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io> (cherry picked from commit 1966aae5401de5129f571fdb5bb1d9b1e69ab143) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* Long live pyside6-metaobjectdump!Friedemann Kleint2022-01-273-9/+9
| | | | | | | | | Add a tool to print out the metatype information in JSON to be used as input for qmltyperegistrar. Task-number: PYSIDE-1709 Change-Id: Ie57feeeecc09b1a01aadcc08f7e529a16609b3a4 Reviewed-by: Christian Tismer <tismer@stackless.com>
* Add qmltyperegistrar/qmllintFriedemann Kleint2022-01-183-3/+7
| | | | | | | | | | | Add entry points for the tools from libexec or bin, respectively. [ChangeLog][PySide6] The tools pyside6-qmltyperegistrar and pyside6-qmllint have been added. Task-number: PYSIDE-1709 Change-Id: If578255cc2a0fda4171b1ed54f3a2e612e849964 Reviewed-by: Christian Tismer <tismer@stackless.com>
* build_scripts: Ensure cmake process terminatesFriedemann Kleint2022-01-051-6/+5
| | | | | | | | | | | Use a context manager to fix warning: c:\Python310\lib\subprocess.py:1067: ResourceWarning: subprocess 7844 is still running _warn("subprocess %s is still running" % self.pid, ResourceWarning: Enable tracemalloc to get the object allocation traceback Pick-to: 6.2 Change-Id: I6e3ebf584974f8a2d3776847b13fe092d3d4be4a Reviewed-by: Christian Tismer <tismer@stackless.com>
* build_scripts: Avoid a racing condition in installChristian Tismer2022-01-051-0/+5
| | | | | | | | | | | | | | | | | | On macOS and a custom Python built, the "install" option crashes with an import error. This is a timing problem, because an import is triggered when it is already being processed. The problem is hidden by the use of virtualenv. [ChangeLog][PySide6] The move from distutils to setuptools caused a racing condition with certain Python builds. Change-Id: I4dcda2b083234e88c272a1794388f6d0e7b8f0e5 Pick-to: 6.2 Fixes: PYSIDE-1760 Reviewed-by: Cristian Maureira-Fredes <cristian.maureira-fredes@qt.io>
* setup.py: Prevent creation of byte-compiled filesChristian Tismer2021-12-201-0/+4
| | | | | | | | | | | | | | | | | | | | | | | | Byte-compiled files (.pyc or .pyo) are generated by default when a module gets imported. The "setup install" command has additionally the effect of pre-compiling all Python files for the installation. This is much less relevant than when this behavior was implemented (was in Python 1.4, already in 1996). We don't want this behavior that clutters example directories and does not make much sense when the Limited API is used. The compiled files will still be created on import. But be aware of possible side effects because files may be written on a read-only installation. [ChangeLog][PySide6] The byte-compiling of example files is now suppressed to save space and clutter. Task-number: PYSIDE-1746 Change-Id: I811431030517c251f32bcadc4c98fb646b68eafa Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
* Build system: Remove regeneration of the example resourcesFriedemann Kleint2021-12-153-31/+1
| | | | | | | | | | | | | With the growing nummber of examples, this started to slow down the build process and produced warnings about the linguist example. It has been replaced by the tools/regenerate_example_resources.py script. Pick-to: 6.2 Change-Id: Ia00ad35d8b3c0ecea62a497e1665b5b7ceb25e7b Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: Cristian Maureira-Fredes <cristian.maureira-fredes@qt.io>
* Windows: Fix the build against complete LLVM packagesFriedemann Kleint2021-12-093-5/+15
| | | | | | | | | | When compiling a dummy project for determining config values, CMake is fooled to use clang++ as a compiler if it finds it. Force it to use MSVC as is done for the build. Pick-to: 6.2 Change-Id: Ic1031a9aa078c0d05adf6495b4db665a0813e3f9 Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
* setup.py: CMake: Remove host python dependency for version parsingAlexandru Croitor2021-12-072-7/+29
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | When cross-compiling, the python interpreter found by CMake is the device one (or at least it's supposed to be), which means we can't use it to execute python scripts on the host machine to extract shiboken and pyside version information. Instead of keeping the version numbers in python files, place them into new .cmake.conf files that CMake can include in CMake projects directly. This aligns with storing version information like Qt6 does. setup.py and coin_build_instructions need version info as well, so they will now parse the set() assignments in pyside6/.cmake.conf. Ideally we would have called cmake with a minimal project that outputs those values, but we don't have access to the CMake executable path within coin_build_instructions.py, so we rely on parsing instead. Qt Conan integration does the same, so we should be good, the .cmake.conf file format is unlikely to change and cause breakages. We also modify shiboken_version.py and pyside_version.py to use the new variables when calling configure_file(), because we still ship those files in the wheels. Amends b57c557c8cd1012851f8a245075591dc33be425b Pick-to: 6.2 Change-Id: Icc830069cd459c214ec253840ba6754ece50854e Reviewed-by: Cristian Maureira-Fredes <cristian.maureira-fredes@qt.io>
* Reland: Move all build dirs into a common 'build' subdirectoryAlexandru Croitor2021-12-072-27/+53
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | When building the project using setup.py, it would pollute the source directory with a lot of virtual environment build directories. Move all of those into a common 'build' subdirectory. This eases cleanup of all build directories because they can all be removed with a single rm command. It also places all the various stages of build -> install -> package folders into a common subdirectory so it's easier to find and navigate between them. If no virtualenv is detected, change the venv prefix from the previous value of 'pyside' to 'qfp' and include the build classifiers. If a virtualenv is detected, we consider it is distinct enough and don't include the build classifiers, apart from a few chars to denote a debug python, debug Qt or limited api build. Example of the new build directory structure when a virtualenv is detected build/{venv_name}/build/shiboken6 build/{venv_name}/build/pyside6 build/{venv_name}/install/bin/shiboken6 build/{venv_name}/package Example of the new build directory structure when a virtualenv is NOT detected build/qfp-py3.9-qt6.2.0-64bit-release/build/shiboken6 build/qfp-py3.9-qt6.2.0-64bit-release/build/pyside6 build/qfp-py3.9-qt6.2.0-64bit-release/install/bin/shiboken6 build/qfp-py3.9-qt6.2.0-64bit-release/package Move the code that always removed the ./build directory on each setup.py invocation into prepare_packages() instead. This way it only removes the files from the 'package' subfolder which is the common packaging location between all the sub-projects. This removal is needed to ensure shiboken files don't end up packaged in the PySide6 wheel. This relands commit 234349d124ccfa399921e2b9fc09addcff0b0a94 This reverts commit 0c6eb7cd232fff9d81a8d5bc9a7fd71d9b8c67f5 [ChangeLog][setup.py] Build directories are now created inside the root ./build directory, rather than directly under the root of the project. Pick-to: 6.2 Change-Id: I6d511ae77cb66c2c5a872d6b85ff33e1831b803e Reviewed-by: Cristian Maureira-Fredes <cristian.maureira-fredes@qt.io>
* setup.py: Make each setuptools command compute the same build dir infoAlexandru Croitor2021-12-072-170/+261
| | | | | | | | | | | | | | | | | | | ... as well as install dir, setuptools package dir and other common build path information we compute. This paves the way to reland 234349d124ccfa399921e2b9fc09addcff0b0a94 which was reverted in 0c6eb7cd232fff9d81a8d5bc9a7fd71d9b8c67f5 To do that, move the various build info computation into a separate mixin class that computes and assigns the values in PysideBuild.finalize_options() rather than run(). This ensures that PysideInstall and PysideBuildWheel inherit the same build dir / install dirs by querying the info from the build command. Pick-to: 6.2 Change-Id: I802f122ddf3eb1e9daff25fac4d697f2ceae8e0c Reviewed-by: Cristian Maureira-Fredes <cristian.maureira-fredes@qt.io>
* setup.py: Deprecate qmake option in favor of qtpathsAlexandru Croitor2021-12-072-0/+11
| | | | | | | | | | | | | | | | | | The setup.py --qmake option is deprecated starting with Qt 6.3 and will likely be removed in Qt 6.4. The --qtpaths option should be used instead. Change Coin build instructions to use qtpaths. Documentation builds should also be adapted. Coin test instructions still use qmake for wheel_tester.py [ChangeLog][setup.py] The setup.py --qmake option is deprecated starting with Qt 6.3. Use the --qtpaths option instead. Change-Id: I0f5661162f70b38ce0c9939620e7dbb3151050fd Reviewed-by: Cristian Maureira-Fredes <cristian.maureira-fredes@qt.io> Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
* setup.py: Simplify logic of qmake and qtpaths lookupAlexandru Croitor2021-11-293-32/+26
| | | | | | | | | | | | | | | | | | If an explicit qmake or qtpaths option is given, use it to determine the Qt prefix dir. If no option is specified, try to find qtpaths in PATH. Don't try to find the sibling tool as we did before this change, there's no benefit in doing that. Either one can be used to query the required Qt information. Make sure to log both tool paths. Amends 3b4764fefbb349eafb831b5da90f565b34c77a52 Pick-to: 6.2 Change-Id: I03afaa8d8476b3d09affdde28f3ff6f1fdf652b6 Reviewed-by: Cristian Maureira-Fredes <cristian.maureira-fredes@qt.io>
* setup.py: Fix no log messages being shown during setup callAlexandru Croitor2021-11-261-4/+12
| | | | | | | | | | | | | | | The default verbosity of a log object is WARN. distutils then set it to INFO when initializing the Distribution object. This would not affect the log object copy that setuptools exposes (and we now use). This caused the usual INFO messages not to be shown anymore. Explicitly set the setuptools log object verbosity to INFO unless the quiet option was given. Amends 95a5bb9dd3b5d3fa86f2ed0868e2b821256a6028 Pick-to: 6.2 Change-Id: I793dc92582007895fa23d43baabe5b97c146552e Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
* setup.py: Don't add the Qt prefix dir to PATH env var before buildingAlexandru Croitor2021-11-261-5/+7
| | | | | | | | | | | | | | | | | | | | | Modifying PATH influences which packages are found by CMake's find_package, as well as which binaries are available to execute during the CMake build phase. Instead of relying on PATH, we should rely on passing the detected Qt prefix dir to CMAKE_PREFIX_PATH. This makes the build process more robust against differences in environment variables, as well as ensuring reproducibility when incrementally rebuilding a project manually without going through setup.py. Pick-to: 6.2 Task-number: PYSIDE-1033 Change-Id: I9c36d9924b82cb1133c44f4ef44ca785bbf7e862 Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io> Reviewed-by: Christian Tismer <tismer@stackless.com>
* setup.py: Add missing DistutilsSetupError importAlexandru Croitor2021-11-261-1/+1
| | | | | | | | | | DistutilsSetupError should be imported instead of DistutilsError. Amends 95a5bb9dd3b5d3fa86f2ed0868e2b821256a6028 Pick-to: 6.2 Change-Id: I9db9dd5114ef4413b57da2f60e3441071c122635 Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
* Move from distutils to setuptoolsCristián Maureira-Fredes2021-11-267-78/+92
| | | | | | | | | | This is motivated by the deprecation of distutils, and removal in future versions https://github.com/pypa/packaging-problems/issues/127 Pick-to: 6.2 Change-Id: I16448b69f98df6dc1d9a904b69eb69ed5f1093f5 Reviewed-by: Christian Tismer <tismer@stackless.com>
* setup.py: Package QtWebEngine resources from Qt's data dirAlexandru Croitor2021-11-225-3/+8
| | | | | | | | | | | | The QtWebEngine resources are not necessarily in $qt_prefix/resources. On Linux, distro's might specify a different value for QT_INSTALL_DATA. Make sure to use that value. Pick-to: 6.2 Change-Id: I5bed723de07d39d0bc72e7932161809150433037 Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
* setup.py: Remove dead function prepare_sub_modulesAlexandru Croitor2021-11-191-37/+0
| | | | | | | | | | | | | It was originally removed in the dev branch via 9c9b506f3b2cc64da6fbbef9f58ccec7ccfe4457 but was accidentally brought back with a 5.15 -> dev merge in 68ec9c643abf30cf22b9932ec82098cdebc08b98 Remove it again. Pick-to: 6.2 Change-Id: I86d3be455e45feeb5fd08cba49ca0324a6a1a26d Reviewed-by: Christian Tismer <tismer@stackless.com>
* Use legacy OpenGL option to build on linuxCristián Maureira-Fredes2021-11-181-0/+6
| | | | | | | | | Pick-to: 6.2 Fixes: PYSIDE-1547 Change-Id: I7ff4fe084c4121d5635479d5fd2ed9b6a9fa0df7 Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io> Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io> Reviewed-by: Christian Tismer <tismer@stackless.com>
* setup: coin: Use sccache when building if the platform config sets itAlexandru Croitor2021-11-152-0/+8
| | | | | | | | | | | | Set the CI_USE_SCCACHE env var if the sccache feature is enabled for the platform config. Pipe that through coin_build_instructions.py to setup.py. Add the relevant CMake cache vars so sccache is used. Pick-to: 6.2 Change-Id: I02d7ff0646791a5f0d2f1dd5c4a119ee016a9896 Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: Christian Tismer <tismer@stackless.com>
* setup: Make ninja output the commands it runs in a verbose buildAlexandru Croitor2021-11-151-1/+6
| | | | | | | | | | | | | | Verbose build output worked when using the Makefiles generator because we set CMAKE_VERBOSE_MAKEFILE to ON, but that does not affect ninja. For ninja we need to explicitly pass -v on the command line. The verbose ninja output is useful when debugging build issues in the CI (which uses verbose build). Pick-to: 6.2 Change-Id: Ib1532db0225744184d89bf796c4b3a6a40d718ca Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
* Revert "setup.py: Move all build dirs into a common 'build' subdirectory"Alexandru Croitor2021-10-281-55/+21
| | | | | | | | | | | | | | | | | | | | | | This reverts commit 234349d124ccfa399921e2b9fc09addcff0b0a94. It fixes the following warning warning: PysideInstallLib: 'build/lib.macosx-10.14-x86_64-3.7' does not exist -- no Python modules to install The build_lib directory is only assigned during the run() method of the build command, which means the install command didn't pick up anything to install, because it expects the build_lib to be set during finalize_options of the build command, and it wasn't, it had the default value instead. Installation accidentally worked for the bdist_wheel command because the build command is run to completion before the install command is prepared. Pick-to: 6.2 Change-Id: I512a958db30858344f0d873a23bff0b925d7618e Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
* PyPySide: add it as a true new build targetChristian Tismer2021-10-281-0/+12
| | | | | | | | | | | | | | | | | | PyPy has now an appendix of its name and version at the end of the build path name. There are special settings needed in command.py to locate it in the folder structure. An extra check for PyPy has been added to the test script, because PyPy still has many errors. We use only one test run and extended timeouts until some crucial errors are gone. The blacklist file now understands pypy, pypy.7.3.6 etc. Task-number: PYSIDE-535 Change-Id: Ic2ab88bf35c5a18320733eb2552eca9e4315d04f Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>