guix-patches
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[bug#64804] [PATCH 2/5] gnu: rust: Add rust-1.70.


From: Fries
Subject: [bug#64804] [PATCH 2/5] gnu: rust: Add rust-1.70.
Date: Mon, 24 Jul 2023 05:36:36 +0000

* gnu/packages/rust.scm (rust-1.70): New variable.
---
 .../patches/rust-1.70-fix-rustix-build.patch  | 20 +++++++++++++++++++
 gnu/packages/rust.scm                         | 16 +++++++++++++++
 2 files changed, 36 insertions(+)
 create mode 100644 gnu/packages/patches/rust-1.70-fix-rustix-build.patch

diff --git a/gnu/packages/patches/rust-1.70-fix-rustix-build.patch 
b/gnu/packages/patches/rust-1.70-fix-rustix-build.patch
new file mode 100644
index 0000000000..a7e2003aff
--- /dev/null
+++ b/gnu/packages/patches/rust-1.70-fix-rustix-build.patch
@@ -0,0 +1,20 @@
+--- a/vendor/fd-lock/Cargo.toml        2023-05-31 14:44:48.000000000 -0700
++++ b/vendor/fd-lock/Cargo.toml        2023-07-14 21:19:34.637702319 -0700
+@@ -45,7 +45,7 @@
+ 
+ [target."cfg(unix)".dependencies.rustix]
+ version = "0.37.0"
+-features = ["fs"]
++features = ["fs", "cc"]
+ 
+ [target."cfg(windows)".dependencies.windows-sys]
+ version = "0.45.0"
+--- a/src/bootstrap/Cargo.lock 2023-07-11 20:32:40.000000000 -0700
++++ b/src/bootstrap/Cargo.lock 2023-07-14 22:41:53.269284713 -0700
+@@ -618,6 +618,7 @@
+ dependencies = [
+  "bitflags",
++ "cc",
+  "errno",
+  "io-lifetimes",
+  "libc",
diff --git a/gnu/packages/rust.scm b/gnu/packages/rust.scm
index c0738a6064..0b9afd3ea9 100644
--- a/gnu/packages/rust.scm
+++ b/gnu/packages/rust.scm
@@ -724,6 +724,22 @@ (define rust-1.69
               (for-each delete-file
                         (find-files "vendor" ".*\\.(a|dll|exe|lib)$")))))))))
 
+(define rust-1.70
+ (let ((base-rust
+         (rust-bootstrapped-package
+          rust-1.69 "1.70.0" 
"0z6j7d0ni0rmfznv0w3mrf882m11kyh51g2bxkj40l3s1c0axgxj")))
+   (package
+     (inherit base-rust)
+     (source
+      (origin
+        (inherit (package-source base-rust))
+        ;; Rust 1.70 adds the rustix library which depends on the vendored 
fd-lock
+        ;; crate. The fd-lock crate uses Outline assembly which expects a 
precompiled
+        ;; static library. Enabling the "cc" feature tells the build.rs script 
to
+        ;; compile the assembly files instead of searching for a precompiled 
library.
+        (patches (search-patches "rust-1.70-fix-rustix-build.patch"))
+        (patch-flags '("-p1")))))))
+
 ;;; Note: Only the latest versions of Rust are supported and tested.  The
 ;;; intermediate rusts are built for bootstrapping purposes and should not
 ;;; be relied upon.  This is to ease maintenance and reduce the time
-- 
2.41.0







reply via email to

[Prev in Thread] Current Thread [Next in Thread]