Commit Graph

8 Commits

Author SHA1 Message Date
Lucie Gérard
05fc3aef53 Use SPDX license identifiers
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: Id880c92784c40f3bbde861c0d93f58151c18b9f1
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
Reviewed-by: Jörg Bornemann <joerg.bornemann@qt.io>
2022-05-16 16:37:38 +02:00
Joerg Bornemann
3d6c86ec57 pro2cmake: Fix static type errors in condition_simplifier_cache.py
Mypy reported the following:

condition_simplifier_cache.py:111: error: Argument 1 has incompatible type "*List[str]"; expected
"Optional[float]"
            file_handle = file_open_func(*file_open_args, **file_open_kwargs)
                                          ^
condition_simplifier_cache.py:111: error: Argument 2 has incompatible type "**Dict[str, object]";
expected "Union[str, Path]"
            file_handle = file_open_func(*file_open_args, **file_open_kwargs)

Fix by calling portalocker.Lock directly.

Change-Id: I538319791b1a4a1b6dffac0544d87c705e8809a7
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
2022-03-03 15:56:08 +01:00
Oliver Wolff
ca33f45d70 Fix message about missing portalocker
Change-Id: Ia82c0aab7c9085eee8a07c4a15485c0804e65e5a
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
2019-10-15 12:23:46 +00:00
Frederik Gladhorn
2d1aee8595 cmake scripts: minor cleanup
not in is considered easier to read and thus recommended (flake8) and
avoid one temporary name that is never used.
Adjust flake8 to be compatible with black formatting.

Change-Id: Ia049adb2344f11b53c78574972f6d9d670f4e66d
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
Reviewed-by: Qt CMake Build Bot
2019-10-11 07:49:20 +00:00
Alexandru Croitor
fbace1f4e0 pro2cmake: Make condition cache work well with run_pro2cmake
When using run_pro2cmake, multiple pro2cmake processes try to access
and override the condition cache.

Make sure that reads / writes of the cache file are protected by
a file lock, and the content is merged rather than overridden.

This requires use of a new pip package, portalocker.
The script will tell the user to install it if it's missing.

Change-Id: I44798c46ff0912981b186bec40e3e918f249fb4d
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
2019-10-10 10:04:50 +00:00
Frederik Gladhorn
3a103b3608 cmake scripts: fix type issues
Some of the changes are just cosmetic, but a bunch of them must be bugs,
such as mixing lists and str randomly.

Change-Id: Idd8340e17bcea7af3b87e595e251e13f5df1aa3f
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
2019-10-09 09:13:44 +00:00
Alexandru Croitor
b86630b4b0 pro2cmake: Allow disabling condition cache
New option --skip-condition-cache allows forcing recomputation of
condition simplification.
Useful when debugging certain condition mappings.

Change-Id: I68a85c2e4085ad7a3043d7334db71a334a6469e9
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
2019-10-07 13:36:11 +00:00
Alexandru Croitor
f23b7e1476 Implement persistent caching for simplify_condition
Store the results of simplify_condition in a json cache file,
next to the pro2cmake.py script.
Dramatically speeds up re-conversion of projects.

The cache is cleared whenever the content of the
condition_simplifier.py file changes, effectively presuming that the
condition computing code has changed.

Sample times.
Initial corelib.pro conversion - 142.13 seconds.
Next re-conversion with hot cache - 1.17 seconds.

Change-Id: I8790b2736358236e4b23bcb5f10f45a36fdfa426
Reviewed-by: Tobias Hunger <tobias.hunger@qt.io>
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
Reviewed-by: Qt CMake Build Bot
2019-10-01 14:14:16 +00:00