Subject: [bug#78893] [PATCH 1/1] gnu: rust: Update to 1.83.

From: Ayan Das <[email-masked]>
Date: Wed, 25 Jun 2025 00:05:04 +0530

* gnu/packages/rust.scm (rust-1.83): New variable.
* gnu/packages/rust.scm (rust): Update to 1.83.
[inputs]: Replace llvm with llvm-18.
[arguments]: Add 'disable-download-ci-llvm phase.
[source]: Update snippet for newer vendored dependencies.
[arguments]: Disable more tests in the 'disable-tests-requiring-crates.io
phase.

Signed-off-by: Ayan Das <[email-masked]>
---
 gnu/packages/rust.scm | 32 ++++++++++++++++++++++++++++----
 1 file changed, 28 insertions(+), 4 deletions(-)

diff --git a/gnu/packages/rust.scm b/gnu/packages/rust.scm
index abaf7166fd..c108fac9f7 100644
--- a/gnu/packages/rust.scm
+++ b/gnu/packages/rust.scm
@@ -1040,6 +1040,25 @@ (define-public rust-1.82
                     (string-append name "\"" ,%cargo-reference-hash "\"")))
                  (generate-all-checksums "vendor"))))))))))
 
+(define-public rust-1.83
+  (let ((base-rust (rust-bootstrapped-package rust-1.82 "1.83.0"
+                    "0vhwhk4cbyppnz0lcazfjyddyz811fgvadfxswldicpashxpfbbj")))
+    (package
+      (inherit base-rust)
+      ;; Need llvm >= 18.0
+      (inputs (modify-inputs (package-inputs base-rust)
+                             (replace "llvm" llvm-18)))
+      (arguments
+       (substitute-keyword-arguments (package-arguments base-rust)
+         ((#:phases phases)
+          `(modify-phases ,phases
+             (add-after 'configure 'disable-download-ci-llvm
+               (lambda _
+                 ;; Rust 1.83.0 introduced a check that prevents setting
+                 ;; llvm-config when download-ci-llvm is enabled.
+                 (substitute* "config.toml"
+                   (("\\[llvm\\]")
+                    "[llvm]\ndownload-ci-llvm = false")))))))))))
 
 (define (make-ignore-test-list strs)
   "Function to make creating a list to ignore tests a bit easier."
@@ -1055,7 +1074,7 @@ (define (make-ignore-test-list strs)
 ;;; Here we take the latest included Rust, make it public, and re-enable tests
 ;;; and extra components such as rustfmt.
 (define-public rust
-  (let ((base-rust rust-1.82))
+  (let ((base-rust rust-1.83))
     (package
       (inherit base-rust)
       (properties (append
@@ -1078,10 +1097,15 @@ (define-public rust
                          ;; so we unbundle them.
                          "vendor/curl-sys-0.4.52+curl-7.81.0/curl"
                          "vendor/curl-sys-0.4.74+curl-8.9.0/curl"
+                         "vendor/curl-sys-0.4.76+curl-8.10.1/curl"
                          "vendor/libffi-sys-2.3.0/libffi"
                          "vendor/libz-sys-1.1.3/src/zlib"
                          "vendor/libz-sys-1.1.18/src/zlib"
-                         "vendor/libz-sys-1.1.19/src/zlib"))
+                         "vendor/libz-sys-1.1.20/src/zlib"
+                         "vendor/lzma-sys-0.1.20/xz-5.2"))
+             ;; Force lzma-sys to use system library instead of bundled xz.
+             (substitute* "vendor/lzma-sys-0.1.20/build.rs"
+               (("!want_static && ") ""))
              ;; Use the packaged nghttp2
              (for-each
               (lambda (ver)
@@ -1110,9 +1134,8 @@ (define-public rust
                      (string-append all ", \"use-libc\"")))))
               '("3.3.0"
                 "3.4.0"
-                "3.7.1"
                 "3.10.1"
-                "3.12.0"))))))
+                "3.13.0"))))))
       (arguments
        (substitute-keyword-arguments
          (strip-keyword-arguments '(#:tests?)
@@ -1159,6 +1182,7 @@ (define-public rust
                         '("fn warn_for_unused_fields")))
                    (substitute* '("cargo_add/locked_unchanged/mod.rs"
                                   "cargo_add/lockfile_updated/mod.rs"
+                                  "cargo_add/add_workspace_non_fuzzy/mod.rs"
                                   "cargo_remove/update_lock_file/mod.rs")
                      ,@(make-ignore-test-list
                         '("fn case")))
-- 
2.49.0