Bug 950279 - Expose int() to moz.build sandbox, and use it in build/gyp.mozbuild. r=gps
authorMike Hommey <mh+mozilla@glandium.org>
Tue, 17 Dec 2013 11:12:15 +0900
changeset 176767 37da8ecbee72e69966fbadbf36214cb932295381
parent 176766 574c74c2f035155a2343c39fc36a71365b0eacbe
child 176768 f6fffc162c1a009a436d7e40c729e24391abe4ad
push id3343
push userffxbld
push dateMon, 17 Mar 2014 21:55:32 +0000
treeherdermozilla-beta@2f7d3415f79f [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersgps
bugs950279
milestone29.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 950279 - Expose int() to moz.build sandbox, and use it in build/gyp.mozbuild. r=gps
build/gyp.mozbuild
python/mozbuild/mozbuild/frontend/sandbox.py
--- a/build/gyp.mozbuild
+++ b/build/gyp.mozbuild
@@ -82,20 +82,17 @@ arches = {
     'ppc': 'ppc',
     'ppc64': 'ppc',
     'ia64': 'ia64',
 }
 
 gyp_vars['target_arch'] = arches[CONFIG['CPU_ARCH']]
 
 if CONFIG['ARM_ARCH']:
-    # We currently don't have a way to convert a string to an int in moz.build.
-    # As of writing, ARM_ARCH is not going to be over 8, so a string comparison
-    # works.
-    if CONFIG['ARM_ARCH'] < '7':
+    if int(CONFIG['ARM_ARCH']) < 7:
         gyp_vars['armv7'] = 0
     elif os == 'Android':
         gyp_vars['armv7'] = 1
     else:
         # CPU detection for ARM works on Android only.  armv7 always uses CPU
         # detection, so we have to set armv7=0 for non-Android target
         gyp_vars['armv7'] = 0
 
--- a/python/mozbuild/mozbuild/frontend/sandbox.py
+++ b/python/mozbuild/mozbuild/frontend/sandbox.py
@@ -91,16 +91,17 @@ class GlobalNamespace(dict):
 
     # The default set of builtins.
     BUILTINS = ReadOnlyDict({
         # Only real Python built-ins should go here.
         'None': None,
         'False': False,
         'True': True,
         'sorted': alphabetical_sorted,
+        'int': int,
     })
 
     def __init__(self, allowed_variables=None, builtins=None):
         """Create a new global namespace having specific variables.
 
         allowed_variables is a dict of the variables that can be queried and
         mutated. Keys in this dict are the strings representing keys in this
         namespace which are valid. Values are tuples of stored type, assigned