summary refs log tree commit diff
diff options
context:
space:
mode:
-rw-r--r--gnu/local.mk1
-rw-r--r--gnu/packages/patches/rust-1.45-linker-locale.patch14
-rw-r--r--gnu/packages/rust.scm37
3 files changed, 51 insertions, 1 deletions
diff --git a/gnu/local.mk b/gnu/local.mk
index b174cdeaf5..b3811a473f 100644
--- a/gnu/local.mk
+++ b/gnu/local.mk
@@ -1518,6 +1518,7 @@ dist_patch_DATA =						\
   %D%/packages/patches/runc-CVE-2019-5736.patch			\
   %D%/packages/patches/rust-1.19-mrustc.patch			\
   %D%/packages/patches/rust-1.25-accept-more-detailed-gdb-lines.patch \
+  %D%/packages/patches/rust-1.45-linker-locale.patch		\
   %D%/packages/patches/rust-bootstrap-stage0-test.patch		\
   %D%/packages/patches/rust-coresimd-doctest.patch		\
   %D%/packages/patches/rust-nettle-disable-vendor.patch		 \
diff --git a/gnu/packages/patches/rust-1.45-linker-locale.patch b/gnu/packages/patches/rust-1.45-linker-locale.patch
new file mode 100644
index 0000000000..40220e8e77
--- /dev/null
+++ b/gnu/packages/patches/rust-1.45-linker-locale.patch
@@ -0,0 +1,14 @@
+Patch will be included upstream in 1.47: https://github.com/rust-lang/rust/pull/74416
+diff --git a/src/librustc_codegen_ssa/back/linker.rs b/src/librustc_codegen_ssa/back/linker.rs
+index e64aafa599f..12575ac4358 100644
+--- a/src/librustc_codegen_ssa/back/linker.rs
++++ b/src/librustc_codegen_ssa/back/linker.rs
+@@ -28,7 +28,7 @@ use rustc_target::spec::{LinkOutputKind, LinkerFlavor, LldFlavor};
+ pub fn disable_localization(linker: &mut Command) {
+     // No harm in setting both env vars simultaneously.
+     // Unix-style linkers.
+-    linker.env("LC_ALL", "C");
++    linker.env("LC_ALL", "en_US.UTF-8");
+     // MSVC's `link.exe`.
+     linker.env("VSLANG", "1033");
+ }
diff --git a/gnu/packages/rust.scm b/gnu/packages/rust.scm
index 851a996e4b..b0ad992138 100644
--- a/gnu/packages/rust.scm
+++ b/gnu/packages/rust.scm
@@ -1280,7 +1280,42 @@ move around."
   (rust-bootstrapped-package rust-1.43 "1.44.1"
     "0ww4z2v3gxgn3zddqzwqya1gln04p91ykbrflnpdbmcd575n8bky"))
 
-;; NOTE: An update to LLVM 10 is coming in 1.45, make sure not to miss it.
+(define-public rust-1.45
+  (let ((base-rust
+         (rust-bootstrapped-package rust-1.44 "1.45.0"
+           "0z6dh0yd3fcm3qh960wi4s6fa6pxz9mh77psycsqfkkx5kqra15s")))
+    (package
+      (inherit base-rust)
+      (source
+        (origin
+          (inherit (package-source base-rust))
+          (patches (search-patches "rust-1.45-linker-locale.patch"))))
+      (inputs
+        (alist-replace "llvm" (list llvm-10)
+                       (package-inputs base-rust)))
+      (arguments
+        (substitute-keyword-arguments (package-arguments base-rust)
+          ((#:phases phases)
+           `(modify-phases ,phases
+              ;; These tests make sure that the parser behaves properly when
+              ;; a source file starts with a shebang. Unfortunately,
+              ;; the patch-shebangs phase changes the meaning of these edge-cases.
+              ;; We skip the test since it's drastically unlikely Guix's packaging
+              ;; will introduce a bug here.
+              (add-after 'patch-tests 'skip-shebang-tests
+                (lambda _
+                  (with-directory-excursion "src/test/ui/parser/shebang"
+                    (delete-file "shebang-doc-comment.rs")
+                    (delete-file "sneaky-attrib.rs")
+                    #t)))
+              ;; This test case synchronizes itself by starting a localhost TCP
+              ;; server. This doesn't work as networking is not available.
+              (add-after 'patch-tests 'skip-networking-test
+                (lambda _
+                  (substitute* "src/tools/cargo/tests/testsuite/freshness.rs"
+                    (("fn linking_interrupted" all)
+                     (string-append "#[ignore] " all)))
+                 #t)))))))))
 
 ;; TODO(staging): Bump this variable to the latest packaged rust.
 (define-public rust rust-1.39)