| 1 | From dbaa9e98002519bddb147eaac61ee3a4fd801aab Mon Sep 17 00:00:00 2001
|
| 2 | From: khanku <[email protected]>
|
| 3 | Date: Sat, 27 May 2017 22:40:07 +0200
|
| 4 | Subject: [PATCH] fix-rust-target.patch
|
| 5 |
|
| 6 | Allow us to just set RUST_TARGET ourselves instead of hacking around in mozilla's
|
| 7 | weird custom build system...
|
| 8 |
|
| 9 | Co-Authored-By: Ivan Delalande <[email protected]>
|
| 10 | Co-Authored-By: Marian Buschsieweke <[email protected]>
|
| 11 | Co-Authored-By: Rasmus Thomsen <[email protected]>
|
| 12 | Co-Authored-By: ptrcnull <[email protected]>
|
| 13 | ---
|
| 14 | build/moz.configure/rust.configure | 8 +++++---
|
| 15 | 1 file changed, 5 insertions(+), 3 deletions(-)
|
| 16 |
|
| 17 | diff --git a/build/moz.configure/rust.configure b/build/moz.configure/rust.configure
|
| 18 | index d65e019619aec..d6900660ee601 100644
|
| 19 | |
| 20 | |
| 21 | @@ -332,7 +332,9 @@ def rust_supported_targets(rustc):
|
| 22 | data.setdefault(key, []).append(namespace(rust_target=t, target=info))
|
| 23 | return data
|
| 24 |
|
| 25 | -
|
| 26 | +@imports('os')
|
| 27 | +@imports(_from='mozbuild.util', _import='ensure_unicode')
|
| 28 | +@imports(_from='mozbuild.util', _import='system_encoding')
|
| 29 | def detect_rustc_target(host_or_target, arm_target, rust_supported_targets):
|
| 30 | # Rust's --target options are similar to, but not exactly the same
|
| 31 | # as, the autoconf-derived targets we use. An example would be that
|
| 32 | @@ -488,12 +490,12 @@ def detect_rustc_target(host_or_target, arm_target, rust_supported_targets):
|
| 33 |
|
| 34 | return None
|
| 35 |
|
| 36 | - rustc_target = find_candidate(candidates)
|
| 37 | + rustc_target = os.environ['RUST_TARGET']
|
| 38 |
|
| 39 | if rustc_target is None:
|
| 40 | die("Don't know how to translate {} for rustc".format(host_or_target.alias))
|
| 41 |
|
| 42 | - return rustc_target
|
| 43 | + return ensure_unicode(rustc_target, system_encoding)
|
| 44 |
|
| 45 |
|
| 46 | @imports("os")
|
| 47 | --
|
| 48 | 2.56.0
|
| 49 |
|