-
Notifications
You must be signed in to change notification settings - Fork 118
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Auto merge of #207 - servo:rls, r=jdm
Make mozjs_sys cope with RLS (fixes #206) <!-- Reviewable:start --> This change is [<img src="https://reviewable.io/review_button.svg" height="34" align="absmiddle" alt="Reviewable"/>](https://reviewable.io/reviews/servo/mozjs/207) <!-- Reviewable:end -->
- Loading branch information
Showing
3 changed files
with
78 additions
and
47 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,69 @@ | ||
diff --git i/mozjs/build/moz.configure/rust.configure w/mozjs/build/moz.configure/rust.configure | ||
index 6c129579e..f6a3af9e2 100644 | ||
--- i/mozjs/build/moz.configure/rust.configure | ||
+++ w/mozjs/build/moz.configure/rust.configure | ||
@@ -29,34 +29,10 @@ def rustc_info(rustc): | ||
|
||
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') | ||
- # Older versions of cargo didn't support --verbose, in which case, they | ||
- # only output a not-really-pleasant-to-parse output. Fortunately, they | ||
- # don't error out, so we can just try some regexp matching on the output | ||
- # we already got. | ||
- if version is None: | ||
- VERSION_FORMAT = r'^cargo (\d\.\d+\.\d+).*' | ||
- | ||
- m = re.search(VERSION_FORMAT, out[0]) | ||
- # Fail fast if cargo changes its output on us. | ||
- if not m: | ||
- die('Could not determine cargo version from output: %s', out) | ||
- version = m.group(1) | ||
- | ||
- return namespace( | ||
- version=Version(version), | ||
- ) | ||
|
||
- | ||
-@depends(rustc_info, cargo_info, build_project) | ||
+@depends(rustc_info, build_project) | ||
@imports(_from='textwrap', _import='dedent') | ||
-def rust_compiler(rustc_info, cargo_info, build_project): | ||
+def rust_compiler(rustc_info, build_project): | ||
if not rustc_info: | ||
die(dedent('''\ | ||
Rust compiler not found. | ||
@@ -89,27 +65,6 @@ def rust_compiler(rustc_info, cargo_info, build_project): | ||
installer is available from https://rustup.rs/ | ||
'''.format(version, rustc_min_version))) | ||
|
||
- 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/ | ||
- ''')) | ||
- | ||
- 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. | ||
- | ||
- You can verify this by typing 'cargo --version'. | ||
- ''').format(version, cargo_min_version)) | ||
- | ||
return True | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters