summaryrefslogtreecommitdiff
path: root/gnu/packages
diff options
context:
space:
mode:
authorBrennan Vincent <brennan@umanwizard.com>2024-10-18 11:10:20 -0400
committerEfraim Flashner <efraim@flashner.co.il>2024-11-28 11:05:03 +0200
commitff785d32e3cd705fbf8a0623631aa65e0ca5daa8 (patch)
tree2f530348274aa89a1068d166c16bed5b62e43978 /gnu/packages
parent00acb49a9956231bc589bba92c22c4add0c9565b (diff)
gnu: rust: Update to 1.82.
gnu/packages/rust.scm (rust-1.81)[source]: Add patch to fix bootstrap of 1.82 on riscv64. gnu/packages/rust.scm (rust-1.82): New variable. gnu/packages/rust.scm (rust): Update to 1.82. [source]: Update snippet for newer version. [arguments]: Disable more tests in the 'disable-tests-requiring-crates.io phase. Change-Id: If6ff59011edca7a230946a3ba77b51f26cd47789 Signed-off-by: Efraim Flashner <efraim@flashner.co.il>
Diffstat (limited to 'gnu/packages')
-rw-r--r--gnu/packages/patches/rust-1.81-fix-riscv64-bootstrap.patch40
-rw-r--r--gnu/packages/rust.scm93
2 files changed, 117 insertions, 16 deletions
diff --git a/gnu/packages/patches/rust-1.81-fix-riscv64-bootstrap.patch b/gnu/packages/patches/rust-1.81-fix-riscv64-bootstrap.patch
new file mode 100644
index 00000000000..39a79a9628e
--- /dev/null
+++ b/gnu/packages/patches/rust-1.81-fix-riscv64-bootstrap.patch
@@ -0,0 +1,40 @@
1From 99e6a28804eac57faa37134d61a2bb17069996a2 Mon Sep 17 00:00:00 2001
2From: Nicholas Bishop <nicholasbishop@google.com>
3Date: Thu, 30 May 2024 18:32:46 -0400
4Subject: [PATCH] Add f16/f128 handling in a couple places
5
6---
7 compiler/rustc_codegen_llvm/src/abi.rs | 2 ++
8 compiler/rustc_target/src/abi/call/mod.rs | 2 ++
9 2 files changed, 4 insertions(+)
10
11diff --git a/compiler/rustc_codegen_llvm/src/abi.rs b/compiler/rustc_codegen_llvm/src/abi.rs
12index a6a3f0f964611..2e52d3f426a83 100644
13--- a/compiler/rustc_codegen_llvm/src/abi.rs
14+++ b/compiler/rustc_codegen_llvm/src/abi.rs
15@@ -121,8 +121,10 @@ impl LlvmType for Reg {
16 match self.kind {
17 RegKind::Integer => cx.type_ix(self.size.bits()),
18 RegKind::Float => match self.size.bits() {
19+ 16 => cx.type_f16(),
20 32 => cx.type_f32(),
21 64 => cx.type_f64(),
22+ 128 => cx.type_f128(),
23 _ => bug!("unsupported float: {:?}", self),
24 },
25 RegKind::Vector => cx.type_vector(cx.type_i8(), self.size.bytes()),
26diff --git a/compiler/rustc_target/src/abi/call/mod.rs b/compiler/rustc_target/src/abi/call/mod.rs
27index fc79c9232d1bd..f83d0492004a2 100644
28--- a/compiler/rustc_target/src/abi/call/mod.rs
29+++ b/compiler/rustc_target/src/abi/call/mod.rs
30@@ -236,8 +236,10 @@ impl Reg {
31 _ => panic!("unsupported integer: {self:?}"),
32 },
33 RegKind::Float => match self.size.bits() {
34+ 16 => dl.f16_align.abi,
35 32 => dl.f32_align.abi,
36 64 => dl.f64_align.abi,
37+ 128 => dl.f128_align.abi,
38 _ => panic!("unsupported float: {self:?}"),
39 },
40 RegKind::Vector => dl.vector_align(self.size).abi,
diff --git a/gnu/packages/rust.scm b/gnu/packages/rust.scm
index 7f854022421..e6efd094e9f 100644
--- a/gnu/packages/rust.scm
+++ b/gnu/packages/rust.scm
@@ -1051,8 +1051,45 @@ safety and thread safety guarantees.")
1051 (string-append all ", \"use-libc\"")))))))))) 1051 (string-append all ", \"use-libc\""))))))))))
1052 1052
1053(define-public rust-1.81 1053(define-public rust-1.81
1054 (rust-bootstrapped-package rust-1.80 "1.81.0" 1054 (let ((base-rust (rust-bootstrapped-package rust-1.80 "1.81.0"
1055 "19yggj1qivdhf68gx2652cfi7nxjkdgy39wh7h6facpzppz4h947")) 1055 "19yggj1qivdhf68gx2652cfi7nxjkdgy39wh7h6facpzppz4h947")))
1056 (package
1057 (inherit base-rust)
1058 (source
1059 (origin
1060 (inherit (package-source base-rust))
1061 ;; see https://github.com/rust-lang/rust/issues/129268#issuecomment-2430133779
1062 (patches (search-patches "rust-1.81-fix-riscv64-bootstrap.patch")))))))
1063
1064(define-public rust-1.82
1065 (let ((base-rust (rust-bootstrapped-package rust-1.81 "1.82.0"
1066 "0ajiryki2aqsg3ydx3nfhrb5i1mmxvasfszs9qblw66skr8g8lvw")))
1067 (package
1068 (inherit base-rust)
1069 (source
1070 (origin
1071 (inherit (package-source base-rust))
1072 (patches '())))
1073 (arguments
1074 (substitute-keyword-arguments (package-arguments base-rust)
1075 ((#:phases phases)
1076 `(modify-phases ,phases
1077 (replace 'patch-cargo-checksums
1078 (lambda _
1079 (substitute* (cons* "Cargo.lock"
1080 "src/bootstrap/Cargo.lock"
1081 "library/Cargo.lock"
1082 (filter
1083 ;; Don't mess with the lock files in the
1084 ;; Cargo testsuite; it messes up the tests.
1085 (lambda (path)
1086 (not (string-contains
1087 path "cargo/tests/testsuite")))
1088 (find-files "src/tools" "Cargo.lock")))
1089 (("(checksum = )\".*\"" all name)
1090 (string-append name "\"" ,%cargo-reference-hash "\"")))
1091 (generate-all-checksums "vendor"))))))))))
1092
1056 1093
1057(define (make-ignore-test-list strs) 1094(define (make-ignore-test-list strs)
1058 "Function to make creating a list to ignore tests a bit easier." 1095 "Function to make creating a list to ignore tests a bit easier."
@@ -1068,7 +1105,7 @@ safety and thread safety guarantees.")
1068;;; Here we take the latest included Rust, make it public, and re-enable tests 1105;;; Here we take the latest included Rust, make it public, and re-enable tests
1069;;; and extra components such as rustfmt. 1106;;; and extra components such as rustfmt.
1070(define-public rust 1107(define-public rust
1071 (let ((base-rust rust-1.81)) 1108 (let ((base-rust rust-1.82))
1072 (package 1109 (package
1073 (inherit base-rust) 1110 (inherit base-rust)
1074 (properties (append 1111 (properties (append
@@ -1082,32 +1119,50 @@ safety and thread safety guarantees.")
1082 '(begin 1119 '(begin
1083 (for-each delete-file-recursively 1120 (for-each delete-file-recursively
1084 '("src/llvm-project" 1121 '("src/llvm-project"
1122 "vendor/jemalloc-sys-0.5.3+5.3.0-patched/jemalloc"
1085 "vendor/jemalloc-sys-0.5.4+5.3.0-patched/jemalloc" 1123 "vendor/jemalloc-sys-0.5.4+5.3.0-patched/jemalloc"
1124 "vendor/openssl-src-111.17.0+1.1.1m/openssl"
1086 "vendor/openssl-src-111.28.2+1.1.1w/openssl" 1125 "vendor/openssl-src-111.28.2+1.1.1w/openssl"
1087 "vendor/tikv-jemalloc-sys-0.5.4+5.3.0-patched/jemalloc" 1126 "vendor/tikv-jemalloc-sys-0.5.4+5.3.0-patched/jemalloc"
1088 ;; These are referenced by the cargo output 1127 ;; These are referenced by the cargo output
1089 ;; so we unbundle them. 1128 ;; so we unbundle them.
1090 "vendor/curl-sys-0.4.72+curl-8.6.0/curl" 1129 "vendor/curl-sys-0.4.52+curl-7.81.0/curl"
1130 "vendor/curl-sys-0.4.74+curl-8.9.0/curl"
1091 "vendor/libffi-sys-2.3.0/libffi" 1131 "vendor/libffi-sys-2.3.0/libffi"
1092 "vendor/libnghttp2-sys-0.1.9+1.58.0/nghttp2" 1132 "vendor/libz-sys-1.1.3/src/zlib"
1093 "vendor/libz-sys-1.1.16/src/zlib")) 1133 "vendor/libz-sys-1.1.18/src/zlib"
1134 "vendor/libz-sys-1.1.19/src/zlib"))
1094 ;; Use the packaged nghttp2 1135 ;; Use the packaged nghttp2
1095 (delete-file "vendor/libnghttp2-sys-0.1.9+1.58.0/build.rs") 1136 (for-each
1096 (with-output-to-file "vendor/libnghttp2-sys-0.1.9+1.58.0/build.rs" 1137 (lambda (ver)
1097 (lambda _ 1138 (let ((vendored-dir (format #f "vendor/libnghttp2-sys-~a/nghttp2" ver))
1098 (format #t "fn main() {~@ 1139 (build-rs (format #f "vendor/libnghttp2-sys-~a/build.rs" ver)))
1140 (delete-file-recursively vendored-dir)
1141 (delete-file build-rs)
1142 (with-output-to-file build-rs
1143 (lambda _
1144 (format #t "fn main() {~@
1099 println!(\"cargo:rustc-link-lib=nghttp2\");~@ 1145 println!(\"cargo:rustc-link-lib=nghttp2\");~@
1100 }~%"))) 1146 }~%")))))
1147 '("0.1.10+1.61.0"
1148 "0.1.7+1.45.0"))
1101 ;; Remove vendored dynamically linked libraries. 1149 ;; Remove vendored dynamically linked libraries.
1102 ;; find . -not -type d -executable -exec file {} \+ | grep ELF 1150 ;; find . -not -type d -executable -exec file {} \+ | grep ELF
1103 ;; Also remove the bundled (mostly Windows) libraries. 1151 ;; Also remove the bundled (mostly Windows) libraries.
1104 (for-each delete-file 1152 (for-each delete-file
1105 (find-files "vendor" "\\.(a|dll|exe|lib)$")) 1153 (find-files "vendor" "\\.(a|dll|exe|lib)$"))
1106 ;; Adjust vendored dependency to explicitly use rustix with libc backend. 1154 ;; Adjust vendored dependency to explicitly use rustix with libc backend.
1107 (substitute* '("vendor/tempfile-3.7.1/Cargo.toml" 1155 (for-each
1108 "vendor/tempfile-3.10.1/Cargo.toml") 1156 (lambda (ver)
1109 (("features = \\[\"fs\"" all) 1157 (let ((f (format #f "vendor/tempfile-~a/Cargo.toml" ver)))
1110 (string-append all ", \"use-libc\""))))))) 1158 (substitute* f
1159 (("features = \\[\"fs\"" all)
1160 (string-append all ", \"use-libc\"")))))
1161 '("3.3.0"
1162 "3.4.0"
1163 "3.7.1"
1164 "3.10.1"
1165 "3.12.0"))))))
1111 (arguments 1166 (arguments
1112 (substitute-keyword-arguments 1167 (substitute-keyword-arguments
1113 (strip-keyword-arguments '(#:tests?) 1168 (strip-keyword-arguments '(#:tests?)
@@ -1217,7 +1272,13 @@ safety and thread safety guarantees.")
1217 (lambda _ 1272 (lambda _
1218 (substitute* "src/tools/cargo/tests/testsuite/install.rs" 1273 (substitute* "src/tools/cargo/tests/testsuite/install.rs"
1219 ,@(make-ignore-test-list 1274 ,@(make-ignore-test-list
1220 '("fn install_global_cargo_config"))))) 1275 '("fn install_global_cargo_config")))
1276 (substitute* "src/tools/cargo/tests/testsuite/cargo_info/within_ws_with_alternative_registry/mod.rs"
1277 ,@(make-ignore-test-list
1278 '("fn case")))
1279 (substitute* "src/tools/cargo/tests/testsuite/package.rs"
1280 ,@(make-ignore-test-list
1281 '("fn workspace_with_local_deps_index_mismatch")))))
1221 (add-after 'unpack 'disable-miscellaneous-broken-tests 1282 (add-after 'unpack 'disable-miscellaneous-broken-tests
1222 (lambda _ 1283 (lambda _
1223 (substitute* "src/tools/cargo/tests/testsuite/check_cfg.rs" 1284 (substitute* "src/tools/cargo/tests/testsuite/check_cfg.rs"