aboutsummaryrefslogtreecommitdiffstats
path: root/packaging-tools/build_clang_qdoc.py
Commit message (Collapse)AuthorAgeFilesLines
* Ensure that libclang is built with -fPIC/PIEv6.4.3-packagingAlexey Edelev2023-03-101-0/+1
| | | | | Change-Id: I2f63521785625e39ac6ed65b9d09311de2cac168 Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
* PL103: os.makedirs(path) should be replaced by path.mkdir(parents=True)v6.5.0-beta2-packagingPatrik Teivonen2023-01-241-1/+1
| | | | | Change-Id: Ie72f6555f99eeb8e499011d43d3035424ed9647f Reviewed-by: Iikka Eklund <iikka.eklund@qt.io>
* PL122: os.path.splitext("foo.bar") should be replaced by path.suffixPatrik Teivonen2023-01-241-7/+8
| | | | | | | | | os.path.split and os.path.splitext to pathlib equivalents adjust bldinstallercommon.calculate_relpath unit tests Change-Id: Ieb49864ed4f804cfdff61492edfb622ce1c4a9dc Reviewed-by: Antti Kokko <antti.kokko@qt.io>
* Refactor runner.py functionsPatrik Teivonen2022-11-011-10/+9
| | | | | | | | | Rewrite runner.py Follow up patch: run_command from bld_utils.py Requires following patch in 6cc08ee72a7eb1860bb2f982879ff71c6dda2e10 Change-Id: I984046f56d4faac8ac58f12d0dad07d7bae4b0a2 Reviewed-by: Iikka Eklund <iikka.eklund@qt.io>
* Qdoc_libclang: do not fail on test failureCristian Adam2022-10-061-1/+1
| | | | | | | | | | | | | | | | | The vanilla libclang tests can fail on Windows, do not mark a build as failed. For example: C:/Users/qt/work/build/llvm/clang/unittests/Basic/FileManagerTest.cpp:494 Expected equality of these values: (*file)->tryGetRealPathName() Which is: "C:/tmp/test" ExpectedResult Which is: "C:\\tmp/test" Change-Id: Iabf15e049a0f2544779998984069c81304540dd6 Reviewed-by: Luca Di Sera <luca.disera@qt.io>
* Add missing type hints, enable strict mypy checkingPatrik Teivonen2022-09-221-28/+45
| | | | | | | | Enable --strict parameter in mypy. Add missing type hints and resolve remaining type errors. Change-Id: Id9547cc3351b88729930c577d4ed628780c1447b Reviewed-by: Iikka Eklund <iikka.eklund@qt.io>
* pylint: Add miscellaneous checksv6.4.0-rc1-packagingPatrik Teivonen2022-09-111-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | Add comment about disabled checks in pylint hook and enable all default pylint checks except for those. Address these miscellaneous pylint warnings: -C0123: Use isinstance() rather than type() for a typecheck. (unidiomatic-typecheck) -R1714: Consider merging these comparisons with "in" (consider-using-in) -R1722: Consider using sys.exit() (consider-using-sys-exit) -C0206: Consider iterating with .items() (consider-using-dict-items) -R1710: All return statements in a function should return an expression. (inconsistent-return-statements) -W0707: Consider explicitly re-raising using the 'from' keyword (raise-missing-from) -W1510: Using subprocess.run without explicitly set `check` is not recommended. (subprocess-run-check) -W0102: Dangerous default value as argument (dangerous-default-value) -W1508: os.getenv default type is builtins.bool. Expected str or None. (invalid-envvar-default) -W0212: Access to a protected member of a client class (protected-access) -W0631: Using possibly undefined loop variable (undefined-loop-variable) -W1113: Keyword argument before variable positional arguments list in the definition of __init__ function (keyword-arg-before-vararg) -W0201: Attribute defined outside __init__ (attribute-defined-outside-init) -W0221: Number of parameters in overridden method differ (arguments-differ) -C0202: Class method should have 'cls' as first argument (bad-classmethod-argument) -W1505: Using deprecated method currentThread() (deprecated-method) -R1707: Disallow trailing comma tuple (trailing-comma-tuple) -W0603: Using the global statement (global-statement) -W0602: Using global for 'OUTPUT_STATES' but no assignment is done (global-variable-not-assigned) -C2801: Unnecessarily calls dunder method __contains__. Use in keyword. Change-Id: Ia1c6ff3f6c328a94b40a1c0f11c83151abc91423 Reviewed-by: Iikka Eklund <iikka.eklund@qt.io>
* pep8-naming: N802 function name should be lowercase (function names)Patrik Teivonen2022-09-071-9/+9
| | | | | | | Enable this check and rename functions. Change-Id: Ifc6c3248f6c6b90a240d66bb2d20cd716d887729 Reviewed-by: Iikka Eklund <iikka.eklund@qt.io>
* pylint: Remove unnecessary bits of codePatrik Teivonen2022-08-231-20/+17
| | | | | | | | | | | | | | | | | | | Enable pylint checks, and fix the following anti-patterns: - superfluous-parens - no-else-return, no-else-raise, no-else-break, no-else-continue - unnecessary-comprehension - pointless-statement, pointless-string-statement - unnecessary-pass, useless-return - unused-variable, unused-argument - useless-object-inheritance - condition-evals-to-constant - simplifiable-if-expression - redundant-unittest-assert Requires to be submitted with the following change in tqtc-qtsdk: 251649c633eb7acc417cf88fd1c7f885e2bccd7b Change-Id: I3dd50a7030e06565ae6c04d0a0e3aa07bc68218f Reviewed-by: Iikka Eklund <iikka.eklund@qt.io>
* Make imports consistent across Python scripts, isort hookv6.4.0-beta3-packagingPatrik Teivonen2022-08-051-10/+10
| | | | | | | | | | | | | | | | | | -Add isort to Pipfile, isort hook with blackformatter profile -Fix imports in unittest hook -Group and sort imports by their category (PEP8) -Blank line between import groups (PEP8) -Move all imports to toplevel (PEP8) -Don't unnecessarily append to sys.path (PEP8) -Import only required functions (this also helps reduce line length) -Update deprecated imports such as builtins.WindowsError, ConfigParser.readfp -Remove Python 2, cyclic and unused imports -Fix platform dependent imports and remove unnecessaty try-excepts -Remove unnecessary comments before imports, use in-line comments when needed -Rename conflicting functions in imports, variables as absolute imports are recommended (PEP8) Change-Id: I5ac7a3499ea47a6bdc9a9a2b5211841f65c011ea Reviewed-by: Akseli Salovaara <akseli.salovaara@qt.io>
* PEP8: Fix indentationv6.2.5-lts-packagingPatrik Teivonen2022-07-111-2/+3
| | | | | | | | | | | | | | | | | Enable flake8 indentation related checks and fix indentation: - E123 Closing bracket does not match indentation of opening bracket's line - E126 Continuation line over-indented for hanging indent - E128 Continuation line under-indented for visual indent - E125 Continuation line with same indent as next logical line - E117 Over-indented - E124 Closing bracket does not match visual indentation - E127 Continuation line over-indented for visual indent - E111 Indentation is not a multiple of four - E121 Continuation line under-indented for hanging indent Change-Id: I2f25ed06d229b8fdaf94d69fa080dc1178ff3a2d Reviewed-by: Akseli Salovaara <akseli.salovaara@qt.io> Reviewed-by: Iikka Eklund <iikka.eklund@qt.io>
* PEP8: Blank lines in function and class definitions, file endPatrik Teivonen2022-07-111-0/+26
| | | | | | | | | | | | | | Correct the amount of lines in function and class definitions as well as at the end of the file. Enable following flake8 checks: - E301 Expected 1 blank line, found 0 - E302 Expected 2 blank lines, found 0 - E303 Too many blank lines - E305 Expected 2 blank lines after end of function or class - E306 Expected 1 blank line before a nested definition - W391 Blank line at end of file Change-Id: Ia9bb511ded47df1f43bfffa4be00abfdbda60cae Reviewed-by: Akseli Salovaara <akseli.salovaara@qt.io>
* PEP8: Remove unused vars, modules, and string formattingPatrik Teivonen2022-07-111-6/+0
| | | | | | | | | | | | | Enable following checks in flake8, and fix the resulting errors: -F401 Module imported but unused -F841 Local variable name is assigned to but never used -F811 redefinition of unused module -F541 (f-string is missing placeholders) -F523 .format(...) unused positional arguments Change-Id: Iba0e9f0148054d86b39b31202aba81a7f5c03a93 Reviewed-by: Akseli Salovaara <akseli.salovaara@qt.io> Reviewed-by: Iikka Eklund <iikka.eklund@qt.io>
* Add pre-commit hook for flake8, PEP8 compliant commentsPatrik Teivonen2022-07-111-2/+2
| | | | | | | | | | | | | | | | Change block and inline comments to be PEP8 compliant. (Note: line lengths will be enforced in a separate patch) Add pre-commit hook for flake8, and enable only checks relevant to this patch: - E265 Block comment should start with '# ' - E266 Too many leading '#' for block comment - E261 At least two spaces before inline comment - E262 Inline comment should start with '# ' - E115 expected an indented block (comment) Change-Id: I0218772bfbea514b4a0d8ecc461845c4563396da Reviewed-by: Akseli Salovaara <akseli.salovaara@qt.io> Reviewed-by: Iikka Eklund <iikka.eklund@qt.io>
* PEP8 compliant copyright headers in Python scriptsv6.4.0-beta2-packagingPatrik Teivonen2022-07-071-25/+25
| | | | | | | | | | | | | -Update year and license header -Update header formatting to match others in send_header_diff_kmail.py -Change "## " to "# " in license headers to make them PEP8 compliant. -Reference: https://peps.python.org/pep-0008/#block-comments -flake8 rule descriptions and codes: -Block comment should start with '# ' (E265) -Too many leading '#' for block comment (E266) Change-Id: Ife039694462e9908bc22ab253ba3202c7245a7a3 Reviewed-by: Iikka Eklund <iikka.eklund@qt.io>
* Move bldinstallercommon.do_execute_sub_process to runner.pyPatrik Teivonen2022-06-221-4/+5
| | | | | | | | Moving this function since runner.py already has similar functionality so it makes more sense to have it there. Change-Id: Iedd4a5ba050a917258f303c21ae0edf4c30b5915 Reviewed-by: Iikka Eklund <iikka.eklund@qt.io>
* Remove platform specific initialization from bldinstallercommonIikka Eklund2022-05-311-7/+7
| | | | | | | | | | | | | | | | | | | | The current way of using bldinstallercommon is cumbersome. The bldinstallercommon "requires" initialization which in turn sets up global variables for current platform. Put the conviniency functions: is_windows() is_macos() is_linux() into bld_utils.py which should serve as a place where remainder of the utilities can go. The bldinstallercommon needs to be split into separate files/modules per functionality in the long term. Remove also Solaris support and IFW cross-compilation support which are no longer needed. Change-Id: Iecafac7e658ca05223b073ad551007fa7187fb0b Reviewed-by: Antti Kokko <antti.kokko@qt.io>
* Port build_clang_qdoc.py to Python 3.6Patrik Teivonen2022-04-111-27/+14
| | | | | Change-Id: I8bf9c932a04d5e930baad04d4e51435a8076d396 Reviewed-by: Iikka Eklund <iikka.eklund@qt.io>
* Remove unused bld_qtcreator and bld_qtcreator_plugins scriptsEike Ziller2021-08-101-1/+0
| | | | | | | | | | | The Qt Creator build uses build.py and build_plugin.py from the Qt Creator repository nowadays. Usage in build_clang was removed in 0e9fd1c6a66ef4d206c95cb0a91ff9ca4fcc46e8 Change-Id: Id465c52b52cc8d7a4fd1a291bc27222341140fb8 Reviewed-by: Akseli Salovaara <akseli.salovaara@qt.io> Reviewed-by: Antti Kokko <antti.kokko@qt.io>
* Qdoc_libclang: Disable usage of zlib and terminfoCristian Adam2021-04-301-0/+2
| | | | | | | | We don't need these features and it causes problems when consuming the llvm libraries. Change-Id: I6bef003d8142d0fb7057e230afd9603b915fc9df Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
* build_clang.py, build_clang_qdoc.py: Change how secure attribs are readIikka Eklund2020-11-271-1/+2
| | | | | | | Instead of reading it from env use the remote config file. Change-Id: I0fc244f60200e9b732ee3e00337959f68a30d169 Reviewed-by: Antti Kokko <antti.kokko@qt.io>
* Qdoc_libclang: Remove -j 1 from ninja install callv5.15.0-rc2-packagingCristian Adam2020-05-071-1/+1
| | | | | | | | | Ninja install will actually build some of the missing targets (~800 source files) one by one and installation doesn't have a problem with ninja Change-Id: I2c22bc1eff44f4c9a5db9eb92ce6fff3447c0ad2 Reviewed-by: Alessandro Portale <alessandro.portale@qt.io>
* Qdoc_libclang: Set CC and CXX compilers for NinjaCristian Adam2020-05-061-1/+6
| | | | | | | | In the Jenkins VMs the MSVC job has gcc in PATH and CMake picks up Strawberry GCC instead of MSVC. Change-Id: I377e9227f69eaa313b5a6c9c62860e8093ac5e9d Reviewed-by: Cristian Adam <cristian.adam@qt.io>
* Qdoc_libclang: Use ninja on WindowsCristian Adam2020-05-061-3/+3
| | | | | | | This is due to weird errors with jom on Windows 10 32 bit. Change-Id: I65613741fdd26076a99aee9eb6815503de8999a1 Reviewed-by: Cristian Adam <cristian.adam@qt.io>
* Qdoc_libclang: Revert usage of static MSVC CRTCristian Adam2020-05-061-1/+0
| | | | | | | | Default in Qt is dynamic CRT. The whole Qt will need to be compiled with -MT, not only libclang. Change-Id: Ie515819b3ad8dad5eedba24336fed9ca8dd7b0b6 Reviewed-by: Cristian Adam <cristian.adam@qt.io>
* Qdoc_libclang: Add verbose flag for 7zip compressionCristian Adam2020-05-061-1/+1
| | | | | Change-Id: I171af9e396aed6dee6de609feecbb9f632b13afd Reviewed-by: Cristian Adam <cristian.adam@qt.io>
* Qdoc_libclang: Use cmake to pack install directoryCristian Adam2020-05-061-1/+1
| | | | | | | | | 7z is running out of memory on 32 bit machines, I thought I would give packing with cmake a try. CMake uses libarchive from Linux world. Change-Id: Ibbf27f97fd613851b20af8d554e6dffe69721606 Reviewed-by: Cristian Adam <cristian.adam@qt.io>
* Qdoc_libclang: Fix for MSVC 32 bit compiler detectionCristian Adam2020-05-051-2/+2
| | | | | | | At the moment CMake is failing to detect the MSVC2019 32 bit compiler Change-Id: I29a477d7d1f4557f98146a09954569adde38013a Reviewed-by: Cristian Adam <cristian.adam@qt.io>
* Qdoc_libclang: Set LLVM_ENABLE_LIBXML2 to OFFCristian Adam2020-05-051-1/+2
| | | | | | | | Not present on MinGW 8.1.0 32 bit, and it fails to link 'bin/c-index-test.exe' Change-Id: I66d3a8b025eac8943aaefa833493b2836a5f8148 Reviewed-by: Cristian Adam <cristian.adam@qt.io>
* Qdoc_liblang: restrict to X86 targetCristian Adam2020-05-051-0/+1
| | | | | | | | | | | | MinGW 8.1.0 32bit is crashing with an internal compiler error on the ARM target. I think qdoc only needs the X86 target, I thought I might workaround the compiler error by not compiling the code that breaks and which I think it is not needed. Change-Id: I98ac71b817f05938fd17fb09fd638f8fed605217 Reviewed-by: Alessandro Portale <alessandro.portale@qt.io>
* Qdoc_libclang: Workaround for old MSVC2019 toolchainCristian Adam2020-05-051-0/+1
| | | | | | Relates-to: QTBUG-84006 Change-Id: I72565f71df08c0dad91de17fffaf527c9a519ebc Reviewed-by: Cristian Adam <cristian.adam@qt.io>
* Qdoc_libclang: build against the static MSVC CRTCristian Adam2020-05-051-4/+5
| | | | | | Fixes: QTBUG-71047 Change-Id: I28ecae62d2877fa20bc19f5deff32d822f59f780 Reviewed-by: Alessandro Portale <alessandro.portale@qt.io>
* Qdoc_libclang: Fix script issue.v5.15.0-rc1-packagingCristian Adam2020-05-041-1/+1
| | | | | Change-Id: I00e552bc3f0059d96182c65a4e74a3689bb4de77 Reviewed-by: Alessandro Portale <alessandro.portale@qt.io>
* QDoc_libclang: update build scriptCristian Adam2020-04-301-238/+47
| | | | | | | | | | | | Updated the build script from QtCreator_libclang, which uses the LLVM Monorepo. Removed the PGO training part. Added the LIBCLANG_BUILD_STATIC=ON part, which is needed by QDoc. Change-Id: I880eb35b813b8dad4c814cbe2f87c0be697ce33c Reviewed-by: Alessandro Portale <alessandro.portale@qt.io>
* Fix mingw buildSimon Hausmann2019-05-241-0/+1
| | | | | | | | | | Commit 3cdf98955f15729026ffc7aef2c014f367656708 imported the multiprocessing module only in build_clang.py but not build_clang_qdoc.py. Task-number: QTBUG-71047 Change-Id: I0ef719e1eff61a84211223ae8891b60a7738b3c4 Reviewed-by: Antti Kokko <antti.kokko@qt.io>
* Build libclang for qdoc from Qt llvm mirror reposSimon Hausmann2019-03-221-14/+11
| | | | | | | | | | Apply the changes from build_clang.py to fetch the sources from code.qt.io. This also allows for building from custom branches, which is needed for patches for static builds. Task-number: QTBUG-71047 Change-Id: I56290bee12da7eee91a7d0469b3f4b3123278585 Reviewed-by: Eike Ziller <eike.ziller@qt.io>
* Prospective fix for overloaded libclang buildsSimon Hausmann2019-01-091-1/+1
| | | | | | | | | | | As Tim pointed out, we sometimes appear to be building -j8 on a machine with 4 cores. There's no good reason to hardcode 8 when we can determine a reasonable job count automatically :) Change-Id: Iedb03a5382220f06a434491221042041d96e6a29 Reviewed-by: Tim Jenssen <tim.jenssen@qt.io> Reviewed-by: Paul Wicking <paul.wicking@qt.io> Reviewed-by: Eike Ziller <eike.ziller@qt.io>
* Prospective build fixSimon Hausmann2018-12-121-2/+0
| | | | | | | | | | The patch_src_path variable is None, so passing that to os.path.join doesn't work. The resulting qtcreator_path variable however is only used for "training", which we don't need for qdoc's clang. Change-Id: I9e00c4dac7d5810e005d3d9ff7bbef647c57ff95 Reviewed-by: Paul Wicking <paul.wicking@qt.io> Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
* Add script for building static libclang for qdocEike Ziller2018-12-121-0/+485
Based on the Qt Creator script with adaptions to build static libs that were done for Qt 5.11. Change-Id: Ic5b26e23176984beecadb21dd2dcf00c966ee5ab Reviewed-by: Simon Hausmann <simon.hausmann@qt.io> Reviewed-by: Paul Wicking <paul.wicking@qt.io>