aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSimo Fält <simo.falt@qt.io>2019-10-08 15:54:31 +0300
committerSimo Fält <simo.falt@qt.io>2019-10-15 10:41:20 +0300
commit5d7f9c8fa2488da200f96c2acd5e27de1aa4353a (patch)
tree5b87c46040896418a1573cb7b078215a3acbaa3b
parentbbfb6e2f102335d8bdc3678190f3c983d7babc6d (diff)
Split build instructions to build and packaging
This will enable us to use Qt CI's signing function Task-number: PYSIDE-1049 Change-Id: If85114d525fab565326a03b465924d9028b3871c Reviewed-by: Cristian Maureira-Fredes <cristian.maureira-fredes@qt.io>
-rw-r--r--coin_build_instructions.py57
1 files changed, 35 insertions, 22 deletions
diff --git a/coin_build_instructions.py b/coin_build_instructions.py
index ebb8c0766..dbdbdbd0d 100644
--- a/coin_build_instructions.py
+++ b/coin_build_instructions.py
@@ -63,6 +63,11 @@ if _ci_features is not None:
for f in _ci_features.split(', '):
CI_FEATURES.append(f)
CI_RELEASE_CONF = has_option("packaging")
+CI_TEST_PHASE = option_value("phase")
+if CI_TEST_PHASE not in ["ALL", "BUILD", "WHEEL"]:
+ CI_TEST_PHASE = "ALL"
+
+
def get_current_script_path():
""" Returns the absolute path containing this script. """
@@ -95,20 +100,20 @@ def is_snapshot_build():
return True
return False
-def call_setup(python_ver):
+def call_setup(python_ver, phase):
_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, ["pip", "numpy", "setuptools", "sphinx", "six", "wheel"])
+ if phase in ["BUILD"]:
+ rmtree(_env, True)
+ run_instruction(["virtualenv", "-p", _pExe, _env], "Failed to create virtualenv")
+ install_pip_dependencies(env_pip, ["pip", "numpy", "setuptools", "sphinx", "six", "wheel"])
cmd = [env_python, "-u", "setup.py"]
- if CI_RELEASE_CONF:
- cmd += ["bdist_wheel", "--standalone"]
- else:
- cmd += ["build"]
- qmake_path = get_ci_qmake_path(CI_ENV_INSTALL_DIR, CI_HOST_OS)
- cmd.append(qmake_path)
+ if phase in ["BUILD"]:
+ cmd += ["build", "--standalone", "--skip-packaging"]
+ elif phase in ["WHEEL"] or CI_RELEASE_CONF:
+ cmd += ["bdist_wheel", "--reuse-build", "--standalone", "--skip-cmake", "--skip-make-install", "--only-package"]
+
cmd += ["--build-tests",
"--parallel=4",
"--verbose-build"]
@@ -117,6 +122,9 @@ def call_setup(python_ver):
if is_snapshot_build():
cmd += ["--snapshot-build"]
+ qmake_path = get_ci_qmake_path(CI_ENV_INSTALL_DIR, CI_HOST_OS)
+ cmd.append(qmake_path)
+
# Due to certain older CMake versions generating very long paths
# (at least with CMake 3.6.2) when using the export() function,
# pass the shorter paths option on Windows so we don't hit
@@ -127,25 +135,30 @@ def call_setup(python_ver):
cmd += ["--package-timestamp=" + CI_INTEGRATION_ID]
env = os.environ
- run_instruction(cmd, "Failed to run setup.py", initial_env=env)
+ run_instruction(cmd, "Failed to run setup.py for build", initial_env=env)
-def run_build_instructions():
- if not acceptCITestConfiguration(CI_HOST_OS, CI_HOST_OS_VER, CI_TARGET_ARCH, CI_COMPILER):
- exit()
- # Remove some environment variables that impact cmake
- for env_var in ['CC', 'CXX']:
- if os.environ.get(env_var):
- del os.environ[env_var]
+def run_build_instructions(phase):
# Uses default python, hopefully we have python2 installed on all hosts
# Skip building using Python 2 on Windows, because of different MSVC C runtimes (VS2008 vs VS2015+)
if CI_HOST_OS != "Windows":
- call_setup("")
-
+ call_setup("", phase)
# In case of packaging build, we have to build also python3 wheel
if CI_RELEASE_CONF and CI_HOST_OS_VER not in ["RHEL_6_6"]:
- call_setup("3")
+ call_setup("3", phase)
if __name__ == "__main__":
- run_build_instructions()
+ if not acceptCITestConfiguration(CI_HOST_OS, CI_HOST_OS_VER, CI_TARGET_ARCH, CI_COMPILER):
+ exit()
+
+ # Remove some environment variables that impact cmake
+ for env_var in ['CC', 'CXX']:
+ if os.environ.get(env_var):
+ del os.environ[env_var]
+
+ if CI_TEST_PHASE in ["ALL", "BUILD"]:
+ run_build_instructions("BUILD")
+
+ if CI_TEST_PHASE in ["ALL", "WHEEL"]:
+ run_build_instructions("WHEEL")