Bug 1288313 - Explicitly reject unknown CPU types. r?chmanchester draft
authorMike Hommey <mh+mozilla@glandium.org>
Tue, 26 Apr 2016 16:27:46 +0900
changeset 390437 ba020a387c27d69f9508c4ae9c8d4555e37b3970
parent 389550 5a91e5b49be3c1ba401b057e90c92d7488e3647d
child 390438 0bd3978c7decc86748822bdc5a05037aa5ec21d5
push id23669
push userbmo:mh+mozilla@glandium.org
push dateThu, 21 Jul 2016 04:54:31 +0000
reviewerschmanchester
bugs1288313, 1264482
milestone50.0a1
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,