Skip to content

Commit d765d23

Browse files
Clement Skaucommit-bot@chromium.org
Clement Skau
authored andcommitted
[Tools] Makes build.py --arch more case-tolerant.
This allows us to do both: tools/build.py -a ia32 and tools/build.py -a IA32,ARMx64,x64 Also fixes missing arch option in utils.py. Change-Id: I6f911397dbf52437f5347d41d71cdd3254a29476 Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/134700 Reviewed-by: Teagan Strickland <[email protected]> Commit-Queue: Clement Skau <[email protected]> Auto-Submit: Clement Skau <[email protected]>
1 parent 16782e6 commit d765d23

File tree

2 files changed

+9
-5
lines changed

2 files changed

+9
-5
lines changed

tools/build.py

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -16,10 +16,7 @@
1616
HOST_CPUS = utils.GuessCpus()
1717
SCRIPT_DIR = os.path.dirname(sys.argv[0])
1818
DART_ROOT = os.path.realpath(os.path.join(SCRIPT_DIR, '..'))
19-
AVAILABLE_ARCHS = [
20-
'ia32', 'x64', 'simarm', 'arm', 'arm_x64', 'simarmv6', 'armv6', 'simarm64',
21-
'arm64', 'simarm_x64'
22-
]
19+
AVAILABLE_ARCHS = utils.ARCH_FAMILY.keys()
2320

2421
usage = """\
2522
usage: %%prog [options] [targets]
@@ -107,8 +104,13 @@ def ProcessOptions(options, args):
107104
if not mode in ['debug', 'release', 'product']:
108105
print("Unknown mode %s" % mode)
109106
return False
110-
for arch in options.arch:
107+
for i, arch in enumerate(options.arch):
111108
if not arch in AVAILABLE_ARCHS:
109+
# Normalise to lower case form to make it less case-picky.
110+
arch_lower = arch.lower()
111+
if arch_lower in AVAILABLE_ARCHS:
112+
options.arch[i] = arch_lower
113+
continue
112114
print("Unknown arch %s" % arch)
113115
return False
114116
options.os = [ProcessOsOption(os_name) for os_name in options.os]

tools/utils.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -272,12 +272,14 @@ def ListDartArgCallback(option, value, parser):
272272
'macos': os.path.join('xcodebuild'),
273273
}
274274

275+
# Note: gn expects these to be lower case.
275276
ARCH_FAMILY = {
276277
'ia32': 'ia32',
277278
'x64': 'ia32',
278279
'arm': 'arm',
279280
'armv6': 'arm',
280281
'arm64': 'arm',
282+
'arm_x64': 'arm',
281283
'simarm': 'ia32',
282284
'simarmv6': 'ia32',
283285
'simarm64': 'ia32',

0 commit comments

Comments
 (0)