bug 1300152 - add rust to mozinfo.json. r=mshal
authorTed Mielczarek <ted@mielczarek.org>
Fri, 02 Sep 2016 11:57:11 -0400
changeset 313085 c2115d200aebfcf50507302c26e6ffc3c9ba12ec
parent 313084 15dfa78b6aabea262599bcb452ab606d876d78c3
child 313086 8c9117de1e7f40af42b7cbce25bc3780c032fe45
push id20479
push userkwierso@gmail.com
push dateThu, 08 Sep 2016 01:08:46 +0000
treeherderfx-team@fb7c6b034329 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersmshal
bugs1300152
milestone51.0a1
bug 1300152 - add rust to mozinfo.json. r=mshal This patch also reworks how we set all the boolean flags in mozinfo.py. MozReview-Commit-ID: IhjXCFsx5J1
python/mozbuild/mozbuild/mozinfo.py
--- a/python/mozbuild/mozbuild/mozinfo.py
+++ b/python/mozbuild/mozbuild/mozinfo.py
@@ -73,33 +73,40 @@ def build_dict(config, env=os.environ):
     # hardcoded list of 64-bit CPUs
     if p in ["x86_64", "ppc64"]:
         d["bits"] = 64
     # hardcoded list of known 32-bit CPUs
     elif p in ["x86", "arm", "ppc"]:
         d["bits"] = 32
     # other CPUs will wind up with unknown bits
 
-    d['debug'] = substs.get('MOZ_DEBUG') == '1'
-    d['nightly_build'] = substs.get('NIGHTLY_BUILD') == '1'
-    d['release_build'] = substs.get('RELEASE_BUILD') == '1'
-    d['pgo'] = substs.get('MOZ_PGO') == '1'
-    d['crashreporter'] = bool(substs.get('MOZ_CRASHREPORTER'))
-    d['datareporting'] = bool(substs.get('MOZ_DATA_REPORTING'))
-    d['healthreport'] = substs.get('MOZ_SERVICES_HEALTHREPORT') == '1'
-    d['sync'] = substs.get('MOZ_SERVICES_SYNC') == '1'
-    d['asan'] = substs.get('MOZ_ASAN') == '1'
-    d['tsan'] = substs.get('MOZ_TSAN') == '1'
-    d['telemetry'] = substs.get('MOZ_TELEMETRY_REPORTING') == '1'
-    d['tests_enabled'] = substs.get('ENABLE_TESTS') == "1"
     d['bin_suffix'] = substs.get('BIN_SUFFIX', '')
-    d['addon_signing'] = substs.get('MOZ_ADDON_SIGNING') == '1'
-    d['require_signing'] = substs.get('MOZ_REQUIRE_SIGNING') == '1'
-    d['official'] = bool(substs.get('MOZILLA_OFFICIAL'))
-    d['sm_promise'] = bool(substs.get('SPIDERMONKEY_PROMISE'))
+
+    # This is where all bool-like values go.
+    for info_name, subst_name in [
+            ('debug', 'MOZ_DEBUG'),
+            ('nightly_build', 'NIGHTLY_BUILD'),
+            ('release_build', 'RELEASE_BUILD'),
+            ('pgo', 'MOZ_PGO'),
+            ('crashreporter', 'MOZ_CRASHREPORTER'),
+            ('datareporting', 'MOZ_DATA_REPORTING'),
+            ('healthreport', 'MOZ_SERVICES_HEALTHREPORT'),
+            ('sync', 'MOZ_SERVICES_SYNC'),
+            ('asan', 'MOZ_ASAN'),
+            ('tsan', 'MOZ_TSAN'),
+            ('telemetry', 'MOZ_TELEMETRY_REPORTING'),
+            ('tests_enabled', 'ENABLE_TESTS'),
+            ('addon_signing', 'MOZ_ADDON_SIGNING'),
+            ('require_signing', 'MOZ_REQUIRE_SIGNING'),
+            ('official', 'MOZILLA_OFFICIAL'),
+            ('sm_promise', 'SPIDERMONKEY_PROMISE'),
+            ('rust', 'MOZ_RUST'),
+    ]:
+        d[info_name] = bool(substs.get(subst_name))
+
 
     def guess_platform():
         if d['buildapp'] in ('browser', 'mulet'):
             p = d['os']
             if p == 'mac':
                 p = 'macosx64'
             elif d['bits'] == 64:
                 p = '{}64'.format(p)