aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSimo Fält <simo.falt@qt.io>2018-05-16 10:50:52 +0300
committerSimo Fält <simo.falt@qt.io>2018-05-17 09:28:04 +0000
commit0c83e2408b81ec62e8eb787b01518ccb46236fc4 (patch)
treec59d8306abc5f4899674694a72f91913ca12d811
parent6033f4a3425268b8c4aa1f61f7bd8b247a1ff380 (diff)
Select correct Python environment when cross compiling
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>
-rw-r--r--build_scripts/utils.py14
-rw-r--r--coin_build_instructions.py4
-rw-r--r--coin_test_instructions.py4
3 files changed, 17 insertions, 5 deletions
diff --git a/build_scripts/utils.py b/build_scripts/utils.py
index 8ce1b8a51..2dffd345c 100644
--- a/build_scripts/utils.py
+++ b/build_scripts/utils.py
@@ -1086,16 +1086,24 @@ def install_pip_dependencies(env_pip, packages):
for p in packages:
run_instruction([env_pip, "install", p], "Failed to install " + p)
-def get_qtci_virtualEnv(python_ver, host):
+def get_qtci_virtualEnv(python_ver, host, hostArch, targetArch):
_pExe = "python"
_env = "env" + str(python_ver)
env_python = _env + "/bin/python"
env_pip = _env + "/bin/pip"
if host == "Windows":
+ print("New virtualenv to build " + targetArch + " in " + hostArch + " host.")
_pExe = "python.exe"
- if python_ver == "3":
- _pExe = os.path.join(os.getenv("PYTHON3_PATH"), "python.exe")
+ # With windows we are creating building 32-bit target in 64-bit host
+ if hostArch == "X86_64" and targetArch == "X86":
+ if python_ver == "3":
+ _pExe = os.path.join(os.getenv("PYTHON3_32_PATH"), "python.exe")
+ else:
+ _pExe = os.path.join(os.getenv("PYTHON2_32_PATH"), "python.exe")
+ else:
+ if python_ver == "3":
+ _pExe = os.path.join(os.getenv("PYTHON3_PATH"), "python.exe")
env_python = _env + "\\Scripts\\python.exe"
env_pip = _env + "\\Scripts\\pip.exe"
else:
diff --git a/coin_build_instructions.py b/coin_build_instructions.py
index 8d88b9633..175513570 100644
--- a/coin_build_instructions.py
+++ b/coin_build_instructions.py
@@ -47,6 +47,8 @@ import os
# Values must match COIN thrift
CI_HOST_OS = option_value("os")
CI_TARGET_OS = option_value("targetOs")
+CI_HOST_ARCH = option_value("hostArch")
+CI_TARGET_ARCH = option_value("targetArch")
CI_HOST_OS_VER = option_value("osVer")
CI_ENV_INSTALL_DIR = option_value("instdir")
CI_ENV_AGENT_DIR = option_value("agentdir")
@@ -60,7 +62,7 @@ CI_RELEASE_CONF = has_option("packaging")
def call_setup(python_ver):
- _pExe, _env, env_pip, env_python = get_qtci_virtualEnv(python_ver, CI_HOST_OS)
+ _pExe, _env, env_pip, env_python = get_qtci_virtualEnv(python_ver, CI_HOST_OS, CI_HOST_ARCH, CI_TARGET_ARCH)
rmtree(_env, True)
run_instruction(["virtualenv", "-p", _pExe, _env], "Failed to create virtualenv")
install_pip_dependencies(env_pip, ["six", "wheel"])
diff --git a/coin_test_instructions.py b/coin_test_instructions.py
index 42c146473..29b664542 100644
--- a/coin_test_instructions.py
+++ b/coin_test_instructions.py
@@ -47,6 +47,8 @@ import os
# Values must match COIN thrift
CI_HOST_OS = option_value("os")
CI_TARGET_OS = option_value("targetOs")
+CI_HOST_ARCH = option_value("hostArch")
+CI_TARGET_ARCH = option_value("targetArch")
CI_HOST_OS_VER = option_value("osVer")
CI_ENV_INSTALL_DIR = option_value("instdir")
CI_ENV_AGENT_DIR = option_value("agentdir") or "."
@@ -60,7 +62,7 @@ if _ci_features is not None:
CI_RELEASE_CONF = has_option("packaging")
def call_testrunner(python_ver, buildnro):
- _pExe, _env, env_pip, env_python = get_qtci_virtualEnv(python_ver, CI_HOST_OS)
+ _pExe, _env, env_pip, env_python = get_qtci_virtualEnv(python_ver, CI_HOST_OS, CI_HOST_ARCH, CI_TARGET_ARCH)
rmtree(_env, True)
run_instruction(["virtualenv", "-p", _pExe, _env], "Failed to create virtualenv")
install_pip_dependencies(env_pip, ["six", "wheel"])