Skip to content

Commit d10ffbf

Browse files
faltsicmaureir
authored andcommitted
CI: Enable Windows on Arm config
Change-Id: I66aa36d69b41afb86a6278304a231b97eabc5270 Reviewed-by: Cristian Maureira-Fredes <[email protected]>
1 parent 20fb997 commit d10ffbf

8 files changed

+58
-13
lines changed

build_scripts/platforms/windows_desktop.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
import functools
66
import os
77
import tempfile
8+
import platform
89

910
from pathlib import Path
1011

@@ -252,6 +253,8 @@ def download_qt_dependency_dlls(_vars, destination_qt_dir, artifacts):
252253
with tempfile.TemporaryDirectory() as temp_path:
253254
redist_url = "https://download.qt.io/development_releases/prebuilt/vcredist/"
254255
zip_file = "pyside_qt_deps_681_64_2022.7z"
256+
if platform.machine() == "ARM64":
257+
zip_file = "pyside_qt_deps_690_arm_2022.7z"
255258
try:
256259
download_and_extract_7z(redist_url + zip_file, temp_path)
257260
except Exception as e:
@@ -444,5 +447,6 @@ def predicate(path):
444447
destination_qt_dir,
445448
_vars=_vars)
446449

447-
if copy_clang:
450+
if copy_clang or platform.machine() == "ARM64":
451+
# Qt CI is using dynamic libclang with arm config.
448452
pyside_build.prepare_standalone_clang(is_win=True)

coin/instructions/common_environment.yaml

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,33 @@ instructions:
4646
- condition: property
4747
property: host.os
4848
equals_value: Windows
49+
- condition: property
50+
property: host.arch
51+
not_equals_value: AARCH64
52+
- type: EnvironmentVariable
53+
variableName: PYTHON3_PATH
54+
variableValue: "{{ index .Env \"PYTHON3.11.9-64_PATH\"}}"
55+
enable_if:
56+
condition: and
57+
conditions:
58+
- condition: property
59+
property: host.os
60+
equals_value: Windows
61+
- condition: property
62+
property: host.arch
63+
equals_value: AARCH64
64+
- type: EnvironmentVariable
65+
variableName: TARGET_ARCHITECTURE
66+
variableValue: arm64
67+
enable_if:
68+
condition: and
69+
conditions:
70+
- condition: property
71+
property: target.arch
72+
equals_value: AARCH64
73+
- condition: property
74+
property: host.os
75+
equals_value: Windows
4976
- type: EnvironmentVariable
5077
variableName: TARGET_ARCHITECTURE
5178
variableValue: amd64_x86

coin/instructions/execute_desktop_instructions.yaml

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,18 @@ instructions:
4747
condition: property
4848
property: host.os
4949
equals_value: Windows
50+
- type: EnvironmentVariable
51+
variableName: PYSIDE_SIGNING_DIR
52+
variableValue: "{{.AgentWorkingDir}}\\pyside\\{{.Env.TESTED_MODULE_COIN}}\\build\\qfpa-p3.11\\package_for_wheels"
53+
enable_if:
54+
condition: and
55+
conditions:
56+
- condition: property
57+
property: host.os
58+
equals_value: Windows
59+
- condition: property
60+
property: host.arch
61+
equals_value: AARCH64
5062
- type: ExecuteCommand
5163
command: "{{.Env.interpreter}} -m pip install -r requirements-coin.txt --user"
5264
maxTimeInSeconds: 14400
@@ -83,7 +95,7 @@ instructions:
8395
userMessageOnFailure: >
8496
Failed to install requirements-coin.txt dependencies on Windows
8597
- type: ExecuteCommand
86-
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=BUILD"
98+
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={{.Env.HOST_ARCH_COIN}} --targetArch={{.Env.TARGET_ARCH_COIN}} --phase=BUILD"
8799
maxTimeInSeconds: 14400
88100
maxTimeBetweenOutput: 600
89101
enable_if:

coin/instructions/execute_test_instructions.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,7 @@ instructions:
8686
userMessageOnFailure: >
8787
Failed to install requirements-coin.txt on Windows
8888
- type: ExecuteCommand
89-
command: "c:\\users\\qt\\MSVC.bat {{.Env.PYTHON3_PATH}}\\python.exe -u coin_test_instructions.py --os={{.Env.CI_OS}} {{.Env.CI_PACKAGING_FEATURE}} --instdir=c:\\Users\\qt\\work\\install --targetOs={{.Env.CI_OS}} --hostArch=X86_64 --targetArch={{.Env.CI_TARGET_ARCHITECTURE}}"
89+
command: "c:\\users\\qt\\MSVC.bat {{.Env.PYTHON3_PATH}}\\python.exe -u coin_test_instructions.py --os={{.Env.CI_OS}} {{.Env.CI_PACKAGING_FEATURE}} --instdir=c:\\Users\\qt\\work\\install --targetOs={{.Env.CI_OS}} --hostArch={{.Env.HOST_ARCH_COIN}} --targetArch={{.Env.TARGET_ARCH_COIN}}"
9090
maxTimeInSeconds: 14400
9191
maxTimeBetweenOutput: 600
9292
enable_if:

coin/instructions_utils.py

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -144,7 +144,7 @@ def remove_variables(vars):
144144
del os.environ[env_var]
145145

146146

147-
def setup_virtualenv(python, exe, env, pip, log):
147+
def setup_virtualenv(python, exe, env, pip, log, ci):
148148
# Within Ubuntu 24.04 one can't install anything with pip to outside of
149149
# virtual env. Trust that we already have proper virtualenv installed.
150150
if os.environ.get("HOST_OSVERSION_COIN") != "ubuntu_24_04":
@@ -156,7 +156,10 @@ def setup_virtualenv(python, exe, env, pip, log):
156156
env_path = Path(str(site.USER_BASE)) / "bin"
157157
v_env = env_path / "virtualenv"
158158
if sys.platform == "win32":
159-
env_path = os.path.join(site.USER_BASE, "Scripts")
159+
if ci.TARGET_ARCH == "aarch64":
160+
env_path = os.path.join(site.USER_BASE, "Python311-arm64", "Scripts")
161+
else:
162+
env_path = os.path.join(site.USER_BASE, "Scripts")
160163
v_env = os.path.join(env_path, "virtualenv.exe")
161164
try:
162165
run_instruction([str(v_env), "--version"], "Using default virtualenv")
@@ -191,7 +194,7 @@ def call_setup(python_ver, ci, phase, log, buildnro=0):
191194
python = Path(get_env_or_raise("PYTHON3_PATH")) / "python.exe"
192195

193196
if phase == "BUILD":
194-
setup_virtualenv(python, exe, env, pip, log)
197+
setup_virtualenv(python, exe, env, pip, log, ci)
195198
elif phase == "TEST":
196199

197200
if ci.HOST_OS == "MacOS" and ci.HOST_ARCH == "ARM64":
@@ -201,7 +204,7 @@ def call_setup(python_ver, ci, phase, log, buildnro=0):
201204
[pip, "install", "-r", "requirements.txt"], "Failed to install dependencies"
202205
)
203206
else:
204-
setup_virtualenv(python, exe, env, pip, log)
207+
setup_virtualenv(python, exe, env, pip, log, ci)
205208
# Install distro to replace missing platform.linux_distribution() in python3.8
206209
run_instruction([pip, "install", "distro"], "Failed to install distro")
207210

coin/module_config.yaml

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -25,9 +25,6 @@ accept_configuration:
2525
- condition: property # Windows on Arm
2626
property: target.arch
2727
not_equals_value: ARM64
28-
- condition: property # Windows on Arm host build
29-
property: target.arch
30-
not_equals_value: AARCH64
3128
- condition: property
3229
property: features
3330
not_contains_value: DebianPackaging

create_wheels.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -149,8 +149,8 @@ def get_platform_tag() -> str:
149149
# We know the CI builds universal2 wheels
150150
_tag = f"macosx_{target}_universal2"
151151
elif _os == "win32":
152-
win_arch = platform.architecture()[0]
153-
msvc_arch = "x86" if win_arch.startswith("32") else "amd64"
152+
win_arch = platform.machine()
153+
msvc_arch = "arm64" if win_arch.startswith("ARM64") else "amd64"
154154
_tag = f"win_{msvc_arch}"
155155

156156
return _tag

requirements.txt

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,5 +8,7 @@ patchelf==0.17.2; sys_platform == 'linux'
88
# 2.0.2 is the last version that supports Python 3.9
99
numpy<=2.0.2; python_version <= '3.9'
1010
numpy==2.1.3; python_version > '3.9'
11-
mypy[faster-cache]>=1.14.0
11+
mypy>=1.14.0; platform_machine == 'ARM64' and sys_platform == 'win32'
12+
mypy[faster-cache]>=1.14.0; platform_machine != 'ARM64' and sys_platform == 'win32'
13+
mypy[faster-cache]>=1.14.0; sys_platform != 'win32'
1214
tomlkit==0.12.1

0 commit comments

Comments
 (0)