aboutsummaryrefslogtreecommitdiffstats
path: root/build_scripts/utils.py
Commit message (Collapse)AuthorAgeFilesLines
* build_scripts: remove unused codeCristian Maureira-Fredes2021-03-031-8/+1
| | | | | | | | | | | | | The function was removed in 609b1cd7ab8514354c93249e8a295e5e907d8de9 because CMake is in charge of discovering the location via llvm-config. This removes the code and raise a OSError if LLVM/CLANG_INSTALL_DIR is not defined. Change-Id: Ifb74b9eb327518dbc7b114e6868b773f304a577e Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io> (cherry picked from commit b3dd5989db62cbb18bb9eff2ff8bad29f0ccb5a3) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* build_scripts: use f-strings instead of format()Cristian Maureira-Fredes2021-01-041-76/+75
| | | | | | | | Change-Id: I165e9a39f968f67f9eae3a632739908d5f8fda59 Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io> Reviewed-by: Christian Tismer <tismer@stackless.com> (cherry picked from commit 6cc55fefc8ddf12ecc9dcce33e367148e6216b1f) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* build_scripts: replace print by distutils.logCristian Maureira-Fredes2021-01-041-11/+11
| | | | | | | Change-Id: I1106598719b48650847b08637e0caf6677cb26a0 Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io> (cherry picked from commit a35afc89a911612b4de3c71a8717f1fb74a39455) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* Allow calling CI's build scripts with python2Simo Fält2020-11-301-1/+7
| | | | | | | | | Currently we can't be sure that python3 is a default python in all CI nodes. Change-Id: I58ba7d2bb2dd987d344709c296ee3c5bc5c9c376 Reviewed-by: Cristian Maureira-Fredes <cristian.maureira-fredes@qt.io> Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
* Build scripts: Switch to Qt 6Friedemann Kleint2020-11-021-1/+1
| | | | | Change-Id: I40ba653f38bf079a697f0a509300a87e45181c30 Reviewed-by: Christian Tismer <tismer@stackless.com>
* build_scripts: remove references to python 2Cristian Maureira-Fredes2020-10-271-11/+4
| | | | | | | | | * Removing all the special cases for Python 2.7 * Removing Python >=3 conditions * Keeping Python 3.6+ as the allowed Python Change-Id: Ie48cafe952ae7a11bea997da2a35e7df5fea9a44 Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
* Merge remote-tracking branch 'origin/5.15' into devFriedemann Kleint2020-10-081-7/+9
|\ | | | | | | Change-Id: I30aaad19852c50b1222222ba66171f9c98ecb7c8
| * setup.py: Fix some flake8 warningsFriedemann Kleint2020-10-071-7/+9
| | | | | | | | | | | | | | Fix spaces around operators, missing lines, import order. Change-Id: I05ecafec849578fed6018654fcefaa008b6801e8 Reviewed-by: Cristian Maureira-Fredes <cristian.maureira-fredes@qt.io>
* | Merge remote-tracking branch 'origin/5.15' into devFriedemann Kleint2020-09-291-5/+15
|\| | | | | | | Change-Id: Ie6da3938b82f5ebe96dd12bd65a3ccc4180d2fba
| * Test with additional python versionSimo Fält2020-09-241-5/+15
| | | | | | | | | | Change-Id: I17726f6bd02d36a7acc3ed99ca11796b780b837d Reviewed-by: Cristian Maureira-Fredes <cristian.maureira-fredes@qt.io>
* | Further cleanup of CMakeListsFriedemann Kleint2020-09-041-22/+0
|/ | | | | | | | | | Remove some remains of Python2 and Qt 5 and some unused options. Task-number: PYSIDE-1339 Task-number: PYSIDE-904 Change-Id: Ic9c7d4048b6be0cdeb0f5cc9b23d13b1702f1bdc Reviewed-by: Christian Tismer <tismer@stackless.com>
* Clean the build/install output a bitCristián Maureira-Fredes2020-06-081-1/+1
| | | | | | | | | | | | * Adding STATUS or WARNING to a couple of message() calls. * Replacing some print() by log.info() * Changing some '*' by '-' * Align configuration outputs to check paths easily * Adding big message to check when shiboken2/pyside2 is being built. * Including the cmake_minimum_required() function instead of an 'if'. Change-Id: Idb6c5797286d400192d083403063e2ae582e3fe6 Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
* build_scripts: Fix resource warning in Windows debug buildsFriedemann Kleint2020-01-241-0/+1
| | | | | | | | | Close the pipe obtained by POpen, fixing: build_scripts\main.py:1185: ResourceWarning: unclosed file <_io.TextIOWrapper name=3 encoding='cp1252'> out = run_process_output(cmake_cmd) Change-Id: I5de0391003b40119758d93712d8178694e7fc14b Reviewed-by: Cristian Maureira-Fredes <cristian.maureira-fredes@qt.io>
* Improve code style with flake8Cristián Maureira-Fredes2019-11-251-130/+120
| | | | | | | | | | | | | | | | | - We agreed on 100 columns time ago, so I move around a few things, - Removing unused modules, - Fix white-spaces tabs without being multiple of 4, - Encourage the use of os.path.join when joining paths, - Using .format() for string formatting, - Remove white-spaces from default arguments, - Adjusting white-spaces before inline comments, - Adding extra newlines when expected, - Adjust spaces for lines under-indented for visual indent, - Remove white-spaces from parenthesis, and adding them for arithmetic operators. Change-Id: I9cb28cefd114d63580b584a063c452f90d3ca885 Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
* build scripts: Fix arguments handlingFriedemann Kleint2019-10-301-3/+3
| | | | | | | Properly pass lists to regenerate_qt_resources(). Change-Id: I8cdd388b02a247dde915f14b21e3f3770a0c64a1 Reviewed-by: Christian Tismer <tismer@stackless.com>
* Disable Android target from CISimo Fält2019-09-201-1/+1
| | | | | Change-Id: I4945620d3328cfd26a713306730beb64445136f4 Reviewed-by: Cristian Maureira-Fredes <cristian.maureira-fredes@qt.io>
* Merge remote-tracking branch 'origin/5.12' into 5.13Friedemann Kleint2019-08-161-1/+2
|\ | | | | | | Change-Id: I0f71c6ca75fae7e1eff6675d787891507d4dd965
| * Exclude SLES_12,15 from COIN buildsFriedemann Kleint2019-08-151-1/+2
| | | | | | | | | | | | Change-Id: I6ba6cb1799837ebcf093404ca3415c893584f21e Reviewed-by: Christian Tismer <tismer@stackless.com> Reviewed-by: Simo Fält <simo.falt@qt.io>
* | Unpin wheel packageSimo Fält2019-06-181-7/+0
|/ | | | | | | | The fix we were waiting for has landed to released wheel package. Change-Id: I1d83be7cd9662ca2e076e9c03c03c38f1b0c9ecb Reviewed-by: Cristian Maureira-Fredes <cristian.maureira-fredes@qt.io>
* Disable Ubuntu 18.04 NoGui configuration from CISimo Fält2019-05-311-1/+1
| | | | | | Change-Id: I57783a5da7b403e45463068900c1248fbd3651f9 Reviewed-by: Christian Tismer <tismer@stackless.com>
* Automatically Test Small Example With PyInstallerChristian Tismer2019-04-081-1/+1
| | | | | | | | | | | | | | | | | | | A simple hello.py script was modified for running in PyInstaller and stopping to execute after 2 seconds. The reason is to test that PyInstaller works correctly together with the embedded mode of the signature extension on all platforms. The script did first not work on Windows. This is now solved, after an import in pyside2_config.py is fixed. Currently, there are several configuration errors in COIN. Errors are therefore skipped in the PyInstaller build. The test tests only if the generated script works. Change-Id: I7a1b1e738d523b83cc3fe5beafa7e2579f9c7f48 Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
* setup.py: Retry to downloading dependenciesFriedemann Kleint2019-02-111-4/+9
| | | | | | | Fix frequent timeouts in COIN. Change-Id: I2a85fd6a72891a937a758e0f5c38aacdcb83de8f Reviewed-by: Cristian Maureira-Fredes <cristian.maureira-fredes@qt.io>
* Build scripts: Make location of 7z a bit smarter on WindowsFriedemann Kleint2019-02-061-2/+12
| | | | | | | | Check for the default install location in case it was not added to the path. Change-Id: I6f21353147552ed6f556f79878e6ba89dc40cb43 Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
* Disable WebAssembly config from CISimo Fält2019-01-221-1/+1
| | | | | | | Qt for Python is not supporting that configuration. Change-Id: I4821ca84c1706cc60d3d43d5f20efbbda10e9c07 Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
* setup.py: Fix running under non-UTF8 localeFriedemann Kleint2019-01-161-4/+1
| | | | | | | | | | Redirecting stderr to stdout causes an error when running under non-UTF8 locales. For the build scripts, it is also not desired to mix the output channels, so, remove the redirection. Change-Id: I6e3d05ede00537c3cc4c022780e8d0ed27bb0cad Fixes: PYSIDE-880 Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
* Make quiet builds really quietAlexandru Croitor2018-12-071-22/+11
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | The change does a couple of things: - Sets the distutils / setuptools --verbose option to 0 - Sets the distutils / setuptools --quiet option to 1 - The options above end up calling distutils.log.set_verbosity(0) - Passes the QUIET_BUILD cmake option from setup.py to every CMake invocation, when --quiet is passed to setup.py - Sets the CMAKE_INSTALL_MESSAGE variable to silence messages regarding installation of files - Sets the CMAKE_RULE_MESSAGES variable to disable progress report in makefiles when building each source file - Overrides the CMake message function, not to display STATUS / info / untyped messages (still displays warnings and errors) - Changes the build / install elapsed time messages to always be printed even in quiet mode - Reverts the previously introduced set_quiet function in utils, because log.set_verbosity() now takes care of silencing those messages As a result, there's a lot less clutter when doing a quiet build. Warnings, errors and shiboken output is still displayed. Change-Id: Ie05c593ce7dc0aa04554c2d2859ce655233ddb9f Reviewed-by: Christian Tismer <tismer@stackless.com> Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
* Build scripts: Implement --quietFriedemann Kleint2018-11-211-11/+22
| | | | | | | | | Add a _verbose setting to the utils module and set it depending on option --quiet. Depending on this, suppress the messages about copying files, shortening the build log by over 1000 lines. Change-Id: I3f9abce3b145d43c4fe615f624ca4e2769a269f8 Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
* Don't redirect stderr to stdout by default when calling setup.pyAlexandru Croitor2018-10-181-2/+7
| | | | | Change-Id: I49b7491be9649979f9f9487e983bdc4be355de07 Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
* Build scripts: Fix warning about invalid escape sequencesFriedemann Kleint2018-10-171-3/+2
| | | | | | | | | | | | ...\build_scripts\utils.py:548: DeprecationWarning: invalid escape sequence \d '[\d.]+\)') ...\build_scripts\utils.py:695: DeprecationWarning: invalid escape sequence \d version_re = re.compile('(\d+)\.(\d+)\.(\d+)') Change-Id: Ic03cf2997885a5806141bf4b05527f5f005290ae Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: Cristian Maureira-Fredes <cristian.maureira-fredes@qt.io> Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
* Add tests to install built wheels and build some examplesAlexandru Croitor2018-10-121-0/+10
| | | | | | | | | | | | | | | | | | | | Augment coin_test_instructions.py to run a new script testing/wheel_tester.py, which tries to pip install the built wheels, and then tries to build the samplebinding and scriptableapplication examples. This allows us to confirm that the generated wheels are actually installable, and also hopefully prevent us from breaking the embeddable examples, by making sure that they at least build (and execute in the case of samplebinding). The change also modifies the examples to be able to take the python executable as build argument, so that wheel_tester can specify explicitly which python interpeter to use. Change-Id: I0f141e40ab86e3311dd25915c4e53b0af36aaae9 Reviewed-by: Christian Tismer <tismer@stackless.com> Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
* Allow building shiboken2 and PySide2 as separate wheelsAlexandru Croitor2018-10-121-93/+110
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Actually this creates 3 wheel packages: - shiboken2 (the python module and libshiboken shared library) - shiboken2-generator (contains the generator executable, libclang and dependent Qt libraries) - PySide2 (the PySide2 modules and Qt shared libraries, and tools like rcc, uic) Calling the setup.py script will not do the actual build now (in the sense of calling CMake, make, etc.). Instead it will spawn new processes (via subprocess.call) calling the same setup.py script, but with different arguments. These "sub-invocations" will do the actual building. Thus, the "top-level invocation" will decide which packages to build and delegate that to the "sub-invocations" of setup.py. A new optional command line argument is introduced called "--build-type" which defaults to "all", and can also be set to "shiboken2", "shiboken2-generator" and "pyside2". A user can choose which packages to build using this option. The "top-level invocation" uses this option to decide how many "sub-invocations" to execute. A new command line argument called "--internal-build-type" takes the same values as the one above. It defines which package will actually be built in the new spawned "sub-invocation" process. The "top-level invocation" sets this automatically for each "sub-invocation" depending on the value of "--build-type". This option is also useful for developers that may want to debug the python building code in the "sub-invocation". Developers can set this manually via the command line, and thus avoid the process spawning indirection. A new class Config is introduced to facilitate storage of the various state needed for building a single package. A new class SetupRunner is introduced that takes care of the "--build-type" and "--internal-build-type" argument handling and delegation of "sub-invocations". A new class Options is introduced to 'hopefully', in the future, streamline the mess of option handling that we currently have. setup.py now is now simplified to mostly just call SetupRunner.run_setup(). Certain refactorings were done to facilitate further clean-up of the build code, the current code is definitely not the end all be all. Various other changes that were needed to implement the wheel separation: - a new cmake_helpers directory is added to share common cmake code between packages. - the custom popenasync.py file is removed in favor of using subprocess.call in as many places as possible, and thus avoid 10 different functions for process creation. - Manifest.in is removed, because copying to the setuptools build dir is now done directly by prepare_packages functions. - because prepare_packages copies directly to the setuptools build dir, avoiding the pyside_package dir, we do less copying of big Qt files now. - versioning of PySide2 and shiboken2 packages is now separate. shiboken2 and shiboken2-generator share the same versions for now though. - shiboken2 is now listed as a required package for PySide2, to facilitate pip requirements.txt dependencies. - coin_build_instructions currently needs to install an unreleased version of wheel, due to a bug that breaks installation of generated wheel files. - added separate command line options to pyside2_config.py for shiboken2-module and shiboken2-generator. - adapted samplebinding and scriptableapplication projects due to shiboken being a separate package. - adapted pyside2-tool and shiboken2-tool python scripts for setup tools entry points. - made some optimizations not to invoke cmake for shiboken2-generator when doing a top-level "all" build. - fixed unnecessary rpaths not to be included on Linux (mainly the Qt rpaths). Task-nubmer: PYSIDE-749 Change-Id: I0336043955624c1d12ed254802c442608cced5fb Reviewed-by: Christian Tismer <tismer@stackless.com> Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
* Revert "setup.py: parallel build by default"Friedemann Kleint2018-09-201-7/+0
| | | | | | | | | The default is not compatible with certain Linux accelerations. This reverts commit 99bfe460b85ccb3562e10f12972852233870e649. Change-Id: I8b6a2854adc40d6b9949a8d92f0b521a94940ba4 Reviewed-by: Christian Tismer <tismer@stackless.com>
* setup.py: parallel build by defaultAleksandr Mezin2018-09-181-0/+7
| | | | | | | | | | | | | If '--jobs' option is not specified and environment variable isn't set, set it to the number of logical CPUs if possible. I'm adding the option almost every time I run 'setup.py', and probably other people do it too. So maybe it's a good idea to enable parallel build by default. I don't know why anyone would want a non-parallel build, but it's still possible with '--jobs=1'. Change-Id: Id593b7d472588d33f01c52a21afa1a08eacb04a6 Reviewed-by: Christian Tismer <tismer@stackless.com>
* Merge branch '5.11' into devAlexandru Croitor2018-07-251-11/+5
|\ | | | | | | Change-Id: I7e3add2bdd36c0fe9fe99122d35a4409fed80773
| * Build script/Linux: Use installed patchelf if presentFriedemann Kleint2018-07-241-11/+5
| | | | | | | | | | | | | | | | | | | | Add path search helper and use installed patchelf instead of building the contained source. Task-number: PYSIDE-740 Change-Id: I8043aa58ff9ebc4884eee9f15745865f10bb30fe Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: Christian Tismer <tismer@stackless.com>
* | Enable macOS 10.13 in CISimo Fält2018-07-251-2/+2
| | | | | | | | | | Change-Id: Idd0f8721854614bf7ba2d9d38372627f8ed1b6b1 Reviewed-by: Christian Tismer <tismer@stackless.com>
* | Merge remote-tracking branch 'origin/5.11' into devFriedemann Kleint2018-07-031-0/+13
|\| | | | | | | Change-Id: Ib2eeca97ebabcff53ef7ddd9fc769be6424db39f
| * Refactor accepted CI configurationsSimo Fält2018-06-041-0/+13
|/ | | | | Change-Id: I7baa695fe4100e15b108e4eb7df15c6af7db2cbe Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
* Format python files to use PEP8Cristian Maureira-Fredes2018-05-231-58/+58
| | | | | | | Change-Id: I8dc16c10565da8f93ba5cb7cace004f8eaf52236 Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io> Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io> Reviewed-by: Christian Tismer <tismer@stackless.com>
* Select correct Python environment when cross compilingSimo Fält2018-05-171-3/+11
| | | | | | | | | To be able to create 32 bit wheel in 64 bit Windows, we must use correct Python version. Task-number: PYSIDE-646 Change-Id: I72c05e9c5b6f37f16c118e36c3c7ea8f90ee7dff Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
* Move setup call from CI to wrapper scriptSimo Fält2018-05-111-2/+30
| | | | | | | | | It can be pretty long lasting process to get updates to Qt CI. To speed up pyside specific changes we move some of the logic to pyside repository. Change-Id: I7d60bf96324d5990fb408d69c00aa4d7e8e81a2f Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
* Make sure copied libclang file has write permissionsAlexandru Croitor2018-05-081-1/+9
| | | | | | | | | | | | | | When doing a standalone rebuild on macOS, if the libclang library copied over has no write permissions set, the install procedure will fail with permission denied error. Make sure to make the file owner writable, so that any subsequent rebuilds don't cause a failure. Change-Id: I54bb3f6e8bd8db7f8ed2de17892fcedec09b6c32 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>
* Change license from all the filesCristian Maureira-Fredes2018-05-031-1/+1
| | | | | | | | | | | | | | | | | Removing the word 'project' from all the headers, and changing the PySide reference from the examples to Qt for Python: The following line was used inside the source/ and build_scripts/ directory: for i in $(grep -r "the Qt for Python project" * |grep -v "pyside2-tools" | awk '{print $1}' | sed 's/:.*//g');do sed -i 's/the\ Qt\ for\ Python\ project/Qt\ for\ Python/g' $i;done and the following line was used inside the examples/ directory: for i in $(grep -r "of the PySide" * |grep -v "pyside2-tools" | awk '{print $1}' | sed 's/:.*//g');do sed -i 's/of\ the\ PySide/of\ the\ Qt\ for\ Python/g' $i;done Change-Id: Ic480714686ad62ac4d81c670f87f1c2033d4ffa1 Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io> Reviewed-by: Alex Blasche <alexander.blasche@qt.io>
* Fix typo on build_scripts/utils.pyCristian Maureira-Fredes2018-05-031-1/+1
| | | | | Change-Id: I338d38358f63af544e3cc58c9e6208a8616f98a6 Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
* Split and move various setup.py parts into different filesAlexandru Croitor2018-04-301-0/+1075
This is an initial effort to clean up setup.py. A new directory called build_scripts contains most of the logic for building, leaving setup.py as an entry point. The build_scripts directory contains the usual qtinfo, utils, and the setup.py content has been split into main.py and platform specific files under platforms subfolder. The testrunner script has been modified to find the new location of the utils module. Task-number: PYSIDE-558 Change-Id: I3e041d5116ca5c3f96c789317303b65a7b1bbd70 Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>