aboutsummaryrefslogtreecommitdiffstats
path: root/community/firefox-esr/fix-rust-target.patch
diff options
context:
space:
mode:
Diffstat (limited to 'community/firefox-esr/fix-rust-target.patch')
-rw-r--r--community/firefox-esr/fix-rust-target.patch45
1 files changed, 25 insertions, 20 deletions
diff --git a/community/firefox-esr/fix-rust-target.patch b/community/firefox-esr/fix-rust-target.patch
index f81418efd2f..9342063c33a 100644
--- a/community/firefox-esr/fix-rust-target.patch
+++ b/community/firefox-esr/fix-rust-target.patch
@@ -1,26 +1,31 @@
+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,9 +280,13 @@
- die("Don't know how to translate {} for rustc".format(
- host_or_target.alias))
+@@ -225,7 +225,9 @@
+ data.setdefault(key, []).append(namespace(rust_target=t, target=info))
+ return data
-+ fixed_alias = rustc_target.alias.replace("-gnu", "-musl")
-+ if host_or_target.cpu != 'aarch64':
-+ fixed_alias = fixed_alias.replace("-unknown-", "-alpine-")
-+
- # Check to see whether our rustc has a reasonably functional stdlib
- # for our chosen target.
-- target_arg = '--target=' + rustc_target.alias
-+ target_arg = '--target=' + fixed_alias
- in_fd, in_path = mkstemp(prefix='conftest', suffix='.rs')
- out_fd, out_path = mkstemp(prefix='conftest', suffix='.rlib')
- os.close(out_fd)
-@@ -319,7 +323,7 @@
- os.remove(out_path)
+-
++@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
+ ):
+@@ -340,13 +342,13 @@
- # This target is usable.
-- return rustc_target.alias
-+ return fixed_alias
+ return None
- return rust_target
+- 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')