aboutsummaryrefslogtreecommitdiff
path: root/repos/clang/firefox/fix-rust-target.patch
blob: 33319e8535778777747ce545930f86340c4771e5 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
Allow us to just set RUST_TARGET ourselves instead of hacking around in mozilla's
weird custom build system...

--- a/build/moz.configure/rust.configure
+++ b/build/moz.configure/rust.configure
@@ -280,6 +280,9 @@
     return data
 
 
+@imports('os')
+@imports(_from='mozbuild.util', _import='ensure_unicode')
+@imports(_from='mozbuild.util', _import='system_encoding')
 def detect_rustc_target(
     host_or_target, compiler_info, arm_target, rust_supported_targets
 ):
@@ -411,12 +414,12 @@
 
         return None
 
-    rustc_target = find_candidate(candidates)
+    rustc_target = os.environ['RUST_TARGET']
 
     if rustc_target is None:
         die("Don't know how to translate {} for rustc".format(host_or_target.alias))
 
-    return rustc_target
+    return ensure_unicode(rustc_target, system_encoding)
 
 
 @imports("os")