Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                
aboutsummaryrefslogtreecommitdiffstats
Commit message (Collapse)AuthorAgeFilesLines
* CI: Use COIN_UNIQUE_JOB_ID variable to detect if build is in COINSimo Fält2025-02-031-1/+1
| | | | | | | | | The old variable is not exported anymore by CI. Pick-to: 5.15 6.2 6.5 6.8 6.8.2 Fixes: PYSIDE-3000 Change-Id: Ide0248348c08bf94dfb5b7fbc2964274e45f7cb7 Reviewed-by: Cristian Maureira-Fredes <cristian.maureira-fredes@qt.io>
* build: improve the build configuration implementationCristián Maureira-Fredes2024-12-181-0/+11
| | | | | | | | | | | | - Using Singleton for the class - Adding type hints for the Path variables - Use function for parsing modules instead of duplicating it - Adapting related code in other files as well - Remove historical prints when configuring. Pick-to: 6.8 Change-Id: I9fef2e8d7c2033442f89a6f6ca027b5ae2ac6ab4 Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
* build: options as a singletonCristián Maureira-Fredes2024-12-181-3/+11
| | | | | | | | | | | Avoid finding the dynamic options each time the OPTION dictionary was imported in the different build_scripts files. Now each setup.py invocation will have the same object. Pick-to: 6.8 Change-Id: Ic556d572e77e54fe27603332b7d2f99697eab86c Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
* build: fix the URLError import statementCristián Maureira-Fredes2024-12-031-3/+4
| | | | | | | | | Currently it was not working due to the strange import strategy overriding 'urllib' Pick-to: 6.8 Change-Id: I7b773ba53c800dd408afdb9e77a71ea77887df4e Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
* coin: ci code improvements for build and testCristián Maureira-Fredes2024-11-081-62/+0
| | | | | | | | | | | | | | | | | | | The current patch modifies the structure for the code in charge of building and testing pyside in the CI. Instructions within 'coin_test_instructions.py' and 'coin_build_instructions.py' were duplicated, and other slightly modified, so the code was standarized and placed in 'coin/instructions_utils.py', so the first two files could be heavily simplified. A couple of helper functions were removed from build_scripts/utils.py in order to reduce the code in the general build utilities for the project. Pick-to: 6.8 Change-Id: I0cd4bc51edb2e28c5e81a0be8a27be6cb4027bfd Reviewed-by: Simo Fält <simo.falt@qt.io>
* build/Windows: Clean up the codeFriedemann Kleint2024-10-181-0/+4
| | | | | | | | | | | | | | | | - Remove the binaries from the list of filters retrieved from the .7z file. - Rename copy_qt_dependency_dlls() to download_qt_dependency_dlls() for clarity. - Split the artifact list into one containing the Multimedia libraries and a helper function qt_rhi_artifacts_permanent() for RHI/rendering related libraries. - Add a helper function returning whether it is running in COIN Complements 36f62dd5d45b8b84bd80064ceb43bab74a89321e. Pick-to: 6.8 Change-Id: I47518c2f1f9abe601c57c85bd1ec30e5ec5d13c2 Reviewed-by: Shyamnath Premnadh <Shyamnath.Premnadh@qt.io>
* build: Deal with read-only Qt installationsFriedemann Kleint2024-10-091-0/+6
| | | | | | | | | | | | Make binaries writeable before patching. No care is taken to preserve the mode as installing the wheels creates rwxrwxrwx files when unpacking regardless of the mode set when bundling. Fixes: PYSIDE-2885 Pick-to: 6.8 6.5 Change-Id: I5cbb02667c3a195ac369bb83ea42e3ba0ea85367 Reviewed-by: Shyamnath Premnadh <Shyamnath.Premnadh@qt.io>
* Build: Fix some pathlib changes from the pastShyamnath Premnadh2024-07-191-1/+2
| | | | | | | | | | - Amends db3d1b03a4c3f9a1a934ceed5650461c2842eeb3. The comparison compare a pathlib.Path object to a str object and fails always. - As a drive by, add a log when copying contents to 'package_for_wheels' Pick-to: 6.7 Change-Id: I6782b853ee9dc0cbafdcc288fcb1266814ac4665 Reviewed-by: Adrian Herrmann <adrian.herrmann@qt.io>
* Adapt to numpy 2.0Friedemann Kleint2024-06-271-1/+6
| | | | | | | | | The include paths have changed in 2.0 Task-number: PYSIDE-2789 Pick-to: 6.7 6.5 6.2 5.15 Change-Id: I052eaba0f8ed6a5d39817fefad5befc42a8ac871 Reviewed-by: Shyamnath Premnadh <Shyamnath.Premnadh@qt.io>
* Python-3.10: Allow the new syntax for Python 3.9Christian Tismer2024-06-201-0/+1
| | | | | | | | Add a future statement to all Python source files. Task-number: PYSIDE-2786 Change-Id: Icd6688c7795a9e16fdcaa829686d57792df27690 Reviewed-by: Adrian Herrmann <adrian.herrmann@qt.io>
* build scripts: Use log.warning() instead of deprecated log.warn()Friedemann Kleint2024-03-071-2/+2
| | | | | Change-Id: I5c3b0bdedd35bf98c110c2885c8ba35a4f418c61 Reviewed-by: Adrian Herrmann <adrian.herrmann@qt.io>
* build scripts: Fix some flake8 issuesFriedemann Kleint2024-01-181-7/+6
| | | | | Change-Id: I26c77eb6448ec539a33acea6d2f39678c2b089a3 Reviewed-by: Shyamnath Premnadh <Shyamnath.Premnadh@qt.io>
* build: remove traces of distutilsCristián Maureira-Fredes2023-07-141-8/+1
| | | | | | | | | | | | | | | Removed mentions, comments, and fallback usages in some sections of the build scripts and documentation. On the CI, we upgrade setuptools in order to avoid having missing functionality, so it shouldn't be an issue. For Shiboken and CMake, there is still a helper that relies on distutils in case people is using python < 3.8.2 Pick-to: 6.5 Change-Id: Ic33abe9fa8bd8564e9d44c8714b7fedd4e50434a Reviewed-by: Simo Fält <simo.falt@qt.io>
* Tooling: Simplify adding new toolsShyamnath Premnadh2023-04-181-2/+5
| | | | | | | | | | | | - Amends a48de6afbf127831aa46c1c006d777861bbbe9cb - Simplify the developer doc for adding new tools - Make build_scripts/__init__.py the primary place to add new tools for the build process Pick-to: 6.5 Change-Id: I1e8bd9e069471bf51a186c067773d7fbc2588769 Reviewed-by: Christian Tismer <tismer@stackless.com> Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
* build: remove unused imports and obsolete commentCristián Maureira-Fredes2023-04-051-1/+0
| | | | | | Change-Id: I52ce8b449e5a0c4f1d94872becaa391c1c9ae605 Pick-to: 6.5 Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
* PySideTools: Fix non-existing macOS toolsShyamnath Premnadh2023-04-031-5/+11
| | | | | | | | | - designer, assistant and linguist were not existing due to a regression from 43109854a2966afe2e0cf29961157a6f54d5775c Pick-to: 6.5 Change-Id: I7f92ab2eca2fd98eb049e8e81a9efa56ebec3459 Reviewed-by: Cristian Maureira-Fredes <cristian.maureira-fredes@qt.io>
* CI: Change the way we create wheels in CISimo Fält2023-02-221-1/+1
| | | | | | | | | | Instead of calling setup.py to re-use binaries and creating wheels we can call create_wheels.py directly from CI instructions. This enables us to sign Windows binaries in correct phase and directory. Pick-to: 6.4 Change-Id: I7c69abe6e0b6591fb1df1e2f2805a015a49ce944 Reviewed-by: Cristian Maureira-Fredes <cristian.maureira-fredes@qt.io>
* PySide Build: find qtpaths before SetupRunner.run_setup()Shyamnath Premnadh2023-02-081-14/+0
| | | | | | | | | | | | | | | | | | | | - 'qtpaths' needs to be known while setting up the corresponding setup.py command to ignore the pyside qt wrapper tools whose qt tool does not exist - This is an extension to 43109854a2966afe2e0cf29961157a6f54d5775c. The aforementioned patch led to qtpaths being found 2 times, once inside CommandMixin class and also much before that inside SetupRunner.run_setup(). This redundancy is now removed by moving the finding of OPTION['QTPATHS'] outside the mixin and before CommandMixin object of the command being run is initialized - the help commands, build_rst_docs and cross compilation command should not complain about qtpaths anymore - fixed cross compilation build Task-number: PYSIDE-2195 Change-Id: I862baf954dea0a3bdaf5ddf411f119178b457c42 Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io> Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
* build: introduce log levelCristián Maureira-Fredes2023-02-021-4/+4
| | | | | | | | | | | | | | | | | | | | | | | | Removed the "quiet" and "verbose" older approach, and introduced a 3-level configuration so we can switch between them depending of the amount of output we need. By default, the log level is set to INFO, but it can be changed to VERBOSE and QUIET. The older "--verbose-build" and "--quiet" options were deprecated. The new way for setting the log level is: --log-level=quiet --log-level=verbose --log-level=info (default) The default option was made less verbose, controlling the output of the logging module, and cmake: for verbose it uses DEBUG, quiet uses ERROR, and no option uses INFO. Change-Id: Ida0289e3ea0ed09b7489a7513254137bba186fd0 Reviewed-by: Christian Tismer <tismer@stackless.com>
* Fix cross compilationShyamnath Premnadh2023-02-011-0/+1
| | | | | | | | | | - some regression from 2afcf8e7545c681e412e5b6d04ab8867e5edd5c7 pathlib changes Pick-to: 6.4 Change-Id: I32173bdffc1280e23b11006466f3dfb19a49fd8f Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io> Reviewed-by: Cristian Maureira-Fredes <cristian.maureira-fredes@qt.io>
* build_scripts: remove unused functionsCristián Maureira-Fredes2022-12-191-86/+0
| | | | | | | | | | | | These functions are not used in the build_scripts nor the coin, provisioning, test, or anywhere else in the repository. Pick-to: 6.4 Change-Id: I07fd343b1954f76e2c37b0aa8cc3c43662159d27 Reviewed-by: Shyamnath Premnadh <Shyamnath.Premnadh@qt.io> Reviewed-by: Adrian Herrmann <adrian.herrmann@qt.io> Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
* build_scripts: remove unused importsCristián Maureira-Fredes2022-12-191-2/+1
| | | | | | | | | | Many leftovers from the pathlib migration patches. Pick-to: 6.4 Change-Id: I7126fadbe45dbb387bc8948ba777cb690f10a758 Reviewed-by: Shyamnath Premnadh <Shyamnath.Premnadh@qt.io> Reviewed-by: Adrian Herrmann <adrian.herrmann@qt.io> Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
* build_system: Remove code trying to find the MSVC installationFriedemann Kleint2022-12-081-151/+0
| | | | | | | | | | | | | | | | | | The code was not triggered since the build system tries to compile a small test project with Ninja before even reaching it. It was also using code for MSVC 9 (2008) which does not work anymore and causes deprecation warnings: setuptools\_distutils\msvc9compiler.py:34: DeprecationWarning: msvc9compiler is deprecated and slated to be removed in the future. Please discontinue use or file an issue with pypa/distutils describing your use case. Change-Id: I95a6b7700c13873884deb6186e78d6c520c592de Reviewed-by: Cristian Maureira-Fredes <cristian.maureira-fredes@qt.io> Reviewed-by: Adrian Herrmann <adrian.herrmann@qt.io> Reviewed-by: Shyamnath Premnadh <Shyamnath.Premnadh@qt.io>
* build system: Further introduce PathlibFriedemann Kleint2022-12-061-9/+14
| | | | | | | | | | | | | Make it possible to pass a Path or a str to copyfile()/copydir() for both arguments or one of them. Turn the variables destination_dir, destination_qt_dir and destination_qt_lib_dir introduced by b32a791ea2c66ae9ef2896ea445d4752e4773f96 into Paths. Task-number: PYSIDE-2080 Change-Id: I13b27179746019b9cbe575d783a67a025dac1ee5 Reviewed-by: Cristian Maureira-Fredes <cristian.maureira-fredes@qt.io> Reviewed-by: Adrian Herrmann <adrian.herrmann@qt.io> Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
* build system: Refactor helper backtick()Friedemann Kleint2022-12-051-16/+14
| | | | | | | | | | Use a context manager to dispose of the process properly and remove Python2 code path. Pick-to: 6.4 6.2 Change-Id: Ibad035078433a75a944dc10f49f404e9e63614af Reviewed-by: Shyamnath Premnadh <Shyamnath.Premnadh@qt.io> Reviewed-by: Christian Tismer <tismer@stackless.com>
* Build scripts: Adapt to changed location of the metatypes directory in QtFriedemann Kleint2022-12-021-0/+10
| | | | | | | | | | | metatypes are now located under arch_data after qtbase/4234ce12dc819b9ca76c8dc4c251f5bd4fe0bc9c. Allow for a smooth transition by adding a version check. Change-Id: I15e4d560d4a93c7d2e6f737f6f303fcc0c6a678b Reviewed-by: Adrian Herrmann <adrian.herrmann@qt.io> Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: Cristian Maureira-Fredes <cristian.maureira-fredes@qt.io>
* Fix libexec path for buildShyamnath Premnadh2022-11-291-1/+2
| | | | | | | - Amends c242f3509ce43ce50cb5931f3e98c214d34cba51 Change-Id: Ib5f94f2ef8f01e798db16121569fcd73afcf2cb0 Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
* Fix create_wheels.py : wrong libexec pathShyamnath Premnadh2022-11-281-1/+1
| | | | | | | - libexec path corrected Change-Id: If9ad69ffc6742aca57cb5f057ee6814e91a9a61d Reviewed-by: Cristian Maureira-Fredes <cristian.maureira-fredes@qt.io>
* PySideTools: install tool only if corresponding Qt tool existsShyamnath Premnadh2022-11-161-0/+48
| | | | | | | | | | | | | | | | | | | | | | | - PySide tools which are wrappers around Qt tools are now only installed if the corresponding Qt tool exists. - PySide6 entry points for the Qt tool are now only created if the Qt tool exists in the corresponding Qt installation. - Incase the console entrypoint still exists and the corresponding Qt tool does not exist, the tool would exit stating that the Qt tool does not exist. eg: 'pyside6-uic' is run and 'uic' does not exist. The the tool outputs that the 'uic' does not exist. Ideally as per this change, PySide6 entrypoints for missing Qt tools should not exist at all. - versions.py deleted and contents moved to __init__.py. - Adds warning from Python incase if the tool does not exist. This is in addition to the CMake warning. Fixes: PYSIDE-2097 Pick-to: 6.4 6.2 Change-Id: I3f1b26d103679f7425d9ad85dfed8d9ad17f6fbf Reviewed-by: Cristian Maureira-Fredes <cristian.maureira-fredes@qt.io>
* pathlib: fix utils.pyShyamnath Premnadh2022-11-071-2/+2
| | | | | | | | - Amends 2afcf8e7545c681e412e5b6d04ab8867e5edd5c7 Pick-to: 6.4 Change-Id: I3b06bf3517dbab5d96c7b50a883716471376dbad Reviewed-by: Cristian Maureira-Fredes <cristian.maureira-fredes@qt.io>
* pathlib: migrate build_scripts away from os.pathCristián Maureira-Fredes2022-10-181-73/+97
| | | | | | | | | There is a usage of os.path.relpath that cannot be migrated to pathlib, which remain the only usage of os.path Task-number: PYSIDE-2080 Change-Id: Iac781e9c9324fb8b9d3559b4225912d56782072a Reviewed-by: Christian Tismer <tismer@stackless.com>
* build: replace distutils.log by simple loggerCristián Maureira-Fredes2022-10-131-5/+6
| | | | | | | | | | Adding simple logger based on the logging module to replace the distutils.log one. Task-number: PYSIDE-2079 Change-Id: I2a4996a57be701552005b57d2b1a251b9fc44c41 Reviewed-by: Christian Tismer <tismer@stackless.com> Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
* build: replace DistutilsSetupError by SetupErrorCristián Maureira-Fredes2022-10-131-6/+6
| | | | | | | | Replacing the distutils errors by the setuptools one. Task-number: PYSIDE-2079 Change-Id: I9968d9562f8dd40317344d3295943c194e3f2197 Reviewed-by: Christian Tismer <tismer@stackless.com>
* build system: Disable checking ICU libs for cross buildsFriedemann Kleint2022-09-261-0/+2
| | | | | | | | | | | ldd is used to determine the location of the ICU libs, which does not work for cross builds. Fixes: PYSIDE-2060 Pick-to: 6.3 Change-Id: Idbf8c6e9239f4623b7c11c646a616ef44e8c3ecf Reviewed-by: Shyamnath Premnadh <Shyamnath.Premnadh@qt.io> Reviewed-by: Christian Tismer <tismer@stackless.com>
* build: Improve error message about test-configuring projects with cmakeFriedemann Kleint2022-09-091-5/+38
| | | | | | | | | | | The message is crucial for testing cross-builds. Add output, environment and CMakeOutput.log if found. Task-number: PYSIDE-802 Task-number: PYSIDE-962 Change-Id: I6f4352050bd76488d7ec35f1e9d93ddf2acc4cc5 Reviewed-by: Christian Tismer <tismer@stackless.com>
* build: Address fixme comment in utils.pyFriedemann Kleint2022-09-091-9/+4
| | | | | | | | | Use subprocess.run() instead of Popen(). Task-number: PYSIDE-802 Task-number: PYSIDE-962 Change-Id: I9504303c1fbc4ecc4f1fbdaae4886a3fbd0788a0 Reviewed-by: Christian Tismer <tismer@stackless.com>
* build: use explicit unpackCristián Maureira-Fredes2022-06-291-7/+3
| | | | | | | | | Avoid accessing elements from sequences by index without being explicit about all the returns from functions. Pick-to: 6.2 6.3 Change-Id: I1cddda7f8c38724907cad854ee99489058dae5f3 Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
* build: fix readability detailsCristián Maureira-Fredes2022-06-291-8/+6
| | | | | | | | | | | | | | Removing some leftover common anti-patterns: - remove unnecessary dict() usage - remove unnecessary map() - avoid index-based loops - use capitalize() instead of index-based capitalization - use f-strings for concatenation Pick-to: 6.2 6.3 Change-Id: I0ffdf73ec47c6ef537789015052dea0fd047350d Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
* build: replace the usage of reserved Python wordsCristián Maureira-Fredes2022-06-291-24/+24
| | | | | | | | | | Internally, we were using many words like 'filter', 'vars', and 'dir' which are built-in functions in Python. To avoid confusion and a possible wrong behavior, we renamed them. Pick-to: 6.2 6.3 Change-Id: Idbadda3857705ef3a5f0440112ee923d3a61ffa0 Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
* build: rename our rmtree to avoid shutil conflictCristián Maureira-Fredes2022-06-291-2/+2
| | | | | | | | | | | There is an implementation in the 'utils' module that implements a 'rmtree' function to handle removing readonly files from a directory. To avoid confusion with shutil.rmtree we rename it to 'remove_tree'. Pick-to: 6.2 6.3 Change-Id: I3548ea81f36c87ba51fd984fcf7b1cd4cafd54d6 Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
* build: avoid mutable default value as argumentCristián Maureira-Fredes2022-06-281-2/+8
| | | | | | | | | | Mainly to avoid having a persistent object every time we call the function, to avoid future issues. Pick-to: 6.2 6.3 Change-Id: I9aea45ffa7ecd381e8c5ed6b3c83036d6e8aef72 Reviewed-by: Shyamnath Premnadh <Shyamnath.Premnadh@qt.io> Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
* build: fix flake8 warnings and missing f-stringsCristián Maureira-Fredes2022-06-281-2/+2
| | | | | | Pick-to: 6.2 6.3 Change-Id: Ibd2a6088f6a2826be38a13037fe2db6656630b34 Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
* build: catch RuntimeError for install_name_tool on macOSCristián Maureira-Fredes2022-06-211-1/+4
| | | | | | | | | To solve the issue when trying to add a RPATH to a binary that already has it. Pick-to: 6.3 Change-Id: Ia181d932d03c81f3c4a244e267c97cca84d30620 Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
* Use SPDX license identifiersLucie Gérard2022-05-271-38/+2
| | | | | | | | | | | 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>
* flake8: fix style issues to build_scripts/Cristián Maureira-Fredes2022-04-131-16/+19
| | | | | | Pick-to: 6.3 Change-Id: Ie56b054ca32869a488356b31eea49cc985fc463e Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
* build: update wheel namesCristián Maureira-Fredes2022-03-301-1/+4
| | | | | | | | | | | | - 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>
* flake8: improve codestyling of build scriptsCristián Maureira-Fredes2022-03-221-20/+16
| | | | | | | | | | | - 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>
* setup.py: Add support for cross-buildingAlexandru Croitor2022-02-041-3/+75
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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>
* 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>