Bug 1340594 - Make sure Cargo version check can fail. r?froydnj
MozReview-Commit-ID: 9ggzbuE42Wc
--- a/build/moz.configure/rust.configure
+++ b/build/moz.configure/rust.configure
@@ -38,20 +38,20 @@ def cargo_info(cargo):
if not m:
die('Could not determine cargo version from output: %s', out)
version = m.group(1)
return namespace(
version=Version(version),
)
-@depends(rustc, cargo, rustc_info)
+@depends(rustc_info, cargo_info)
@imports(_from='textwrap', _import='dedent')
-def rust_compiler(rustc, cargo, rustc_info):
- if not rustc:
+def rust_compiler(rustc_info, cargo_info):
+ if not rustc_info:
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/
'''))
@@ -69,35 +69,37 @@ def rust_compiler(rustc, cargo, rustc_in
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, rustc_min_version)))
- if not cargo:
- die(dedent('''\
- Cargo package manager not found.
- To compile Rust language sources, you must have 'cargo' in your path.
- See https://www.rust-lang.org/ for more information.
+ if not cargo_info:
+ die(dedent('''\
+ Cargo package manager not found.
+ To compile Rust language sources, you must have 'cargo' in your path.
+ See https://www.rust-lang.org/ for more information.
+
+ You can install cargo by running './mach bootstrap'
+ or by directly running the installer from https://rustup.rs/
+ '''))
- You can install cargo by running './mach bootstrap'
- or by directly running the installer from https://rustup.rs/
- '''))
- version = cargo_info.version
- if version < cargo_min_version:
- die(dedent('''\
- Cargo package manager {} is too old.
+ version = cargo_info.version
+ if version < cargo_min_version:
+ die(dedent('''\
+ Cargo package manager {} is too old.
- To compile Rust language sources please install at least
- version {} of 'cargo' and make sure it is first in your path.
+ To compile Rust language sources please install at least
+ version {} of 'cargo' and make sure it is first in your path.
- You can verify this by typing 'cargo --version'.
- ''').format(version, cargo_min_version))
+ You can verify this by typing 'cargo --version'.
+ ''').format(version, cargo_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.
`host_or_target` is either `host` or `target` (the @depends functions