Update raspbian-rust-triplet-hack.patch from the firefox-esr tree
authorPeter Michael Green <plugwash@raspbian.org>
Tue, 27 Oct 2020 20:10:24 +0000 (20:10 +0000)
committerPeter Michael Green <plugwash@raspbian.org>
Tue, 27 Oct 2020 20:10:24 +0000 (20:10 +0000)
and apply it.

build/moz.configure/rust.configure
debian/patches/raspbian-rust-triplet-hack.patch

index e5122d6b86e9618c0768159d2ad8c4d4a3e12899..af586523b48aa3b3dc29a98de9fdc798054ee5d9 100644 (file)
@@ -192,9 +192,14 @@ def rust_compiler(rustc_info, cargo_info, build_project):
 
 
 @depends(rustc, when=rust_compiler)
+@imports('sys')
+@imports(_from='__builtin__', _import='repr')
 @imports(_from='__builtin__', _import='ValueError')
 def rust_supported_targets(rustc):
     out = check_cmd_output(rustc, '--print', 'target-list').splitlines()
+    #HACK: if there are multiple matches the algorithm uses the last one
+    #put arm-unknown-linux-gnuebihf on the end of the list so it gets preffered
+    out.append('arm-unknown-linux-gnueabihf')
     data = {}
     for t in out:
         try:
@@ -232,11 +237,13 @@ def rust_triple_alias(host_or_target, host_or_target_c_compiler):
              rust_supported_targets, arm_target, when=rust_compiler)
     @checking('for rust %s triplet' % host_or_target_str)
     @imports('os')
+    @imports('sys')
     @imports(_from='mozbuild.configure.util', _import='LineIO')
     @imports(_from='mozbuild.shellutil', _import='quote')
     @imports(_from='six', _import='ensure_binary')
     @imports(_from='tempfile', _import='mkstemp')
     @imports(_from='textwrap', _import='dedent')
+    @imports(_from='__builtin__', _import='repr')
     def rust_target(rustc, host_or_target, compiler_info,
                     rust_supported_targets, arm_target):
         # Rust's --target options are similar to, but not exactly the same
index ecb72bac16cfa9a943c9b39fce5fa920d981f5b7..95dee0d99f98e47c551dd2244ee572e95cabb619 100644 (file)
@@ -1,8 +1,8 @@
 Description:  Hack broken rust target selection so it produces the right target on raspbian.
 Author: Peter Michael Green <plugwash@raspbian.org>
---- firefox-esr-68.9.0esr.orig/build/moz.configure/rust.configure
-+++ firefox-esr-68.9.0esr/build/moz.configure/rust.configure
-@@ -185,9 +185,14 @@ def rust_compiler(rustc_info, cargo_info
+--- firefox-esr-78.3.0esr.orig/build/moz.configure/rust.configure
++++ firefox-esr-78.3.0esr/build/moz.configure/rust.configure
+@@ -192,9 +192,14 @@ def rust_compiler(rustc_info, cargo_info
  
  
  @depends(rustc, when=rust_compiler)
@@ -17,14 +17,14 @@ Author: Peter Michael Green <plugwash@raspbian.org>
      data = {}
      for t in out:
          try:
-@@ -225,11 +230,13 @@ def rust_triple_alias(host_or_target):
-              arm_target, when=rust_compiler)
+@@ -232,11 +237,13 @@ def rust_triple_alias(host_or_target, ho
+              rust_supported_targets, arm_target, when=rust_compiler)
      @checking('for rust %s triplet' % host_or_target_str)
      @imports('os')
 +    @imports('sys')
-     @imports('subprocess')
      @imports(_from='mozbuild.configure.util', _import='LineIO')
      @imports(_from='mozbuild.shellutil', _import='quote')
+     @imports(_from='six', _import='ensure_binary')
      @imports(_from='tempfile', _import='mkstemp')
      @imports(_from='textwrap', _import='dedent')
 +    @imports(_from='__builtin__', _import='repr')