aboutsummaryrefslogtreecommitdiffstats
path: root/coin_build_instructions.py
diff options
context:
space:
mode:
authorAlexandru Croitor <alexandru.croitor@qt.io>2021-10-01 16:49:32 +0200
committerAlexandru Croitor <alexandru.croitor@qt.io>2021-12-07 15:24:41 +0100
commit9eb3e39486e95bce008fee9ae48df230273fa433 (patch)
treeff58cef05db3fedb27536507b20185be4454cb73 /coin_build_instructions.py
parent0a40ebb1defe14bb3d7a308657777a11058cf182 (diff)
setup.py: CMake: Remove host python dependency for version parsing
When cross-compiling, the python interpreter found by CMake is the device one (or at least it's supposed to be), which means we can't use it to execute python scripts on the host machine to extract shiboken and pyside version information. Instead of keeping the version numbers in python files, place them into new .cmake.conf files that CMake can include in CMake projects directly. This aligns with storing version information like Qt6 does. setup.py and coin_build_instructions need version info as well, so they will now parse the set() assignments in pyside6/.cmake.conf. Ideally we would have called cmake with a minimal project that outputs those values, but we don't have access to the CMake executable path within coin_build_instructions.py, so we rely on parsing instead. Qt Conan integration does the same, so we should be good, the .cmake.conf file format is unlikely to change and cause breakages. We also modify shiboken_version.py and pyside_version.py to use the new variables when calling configure_file(), because we still ship those files in the wheels. Amends b57c557c8cd1012851f8a245075591dc33be425b Pick-to: 6.2 Change-Id: Icc830069cd459c214ec253840ba6754ece50854e Reviewed-by: Cristian Maureira-Fredes <cristian.maureira-fredes@qt.io>
Diffstat (limited to 'coin_build_instructions.py')
-rw-r--r--coin_build_instructions.py14
1 files changed, 7 insertions, 7 deletions
diff --git a/coin_build_instructions.py b/coin_build_instructions.py
index 6f75cdaff..6510b6cd7 100644
--- a/coin_build_instructions.py
+++ b/coin_build_instructions.py
@@ -42,7 +42,7 @@ from build_scripts.utils import install_pip_dependencies, expand_clang_variables
from build_scripts.utils import get_qtci_virtualEnv
from build_scripts.utils import run_instruction
from build_scripts.utils import rmtree
-from build_scripts.utils import get_python_dict
+from build_scripts.utils import parse_cmake_conf_assignments_by_key
from build_scripts.utils import get_ci_qtpaths_path
import os
import datetime
@@ -88,7 +88,7 @@ def is_snapshot_build():
"""
Returns True if project needs to be built with --snapshot-build
- This is true if the version found in pyside_version.py is not a
+ This is true if the version found in .cmake.conf is not a
pre-release version (no alphas, betas).
This eliminates the need to remove the --snapshot-build option
@@ -96,12 +96,12 @@ def is_snapshot_build():
for a release).
"""
setup_script_dir = get_current_script_path()
- pyside_version_py = os.path.join(
- setup_script_dir, "sources", "pyside6", "pyside_version.py")
- d = get_python_dict(pyside_version_py)
+ pyside_project_dir = os.path.join(setup_script_dir, "sources", "pyside6")
- release_version_type = d['release_version_type']
- pre_release_version = d['pre_release_version']
+ d = parse_cmake_conf_assignments_by_key(pyside_project_dir)
+
+ release_version_type = d['pyside_PRE_RELEASE_VERSION_TYPE']
+ pre_release_version = d['pyside_PRE_RELEASE_VERSION']
if pre_release_version and release_version_type:
return True
return False