Bug 1321691 - Suggest boostrap if configure fails to find rust. r?chmanchester
Now that `./mach boostrap` installs rustup, suggest this if
configure fails to find the toolchain when building with
--enable-rust.
Also point out https://rustup.rs/ for those who want more control.
MozReview-Commit-ID: 8JIbERfz12f
--- a/build/moz.configure/rust.configure
+++ b/build/moz.configure/rust.configure
@@ -51,26 +51,35 @@ set_config('MOZ_CARGO_SUPPORTS_FROZEN',
@imports(_from='textwrap', _import='dedent')
def rust_compiler(value, rustc, rustc_info):
if value:
if not rustc:
die(dedent('''\
Rust compiler not found.
To compile rust language sources, you must have 'rustc' in your path.
See https//www.rust-lang.org/ for more information.
+
+ You can install rust by running './mach bootstrap'
+ or by directly running the installer from https://rustup.rs/
'''))
version = rustc_info.version
min_version = Version('1.10')
if version < min_version:
die(dedent('''\
Rust compiler {} is too old.
+
To compile Rust language sources please install at least
version {} of the 'rustc' toolchain and make sure it is
first in your path.
+
You can verify this by typing 'rustc --version'.
+
+ If you have the 'rustup' tool installed you can upgrade
+ to the latest release by typing 'rustup update'. The
+ installer is available from https://rustup.rs/
'''.format(version, min_version)))
return True
set_config('MOZ_RUST', rust_compiler)
@template
def rust_triple_alias(host_or_target):
"""Template defining the alias used for rustc's --target flag.