Bug 1288313 - Explicitly reject unknown CPU types. r=chmanchester
authorMike Hommey <mh+mozilla@glandium.org>
Tue, 26 Apr 2016 16:27:46 +0900
changeset 306274 d4d67c4aa318365a11642b24c53838da0a9b089c
parent 306273 036a163300c8924bb0b151c95f71fe42021f2340
child 306275 f0889768e16d8713c11ad08579785d4a178d4309
push id30783
push usermh@glandium.org
push dateFri, 22 Jul 2016 21:50:31 +0000
treeherderautoland@51fe63c13c4c [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewerschmanchester
bugs1288313, 1264482
milestone50.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 1288313 - Explicitly reject unknown CPU types. r=chmanchester Since bug 1264482, unknown CPU types end up triggering a ValueError exception because of the CPU EnumString. Even if somehow the CPU is valid, the endianness is not and would trigger a ValueError exception as well. So, instead of letting the exceptions happen, use a nicer failure mode with an explicit die().
build/moz.configure/init.configure
--- a/build/moz.configure/init.configure
+++ b/build/moz.configure/init.configure
@@ -408,18 +408,17 @@ def split_triplet(triplet):
         endianness = 'little' if 'le' in cpu else 'big'
     elif cpu in ('mips64', 'mips64el'):
         canonical_cpu = 'mips64'
         endianness = 'little' if 'le' in cpu else 'big'
     elif cpu.startswith('aarch64'):
         canonical_cpu = 'aarch64'
         endianness = 'little'
     else:
-        canonical_cpu = cpu
-        endianness = 'unknown'
+        die('Unknown CPU type: %s' % cpu)
 
     return namespace(
         alias=triplet,
         cpu=CPU(canonical_cpu),
         kernel=Kernel(canonical_kernel),
         os=OS(canonical_os),
         endianness=Endianness(endianness),
         raw_cpu=cpu,