aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSimo Fält <simo.falt@qt.io>2018-04-22 20:40:30 +0300
committerSimo Fält <simo.falt@qt.io>2018-05-29 08:23:43 +0000
commitcee769a1939669505caf4df5d97efda59a8cc00a (patch)
tree40f5996a1ef8c0ceff4e127479f84b994e1b86f6
parent333757c0733bdefe4b8c8fc73785cd2c378706d7 (diff)
Move setup call from CI to wrapper script
It can be pretty long lasting process to get updates to Qt CI. To speed up pyside specific changes we move some of the logic to pyside repository. Change-Id: I7d60bf96324d5990fb408d69c00aa4d7e8e81a2f Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io> (cherry picked from commit e7cf4e32902a4df5f31e96878ef7b2404a8e69f6) Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: Cristian Maureira-Fredes <cristian.maureira-fredes@qt.io> Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
-rw-r--r--coin_build_instructions.py111
-rw-r--r--coin_test_instructions.py92
-rw-r--r--utils.py32
3 files changed, 233 insertions, 2 deletions
diff --git a/coin_build_instructions.py b/coin_build_instructions.py
new file mode 100644
index 000000000..7582a6698
--- /dev/null
+++ b/coin_build_instructions.py
@@ -0,0 +1,111 @@
+#############################################################################
+##
+## Copyright (C) 2018 The Qt Company Ltd.
+## Contact: https://www.qt.io/licensing/
+##
+## This file is part of PySide2.
+##
+## $QT_BEGIN_LICENSE:LGPL$
+## Commercial License Usage
+## Licensees holding valid commercial Qt licenses may use this file in
+## accordance with the commercial license agreement provided with the
+## Software or, alternatively, in accordance with the terms contained in
+## a written agreement between you and The Qt Company. For licensing terms
+## and conditions see https://www.qt.io/terms-conditions. For further
+## information use the contact form at https://www.qt.io/contact-us.
+##
+## GNU Lesser General Public License Usage
+## Alternatively, this file may be used under the terms of the GNU Lesser
+## General Public License version 3 as published by the Free Software
+## Foundation and appearing in the file LICENSE.LGPL3 included in the
+## packaging of this file. Please review the following information to
+## ensure the GNU Lesser General Public License version 3 requirements
+## will be met: https://www.gnu.org/licenses/lgpl-3.0.html.
+##
+## GNU General Public License Usage
+## Alternatively, this file may be used under the terms of the GNU
+## General Public License version 2.0 or (at your option) the GNU General
+## Public license version 3 or any later version approved by the KDE Free
+## Qt Foundation. The licenses are as published by the Free Software
+## Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3
+## included in the packaging of this file. Please review the following
+## information to ensure the GNU General Public License requirements will
+## be met: https://www.gnu.org/licenses/gpl-2.0.html and
+## https://www.gnu.org/licenses/gpl-3.0.html.
+##
+## $QT_END_LICENSE$
+##
+#############################################################################
+from utils import has_option
+from utils import option_value
+from utils import install_pip_dependencies
+from utils import get_qtci_virtualEnv
+from utils import run_instruction
+from utils import rmtree
+from sys import exit
+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")
+CI_COMPILER = option_value("compiler")
+CI_FEATURES = []
+_ci_features = option_value("features")
+if _ci_features is not None:
+ for f in _ci_features.split(', '):
+ CI_FEATURES.append(f)
+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)
+ rmtree(_env, True)
+ run_instruction(["virtualenv", "-p", _pExe, _env], "Failed to create virtualenv")
+ install_pip_dependencies(env_pip, ["six", "wheel"])
+ cmd = [env_python, "setup.py"]
+ # With 5.11 CI will create two sets of release binaries, one with msvc 2015 and one with msvc 2017
+ # we shouldn't release the 2015 version.
+ if CI_RELEASE_CONF and CI_COMPILER not in ["MSVC2017"]:
+ cmd += ["bdist_wheel", "--standalone"]
+ else:
+ cmd += ["build"]
+ if CI_HOST_OS == "MacOS":
+ cmd += ["--qmake=" + CI_ENV_INSTALL_DIR + "/bin/qmake"]
+ elif CI_HOST_OS == "Windows":
+
+ cmd += ["--qmake=" + CI_ENV_INSTALL_DIR + "\\bin\\qmake.exe",
+ "--openssl=C:\\openssl\\bin"]
+ else:
+ cmd += ["--qmake=" + CI_ENV_INSTALL_DIR + "/bin/qmake"]
+ cmd += ["--build-tests",
+ "--jobs=4",
+ "--verbose-build",
+ "--snapshot-build"]
+
+ run_instruction(cmd, "Failed to run setup.py")
+
+def run_build_instructions():
+ # With 5.6 we are dropping older osx versions from CI, while those
+ # are having default python with outdated pip
+ if CI_HOST_OS_VER in ["OSX_10_08", "OSX_10_10"]:
+ print("Disabled " + CI_HOST_OS_VER + " from Coin configuration")
+ exit()
+ # Disabling 32 bit cross compilation
+ if CI_HOST_ARCH == "X86_64" and CI_TARGET_ARCH == "X86":
+ print("Disabled 32 bit build on 64 bit from Coin configuration, until toolchains provisioned")
+ exit()
+
+ # Uses default python, hopefully we have python2 installed on all hosts
+ call_setup("")
+
+ # 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")
+
+if __name__ == "__main__":
+ run_build_instructions()
diff --git a/coin_test_instructions.py b/coin_test_instructions.py
new file mode 100644
index 000000000..7aac8b5a8
--- /dev/null
+++ b/coin_test_instructions.py
@@ -0,0 +1,92 @@
+#############################################################################
+##
+## Copyright (C) 2018 The Qt Company Ltd.
+## Contact: https://www.qt.io/licensing/
+##
+## This file is part of PySide2.
+##
+## $QT_BEGIN_LICENSE:LGPL$
+## Commercial License Usage
+## Licensees holding valid commercial Qt licenses may use this file in
+## accordance with the commercial license agreement provided with the
+## Software or, alternatively, in accordance with the terms contained in
+## a written agreement between you and The Qt Company. For licensing terms
+## and conditions see https://www.qt.io/terms-conditions. For further
+## information use the contact form at https://www.qt.io/contact-us.
+##
+## GNU Lesser General Public License Usage
+## Alternatively, this file may be used under the terms of the GNU Lesser
+## General Public License version 3 as published by the Free Software
+## Foundation and appearing in the file LICENSE.LGPL3 included in the
+## packaging of this file. Please review the following information to
+## ensure the GNU Lesser General Public License version 3 requirements
+## will be met: https://www.gnu.org/licenses/lgpl-3.0.html.
+##
+## GNU General Public License Usage
+## Alternatively, this file may be used under the terms of the GNU
+## General Public License version 2.0 or (at your option) the GNU General
+## Public license version 3 or any later version approved by the KDE Free
+## Qt Foundation. The licenses are as published by the Free Software
+## Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3
+## included in the packaging of this file. Please review the following
+## information to ensure the GNU General Public License requirements will
+## be met: https://www.gnu.org/licenses/gpl-2.0.html and
+## https://www.gnu.org/licenses/gpl-3.0.html.
+##
+## $QT_END_LICENSE$
+##
+#############################################################################
+from utils import has_option
+from utils import option_value
+from utils import install_pip_dependencies
+from utils import get_qtci_virtualEnv
+from utils import run_instruction
+from utils import rmtree
+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 "."
+CI_COMPILER = option_value("compiler")
+CI_FEATURES = []
+_ci_features = option_value("features")
+if _ci_features is not None:
+ for f in _ci_features.split(', '):
+ CI_FEATURES.append(f)
+
+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)
+ rmtree(_env, True)
+ run_instruction(["virtualenv", "-p", _pExe, _env], "Failed to create virtualenv")
+ install_pip_dependencies(env_pip, ["six", "wheel"])
+ cmd = [env_python, "testrunner.py", "test",
+ "--blacklist", "build_history/blacklist.txt",
+ "--buildno=" + buildnro]
+ run_instruction(cmd, "Failed to run testrunner.py")
+
+def run_test_instructions():
+ # With 5.6 we are dropping older osx versions from CI, while those
+ # are having default python with outdated pip
+ if CI_HOST_OS_VER in ["OSX_10_08", "OSX_10_10"]:
+ print("Disabled " + CI_HOST_OS_VER + " from Coin configuration")
+ exit()
+ # Disabling 32 bit cross compilation test
+ if CI_HOST_ARCH == "X86_64" and CI_TARGET_ARCH == "X86":
+ print("Disabled 32 bit build on 64 bit from Coin configuration, until toolchains provisioned")
+ exit()
+
+ os.chdir(CI_ENV_AGENT_DIR)
+ call_testrunner("", "0")
+ # We know that second build was with python3
+ if CI_RELEASE_CONF and CI_HOST_OS_VER not in ["RHEL_6_6"]:
+ call_testrunner("3", "1")
+
+if __name__ == "__main__":
+ run_test_instructions()
diff --git a/utils.py b/utils.py
index 1e23a89c4..adcaf09ef 100644
--- a/utils.py
+++ b/utils.py
@@ -347,7 +347,7 @@ def copydir(src, dst, filter=None, ignore=None, force=True, recursive=True, vars
return results
-def rmtree(dirname):
+def rmtree(dirname, ignore=False):
def handleRemoveReadonly(func, path, exc):
excvalue = exc[1]
if func in (os.rmdir, os.remove) and excvalue.errno == errno.EACCES:
@@ -355,7 +355,7 @@ def rmtree(dirname):
func(path)
else:
raise
- shutil.rmtree(dirname, ignore_errors=False, onerror=handleRemoveReadonly)
+ shutil.rmtree(dirname, ignore_errors=ignore, onerror=handleRemoveReadonly)
def run_process_output(args, initial_env=None):
if initial_env is None:
@@ -901,3 +901,31 @@ def get_python_dict(python_script_path):
except IOError as e:
print("get_python_dict: Couldn't get dict from python file: {}.".format(python_script_path))
raise
+
+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):
+ _pExe = "python"
+ _env = "env" + str(python_ver)
+ env_python = _env + "/bin/python"
+ env_pip = _env + "/bin/pip"
+
+ if host == "Windows":
+ _pExe = "python.exe"
+ 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:
+ if python_ver == "3":
+ _pExe = "python3"
+ return(_pExe, _env, env_pip, env_python)
+
+def run_instruction(instruction, error):
+ print("Running Coin instruction: " + ' '.join(str(e) for e in instruction))
+ result = subprocess.call(instruction)
+ if result != 0:
+ print("ERROR : " + error)
+ exit(result)