diff options
author | Simo Fält <simo.falt@qt.io> | 2023-01-19 15:06:46 +0200 |
---|---|---|
committer | Qt Cherry-pick Bot <cherrypick_bot@qt-project.org> | 2023-02-22 12:36:11 +0000 |
commit | b04be8aa620b20a2867a5d85150f4255a72d4bf0 (patch) | |
tree | adf8d35689081000e6885566a385b9530b4ae05d | |
parent | a6ac9804579a43dee0f808ba6a3f36885ea1257f (diff) |
CI: Change the way we create wheels in CI
Instead of calling setup.py to re-use binaries and creating wheels
we can call create_wheels.py directly from CI instructions. This
enables us to sign Windows binaries in correct phase and directory.
Change-Id: I7c69abe6e0b6591fb1df1e2f2805a015a49ce944
Reviewed-by: Cristian Maureira-Fredes <cristian.maureira-fredes@qt.io>
(cherry picked from commit 4c42779f7fda9290076c1818379e4fbc78d308ab)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
-rw-r--r-- | build_scripts/utils.py | 2 | ||||
-rw-r--r-- | coin/instructions/common_environment.yaml | 19 | ||||
-rw-r--r-- | coin/instructions/execute_build_instructions.yaml | 17 | ||||
-rw-r--r-- | coin_build_instructions.py | 10 | ||||
-rw-r--r-- | coin_test_instructions.py | 16 |
5 files changed, 48 insertions, 16 deletions
diff --git a/build_scripts/utils.py b/build_scripts/utils.py index 152f3d493..a6c9c5f2e 100644 --- a/build_scripts/utils.py +++ b/build_scripts/utils.py @@ -1131,7 +1131,7 @@ def install_pip_dependencies(env_pip, packages, upgrade=True): def get_qtci_virtualEnv(python_ver, host, hostArch, targetArch): _pExe = "python" - _env = f"env{python_ver}" + _env = f"{os.environ.get('PYSIDE_VIRTUALENV') or 'env'+python_ver}" env_python = f"{_env}/bin/python" env_pip = f"{_env}/bin/pip" diff --git a/coin/instructions/common_environment.yaml b/coin/instructions/common_environment.yaml index de83714e5..2c2e227c7 100644 --- a/coin/instructions/common_environment.yaml +++ b/coin/instructions/common_environment.yaml @@ -4,6 +4,25 @@ instructions: variableName: QTEST_ENVIRONMENT variableValue: "ci" - type: EnvironmentVariable + variableName: PYSIDE_VIRTUALENV + variableValue: "{{.AgentWorkingDir}}\\pyside\\pyside-setup\\env" + enable_if: + condition: property + property: host.os + equals_value: Windows + - type: EnvironmentVariable + variableName: PYSIDE_VIRTUALENV + variableValue: "{{.AgentWorkingDir}}/pyside/pyside-setup/env" + enable_if: + condition: or + conditions: + - condition: property + property: host.os + equals_value: MacOS + - condition: property + property: host.os + equals_value: Linux + - type: EnvironmentVariable variableName: TARGET_ARCHITECTURE variableValue: amd64 enable_if: diff --git a/coin/instructions/execute_build_instructions.yaml b/coin/instructions/execute_build_instructions.yaml index 0db77e3e0..48a3476db 100644 --- a/coin/instructions/execute_build_instructions.yaml +++ b/coin/instructions/execute_build_instructions.yaml @@ -89,7 +89,7 @@ instructions: property: host.os equals_value: Windows - type: ExecuteCommand - command: "c:\\users\\qt\\MSVC.bat {{.Env.PYTHON3_PATH}}\\python.exe -u coin_build_instructions.py --os={{.Env.CI_OS}} {{.Env.CI_PACKAGING_FEATURE}} {{.Env.CI_USE_SCCACHE}} --instdir=\\Users\\qt\\work\\install --targetOs={{.Env.CI_OS}} --hostArch=X86_64 --targetArch={{.Env.CI_TARGET_ARCHITECTURE}} --phase=WHEEL" + command: "c:\\users\\qt\\MSVC.bat {{.Env.PYSIDE_VIRTUALENV}}\\Scripts\\python.exe create_wheels.py" maxTimeInSeconds: 14400 maxTimeBetweenOutput: 300 enable_if: @@ -98,3 +98,18 @@ instructions: equals_value: Windows userMessageOnFailure: > Failed to create wheels for Windows + - type: ExecuteCommand + command: "{{.Env.PYSIDE_VIRTUALENV}}/bin/python create_wheels.py" + maxTimeInSeconds: 14400 + maxTimeBetweenOutput: 300 + enable_if: + condition: or + conditions: + - condition: property + property: host.os + equals_value: MacOS + - condition: property + property: host.os + equals_value: Linux + userMessageOnFailure: > + Failed to create wheels diff --git a/coin_build_instructions.py b/coin_build_instructions.py index 849d5f366..233370798 100644 --- a/coin_build_instructions.py +++ b/coin_build_instructions.py @@ -135,11 +135,6 @@ def call_setup(python_ver, phase): env = os.environ run_instruction(cmd, "Failed to run setup.py for build", initial_env=env) - if phase in ["WHEEL"] or CI_RELEASE_CONF: - cmd = [env_python, "create_wheels.py"] - run_instruction(cmd, "Failed to create new wheels", initial_env=env) - - if __name__ == "__main__": # Remove some environment variables that impact cmake @@ -164,6 +159,7 @@ if __name__ == "__main__": signing_dir = str(os.environ.get("PYSIDE_SIGNING_DIR")) print("Check for signing dir " + signing_dir) assert(os.path.isdir(signing_dir)) - - if CI_TEST_PHASE in ["ALL", "WHEEL"]: + if CI_TEST_PHASE in ["ALL", "WHEEL"] and sys.platform != "win32": + # "Old" Windows wheels won't be signed anyway so there is no need to + # create those, so that we don't accidentally release those. call_setup(python_ver, "WHEEL") diff --git a/coin_test_instructions.py b/coin_test_instructions.py index bbcbeca4d..ef390f2f5 100644 --- a/coin_test_instructions.py +++ b/coin_test_instructions.py @@ -70,13 +70,15 @@ def call_testrunner(python_ver, buildnro): # Try to install built wheels, and build some buildable examples. if CI_RELEASE_CONF: wheel_tester_path = os.path.join("testing", "wheel_tester.py") - # Run the test for the old set of wheels - cmd = [env_python, wheel_tester_path, qmake_path] - run_instruction(cmd, "Error while running wheel_tester.py on old wheels") - - # Uninstalling the other wheels - run_instruction([env_pip, "uninstall", "shiboken6", "shiboken6_generator", "pyside6", "-y"], - "Failed to uninstall old wheels") + # We create wheels differently in Qt CI with Windows and there are no "old" wheels + if CI_HOST_OS != "Windows": + # Run the test for the old set of wheels + cmd = [env_python, wheel_tester_path, qmake_path] + run_instruction(cmd, "Error while running wheel_tester.py on old wheels") + + # Uninstalling the other wheels + run_instruction([env_pip, "uninstall", "shiboken6", "shiboken6_generator", "pyside6", "-y"], + "Failed to uninstall old wheels") # Run the test for the new set of wheels cmd = [env_python, wheel_tester_path, qmake_path, "--wheels-dir=dist_new", "--new"] |