[infra] Setup Windows ARM64.

Change-Id: I6a9c5beba0ec909b75a463de04586787068fdbcd
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/303424
Reviewed-by: Alexander Thomas <athom@google.com>
Commit-Queue: Ryan Macnak <rmacnak@google.com>
This commit is contained in:
Ryan Macnak 2023-06-02 18:18:09 +00:00 committed by Commit Queue
parent 808b4d5bf6
commit 32977d8f43
5 changed files with 39 additions and 16 deletions

16
DEPS
View file

@ -48,7 +48,8 @@ vars = {
# Checked-in SDK version. The checked-in SDK is a Dart SDK distribution in a
# cipd package used to run Dart scripts in the build and test infrastructure,
# which is automatically built on the release commits.
"sdk_tag": "git_revision:7a6514d1377175decd3a886fe4190fbbebddac3a", # 3.0.0
# Use a dev commit because Windows ARM64 is not built on beta or stable.
"sdk_tag": "version:3.1.0-155.0.dev",
# co19 is a cipd package. Use update.sh in tests/co19[_2] to update these
# hashes.
@ -547,7 +548,7 @@ deps = {
"version": "version:" + Var("chrome_tag"),
}
],
"condition": "host_cpu == 'x64'",
"condition": "download_chrome",
"dep_type": "cipd",
},
@ -558,6 +559,17 @@ deps = {
"version": Var("gn_version"),
},
],
"condition": "host_os != 'win'",
"dep_type": "cipd",
},
Var("dart_root") + "/buildtools/win": {
"packages": [
{
"package": "gn/gn/windows-amd64",
"version": Var("gn_version"),
},
],
"condition": "host_os == 'win'",
"dep_type": "cipd",
},

View file

@ -307,10 +307,12 @@ class TestConfiguration {
const targetFolderName = {
Abi.windowsX64: 'x64',
Abi.windowsIA32: 'ia32',
Abi.windowsArm64: 'arm64',
};
const envScriptArgument = {
Abi.windowsX64: '/x64',
Abi.windowsIA32: '/x86',
Abi.windowsArm64: '/arm64',
};
final binDir =
msvcPath.resolve('bin/Hostx64/${targetFolderName[Abi.current()]!}/');

View file

@ -1811,13 +1811,14 @@
"name": "build dart",
"script": "tools/build.py",
"arguments": [
"--no-goma",
"runtime"
]
},
{
"name": "vm tests",
"arguments": [
"-nvm-${system}-${mode}-${arch}"
"-nvm-${system}-${mode}-${arch}"
]
}
]
@ -1835,13 +1836,14 @@
"name": "build dart",
"script": "tools/build.py",
"arguments": [
"--no-goma",
"runtime"
]
},
{
"name": "vm tests",
"arguments": [
"-nvm-aot-${system}-${mode}-${arch}"
"-nvm-aot-${system}-${mode}-${arch}"
]
}
]

View file

@ -16,7 +16,6 @@ HOST_ARCH = utils.GuessArchitecture()
SCRIPT_DIR = os.path.dirname(sys.argv[0])
DART_ROOT = os.path.realpath(os.path.join(SCRIPT_DIR, '..'))
AVAILABLE_ARCHS = utils.ARCH_FAMILY.keys()
GN = os.path.join(DART_ROOT, 'buildtools', 'gn')
# Environment variables for default settings.
DART_USE_TOOLCHAIN = "DART_USE_TOOLCHAIN" # Use instead of --toolchain-prefix
@ -575,8 +574,10 @@ def parse_args(args):
def BuildGnCommand(args, mode, arch, target_os, sanitizer, out_dir):
gn = os.path.join(DART_ROOT, 'buildtools',
'gn.exe' if utils.IsWindows() else 'gn')
if utils.IsWindows():
gn = os.path.join(DART_ROOT, 'buildtools', 'win', 'gn.exe')
else:
gn = os.path.join(DART_ROOT, 'buildtools', 'gn')
if not os.path.isfile(gn):
raise Exception("Couldn't find the gn binary at path: " + gn)

View file

@ -250,15 +250,21 @@ def HostArchitectures():
if m == 'x86_64':
# X64 Macs no longer support IA32.
return ['x64']
else:
if m in ['aarch64', 'arm64', 'arm64e', 'ARM64']:
return ['arm64']
if m in ['armv7l', 'armv8l']:
return ['arm']
if m in ['i386', 'i686', 'ia32', 'x86']:
return ['x86', 'ia32']
if m in ['x64', 'x86-64', 'x86_64', 'amd64', 'AMD64']:
return ['x64', 'x86', 'ia32']
# Icky use of CIPD_ARCHITECTURE should be effectively dead whenever the
# Python on bots becomes native ARM64.
if ((platform.system() == 'Windows') and
(os.environ.get("CIPD_ARCHITECTURE") == "arm64")):
# ARM64 Windows also can emulate X64.
return ['arm64', 'x64']
if m in ['aarch64', 'arm64', 'arm64e', 'ARM64']:
return ['arm64']
if m in ['armv7l', 'armv8l']:
return ['arm']
if m in ['i386', 'i686', 'ia32', 'x86']:
return ['x86', 'ia32']
if m in ['x64', 'x86-64', 'x86_64', 'amd64', 'AMD64']:
return ['x64', 'x86', 'ia32']
raise Exception('Failed to determine host architectures for %s %s',
platform.machine(), platform.system())