|
@@ -0,0 +1,89 @@
|
|
|
+
|
|
|
+# HG changeset patch
|
|
|
+# User Chris Manchester <cmanchester@mozilla.com>
|
|
|
+# Date 1548274514 0
|
|
|
+# Node ID 862a9e4f4cc877826d51acbcd3a6fbbd03d4f4d2
|
|
|
+# Parent f5e26b338d78849ec75c0fe26cd9ca8f82a4b780
|
|
|
+Bug 1521463 - Show rustc info in about:buildconfig r=firefox-build-system-reviewers,mshal
|
|
|
+
|
|
|
+Differential Revision: https://phabricator.services.mozilla.com/D17305
|
|
|
+
|
|
|
+diff --git a/build/moz.configure/rust.configure b/build/moz.configure/rust.configure
|
|
|
+--- 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')
|
|
|
+diff --git a/toolkit/content/buildconfig.html b/toolkit/content/buildconfig.html
|
|
|
+--- 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
|
|
|
+diff --git a/toolkit/content/moz.build b/toolkit/content/moz.build
|
|
|
+--- 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']
|
|
|
+
|