summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTarja Sundqvist <tarja.sundqvist@qt.io>2025-08-27 15:59:37 +0300
committerTarja Sundqvist <tarja.sundqvist@qt.io>2025-08-27 15:59:37 +0300
commit74527fbdeeceee1dc2aae12eee92f7ac11a9854c (patch)
tree66e45a0973459f2cc3f0ef19896bc2cfa872d6e4
parentac5d7584bf96bd78db132d904ce8809ec7cb9d66 (diff)
parent2d112c9c107df2b64069951fbb4eb5d1e139b874 (diff)
Merge tag 'v6.2.13-lts' into tqtc/lts-6.2-opensourcev6.2.13-lts-lgpl
Qt 6.2.13-lts release Conflicts solved: dependencies.yaml Change-Id: I09e8b298c376af49f7b93069dccf0cccd67d0a36
-rw-r--r--.cmake.conf2
-rw-r--r--dependencies.yaml8
m---------src/3rdparty/qface0
-rw-r--r--src/tools/ifcodegen/CMakeLists.txt15
-rwxr-xr-xsrc/tools/ifcodegen/generate.py89
-rw-r--r--src/tools/ifcodegen/generator/rule_generator.py2
6 files changed, 104 insertions, 12 deletions
diff --git a/.cmake.conf b/.cmake.conf
index 897ec4a3..b7810022 100644
--- a/.cmake.conf
+++ b/.cmake.conf
@@ -1 +1 @@
-set(QT_REPO_MODULE_VERSION "6.2.12")
+set(QT_REPO_MODULE_VERSION "6.2.13")
diff --git a/dependencies.yaml b/dependencies.yaml
index 35a09338..b93c3943 100644
--- a/dependencies.yaml
+++ b/dependencies.yaml
@@ -1,13 +1,13 @@
dependencies:
../tqtc-qtdeclarative:
- ref: a7c766a9863605eb81e8f0cdb4d2b93e087b5bde
+ ref: c6fdadd916a7568c1d71b750e054ca9aa2fd5dfc
required: true
../tqtc-qtmultimedia:
- ref: 4d5cab73c0ca3c5f4cb486ca5297724ceba52e6f
+ ref: 1180358ed7d621c1ff696dda397f130c2183e94e
required: true
../tqtc-qtremoteobjects:
- ref: 4cf461596e01645c789ba6544fc79f47be151828
+ ref: b39a3f2935d79c3f5c973e136c7508a44082da45
required: true
../tqtc-qttools:
- ref: a78a36d69a792ae66fc062e461b83c28152a6856
+ ref: d000041a232a428ba08e31323840d484642f5886
required: false
diff --git a/src/3rdparty/qface b/src/3rdparty/qface
-Subproject 2459064b0ca85c5fb19cc2a83cc2110be6da4a0
+Subproject c3f6a42e899c1bc1cc3d5343e6151d09d91eea6
diff --git a/src/tools/ifcodegen/CMakeLists.txt b/src/tools/ifcodegen/CMakeLists.txt
index 2d9e3a45..22b0c366 100644
--- a/src/tools/ifcodegen/CMakeLists.txt
+++ b/src/tools/ifcodegen/CMakeLists.txt
@@ -22,11 +22,13 @@ if(QT_FEATURE_python3_virtualenv AND NOT QT_FEATURE_system_qface)
if ("${CMAKE_HOST_SYSTEM_NAME}" STREQUAL "Windows")
set(VIRTUALENV_ACTIVATE ${VIRTUALENV_PATH}/Scripts/activate.bat)
set(VIRTUALENV_ACTIVATE_COMMAND ${VIRTUALENV_ACTIVATE})
+ set(VIRTUALENV_PYTHON ${VIRTUALENV_PATH}/Scripts/python.exe)
set(IFCODEGEN_BIN ${VIRTUALENV_PATH}/Scripts/qface.exe)
set(DEPLOY_VIRTUALENV ${CMAKE_CURRENT_SOURCE_DIR}/deploy-virtualenv.bat)
else()
set(VIRTUALENV_ACTIVATE ${VIRTUALENV_PATH}/bin/activate)
set(VIRTUALENV_ACTIVATE_COMMAND . ${VIRTUALENV_ACTIVATE})
+ set(VIRTUALENV_PYTHON ${VIRTUALENV_PATH}/bin/python)
set(IFCODEGEN_BIN ${VIRTUALENV_PATH}/bin/qface)
set(DEPLOY_VIRTUALENV ${CMAKE_CURRENT_SOURCE_DIR}/deploy-virtualenv.sh)
endif()
@@ -82,16 +84,23 @@ if(QT_FEATURE_python3_virtualenv AND NOT QT_FEATURE_system_qface)
)
add_custom_command(OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/.stamp-deploy_virtualenv
- ${CMAKE_CURRENT_BINARY_DIR}/.stamp-cmake-rerun
COMMAND ${DEPLOY_VIRTUALENV} qtif_qface_virtualenv
COMMAND ${CMAKE_COMMAND} -E touch .stamp-deploy_virtualenv
- COMMAND ${CMAKE_COMMAND} -E touch .stamp-cmake-rerun
DEPENDS ${IFCODEGEN_BIN}
)
+ add_custom_command(OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/.stamp-generator-verified
+ ${CMAKE_CURRENT_BINARY_DIR}/.stamp-cmake-rerun
+ COMMAND ${CMAKE_COMMAND} -E env IFGENERATOR_CONFIG=${CMAKE_CURRENT_BINARY_DIR}/.config ${VIRTUALENV_PYTHON} ${CMAKE_CURRENT_SOURCE_DIR}/generate.py --selfcheck
+ COMMAND ${CMAKE_COMMAND} -E touch .stamp-generator-verified
+ COMMAND ${CMAKE_COMMAND} -E touch .stamp-cmake-rerun
+ DEPENDS ${CMAKE_CURRENT_BINARY_DIR}/.stamp-deploy_virtualenv
+ COMMENT "Verifying generator"
+ )
+
# main target which just relies on the stamp file to be uptodate
add_custom_target(ifcodegen ALL
- DEPENDS ${CMAKE_CURRENT_BINARY_DIR}/.stamp-deploy_virtualenv
+ DEPENDS ${CMAKE_CURRENT_BINARY_DIR}/.stamp-generator-verified
DEPENDS ${CMAKE_CURRENT_BINARY_DIR}/.stamp-cmake-rerun
)
# Create the rerun cmake stamp file here to be able to add cmake configure dependency
diff --git a/src/tools/ifcodegen/generate.py b/src/tools/ifcodegen/generate.py
index 853e926d..ee5f7b62 100755
--- a/src/tools/ifcodegen/generate.py
+++ b/src/tools/ifcodegen/generate.py
@@ -35,7 +35,8 @@ import sys
import fnmatch
import click
import logging.config
-from path import Path
+import tempfile
+from pathlib import Path
from qface.generator import FileSystem, Generator
from qface.watch import monitor
@@ -46,7 +47,7 @@ import generator.global_functions as global_functions
from generator.filters import register_filters
from generator.rule_generator import CustomRuleGenerator
-here = Path(__file__).dirname()
+here = Path(__file__).parent
log = logging.getLogger(__file__)
@@ -181,6 +182,86 @@ def run(template_search_paths, template, moduleConfig, annotations, imports, src
exit(1)
+def self_check(ctx, param, value):
+ if not value or ctx.resilient_parsing:
+ return
+ click.echo('Running self check')
+
+ try:
+ # Parse the .config file and throw an error in case it doesn't exist or it is invalid
+ builtin_config.parse(here)
+
+ tmpDir = tempfile.TemporaryDirectory()
+ tmp = Path(tmpDir.name)
+ with open(tmp / "test.qface", 'w') as file:
+ # Write content to the file
+ file.write("""
+ module org.selftest 1.0
+
+ interface Echo {
+ string stringProperty
+ bool boolProperty
+ TestEnum enumProperty
+ TestStruct structProperty
+ string echo(string msg);
+ }
+
+ enum TestEnum {
+ value1,
+ value2
+ }
+
+ struct TestStruct {
+ int testInt
+ string testString
+ }
+ """)
+
+ with open(tmp / "selfcheck.yaml", 'w') as file:
+ # Write content to the file
+ file.write("""
+ test:
+ module:
+ documents:
+ - "{{srcBase|lower}}": "module.tpl"
+ interface:
+ documents:
+ - 'tst_{{interface|lower}}': 'interface.tpl'
+ """)
+
+ os.mkdir(tmp / "selfcheck")
+ with open(tmp / "selfcheck/module.tpl", 'w') as file:
+ # Write content to the file
+ file.write("""
+ {{module.name}}
+ """)
+
+ with open(tmp / "selfcheck/interface.tpl", 'w') as file:
+ # Write content to the file
+ file.write("""
+ {{interface.name}}
+ """)
+
+ run([tmp], 'selfcheck', {"module": "org.selftest", "force": True}, [], [], [tmp / "test.qface"], tmp)
+ click.echo('Self check finished successfully.')
+ except Exception as e:
+ raise SystemExit("""
+ Self check failed!
+
+ This might be caused by a too recent python version or
+ too recent python packages.
+ If this happens when building the qtinterfaceframework,
+ you can try installing older python packages by
+ running configure again with the following option:
+
+ -DQT_USE_MINIMAL_QFACE_PACKAGES=TRUE
+
+ The python error was:
+
+ {}
+ """.format(e))
+ ctx.exit()
+
@click.command()
@click.option('--reload/--no-reload', default=False, help=
'Specifies whether the generator should keep track of the changes in the IDL file and update '
@@ -206,6 +287,9 @@ def run(template_search_paths, template, moduleConfig, annotations, imports, src
'scanned recursively for QFace files. The QFace files found are then used to resolve '
'the information required when importing a module; this is similar to how C++ include '
'paths work.')
+@click.option('--selfcheck', is_flag=True, default=False, callback=self_check, expose_value=False, is_eager=True, help=
+ 'Runs a self check using a builtin qface file and template to verify that the generator is '
+ 'working correctly. ')
@click.argument('src', nargs=-1, type=click.Path(exists=True))
@click.argument('dst', nargs=1, type=click.Path(exists=True))
@@ -230,6 +314,5 @@ def app(src, dst, template_search_paths, template, reload, module, force, annota
}
run(template_search_paths, template, moduleConfig, annotations, imports, src, dst)
-
if __name__ == '__main__':
app()
diff --git a/src/tools/ifcodegen/generator/rule_generator.py b/src/tools/ifcodegen/generator/rule_generator.py
index 5d95afbf..902b9e00 100644
--- a/src/tools/ifcodegen/generator/rule_generator.py
+++ b/src/tools/ifcodegen/generator/rule_generator.py
@@ -31,7 +31,7 @@ import click
import logging.config
import sys
import yaml
-from path import Path
+from pathlib import Path
from qface.generator import RuleGenerator
from qface.idl.domain import Module, Interface, Property, Parameter, Field, Struct