Bug 1521463 - Show rustc info in about:buildconfig r=firefox-build-system-reviewers,mshal
authorChris Manchester <cmanchester@mozilla.com>
Wed, 23 Jan 2019 20:15:14 +0000
changeset 515188 862a9e4f4cc877826d51acbcd3a6fbbd03d4f4d2
parent 515187 f5e26b338d78849ec75c0fe26cd9ca8f82a4b780
child 515189 371bf42a4b472344a50f4e8adb3e72811f31151e
push id1953
push userffxbld-merge
push dateMon, 11 Mar 2019 12:10:20 +0000
treeherdermozilla-release@9c35dcbaa899 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersfirefox-build-system-reviewers, mshal
bugs1521463
milestone66.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 1521463 - Show rustc info in about:buildconfig r=firefox-build-system-reviewers,mshal Differential Revision: https://phabricator.services.mozilla.com/D17305
build/moz.configure/rust.configure
toolkit/content/buildconfig.html
toolkit/content/moz.build
--- a/build/moz.configure/rust.configure
+++ b/build/moz.configure/rust.configure
@@ -22,16 +22,17 @@ def rustc_info(rustc):
     out = check_cmd_output(rustc, '--version', '--verbose').splitlines()
     info = dict((s.strip() for s in line.split(':', 1)) for line in out[1:])
     return namespace(
         version=Version(info.get('release', '0')),
         commit=info.get('commit-hash', 'unknown'),
         host=info['host'],
     )
 
+set_config('RUSTC_VERSION', depends(rustc_info)(lambda info: str(info.version)))
 
 @depends_if(cargo)
 @checking('cargo version', lambda info: info.version)
 @imports('re')
 def cargo_info(cargo):
     out = check_cmd_output(cargo, '--version', '--verbose').splitlines()
     info = dict((s.strip() for s in line.split(':', 1)) for line in out[1:])
     version = info.get('release')
--- a/toolkit/content/buildconfig.html
+++ b/toolkit/content/buildconfig.html
@@ -44,16 +44,21 @@
       <td>@CC_VERSION@</td>
       <td>@CFLAGS@</td>
     </tr>
     <tr>
       <td>@CXX@</td>
       <td>@CC_VERSION@</td>
       <td>@CXXFLAGS@</td>
     </tr>
+    <tr>
+      <td>@RUSTC@</td>
+      <td>@RUSTC_VERSION@</td>
+      <td>@RUSTFLAGS@</td>
+    </tr>
   </tbody>
 </table>
 <h2>Configure options</h2>
 <p>@MOZ_CONFIGURE_OPTIONS@</p>
 #ifdef ANDROID
 <h2>Package name</h2>
 <p>@ANDROID_PACKAGE_NAME@</p>
 #endif
--- a/toolkit/content/moz.build
+++ b/toolkit/content/moz.build
@@ -1,21 +1,27 @@
 # -*- Mode: python; indent-tabs-mode: nil; tab-width: 40 -*-
 # vim: set filetype=python:
 # This Source Code Form is subject to the terms of the Mozilla Public
 # License, v. 2.0. If a copy of the MPL was not distributed with this
 # file, You can obtain one at http://mozilla.org/MPL/2.0/.
 
 TEST_DIRS += ['tests']
 
-for var in ('target', 'MOZ_CONFIGURE_OPTIONS', 'CC', 'CC_VERSION', 'CXX'):
+for var in ('target', 'MOZ_CONFIGURE_OPTIONS', 'CC', 'CC_VERSION', 'CXX',
+            'RUSTC', 'RUSTC_VERSION'):
     DEFINES[var] = CONFIG[var]
 
 DEFINES['CFLAGS'] = ' '.join(CONFIG['OS_CFLAGS'])
 
+rustflags = CONFIG['RUSTFLAGS']
+if not rustflags:
+    rustflags = []
+DEFINES['RUSTFLAGS'] = ' '.join(rustflags)
+
 cxx_flags = []
 for var in ('OS_CPPFLAGS', 'OS_CXXFLAGS', 'DEBUG', 'OPTIMIZE', 'FRAMEPTR'):
     cxx_flags += COMPILE_FLAGS.get(var, [])
 
 DEFINES['CXXFLAGS'] = ' '.join(cxx_flags)
 
 if CONFIG['OS_TARGET'] == 'Android':
     DEFINES['ANDROID_PACKAGE_NAME'] = CONFIG['ANDROID_PACKAGE_NAME']