[PATCH 0/4] Update to latest rust

  • Done
  • quality assurance status badge
Details
2 participants
  • brennan
  • Efraim Flashner
Owner
unassigned
Submitted by
brennan
Severity
normal
B
B
brennan wrote on 26 Aug 19:38 +0200
(address . guix-patches@gnu.org)
20240826173836.1285159-1-brennan@umanwizard.com
From: Brennan Vincent <brennan@umanwizard.com>

This is broken into four separate patches: one adds rust 1.80,
while the other three each advance the main exported Rust
by one major version.

Brennan Vincent (4):
gnu: rust: Update to 1.78
gnu: rust: Update to 1.79
gnu: rust: Add rust 1.80.1
gnu: rust: update to 1.80

.../patches/rustc-unwinding-fix.patch | 29 ++++++
gnu/packages/rust.scm | 91 +++++++++++++++----
2 files changed, 101 insertions(+), 19 deletions(-)
create mode 100644 gnu/packages/patches/rustc-unwinding-fix.patch

--
2.45.2
B
B
brennan wrote on 26 Aug 19:40 +0200
[PATCH 1/4] gnu: rust: Update to 1.78
(address . 72821@debbugs.gnu.org)
20240826174057.1285361-1-brennan@umanwizard.com
From: Brennan Vincent <brennan@umanwizard.com>

* gnu/packages/rust.scm (rust): Update to 1.78

Change-Id: I7bf37a9321447ac21644af0e2d023b8bc556da59
---
.../patches/rustc-unwinding-fix.patch | 29 +++++++++++++++++++
gnu/packages/rust.scm | 23 +++++++++++----
2 files changed, 46 insertions(+), 6 deletions(-)
create mode 100644 gnu/packages/patches/rustc-unwinding-fix.patch

Toggle diff (102 lines)
diff --git a/gnu/packages/patches/rustc-unwinding-fix.patch b/gnu/packages/patches/rustc-unwinding-fix.patch
new file mode 100644
index 0000000000..8e98d6d7d9
--- /dev/null
+++ b/gnu/packages/patches/rustc-unwinding-fix.patch
@@ -0,0 +1,29 @@
+From ce49a9d9e52ca6062fe0894e72d954511fa8820f Mon Sep 17 00:00:00 2001
+From: Shmuel Hazan <ShmuelHazan0@gmail.com>
+Date: Sat, 1 Jun 2024 08:49:44 +0300
+Subject: [PATCH] Add UWTable attr to functions with a personality function
+
+Adding a personality function forces LLVM to generate unwinding info that might be incorrect.
+To solve it, always apply the UWTable attribute when setting a personality function.
+
+Fixes #123733
+---
+ compiler/rustc_codegen_llvm/src/builder.rs | 5 +++++
+ 1 file changed, 5 insertions(+)
+
+diff --git a/compiler/rustc_codegen_llvm/src/builder.rs b/compiler/rustc_codegen_llvm/src/builder.rs
+index 72ff9ea118e28..668f0a33a4e80 100644
+--- a/compiler/rustc_codegen_llvm/src/builder.rs
++++ b/compiler/rustc_codegen_llvm/src/builder.rs
+@@ -1029,6 +1029,11 @@ impl<'a, 'll, 'tcx> BuilderMethods<'a, 'tcx> for Builder<'a, 'll, 'tcx> {
+ }
+
+ fn set_personality_fn(&mut self, personality: &'ll Value) {
++ // Work around for https://github.com/rust-lang/rust/issues/123733
++ // add the UWTable attribute to every function with a personality function.
++ let uwtable = attributes::uwtable_attr(self.llcx, None);
++ attributes::apply_to_llfn(self.llfn(), llvm::AttributePlace::Function, &[uwtable]);
++
+ unsafe {
+ llvm::LLVMSetPersonalityFn(self.llfn(), personality);
+ }
diff --git a/gnu/packages/rust.scm b/gnu/packages/rust.scm
index 465899fe9d..9987d5569f 100644
--- a/gnu/packages/rust.scm
+++ b/gnu/packages/rust.scm
@@ -984,8 +984,15 @@ (define-public rust-1.77
"[build]\noptimized-compiler-builtins = false")))))))))))
(define-public rust-1.78
- (rust-bootstrapped-package
- rust-1.77 "1.78.0" "1afmj5g3bz7439w4i8zjhd68zvh0gqg7ymr8h5rz49ybllilhm7z"))
+ (let ((base-rust (rust-bootstrapped-package rust-1.77 "1.78.0"
+ "1afmj5g3bz7439w4i8zjhd68zvh0gqg7ymr8h5rz49ybllilhm7z")))
+ (package
+ (inherit base-rust)
+ (source
+ (origin
+ (inherit (package-source base-rust))
+ ;; see https://github.com/rust-lang/rust/pull/125844
+ (patches (search-patches "rustc-unwinding-fix.patch")))))))
(define-public rust-1.79
(let ((base-rust (rust-bootstrapped-package rust-1.78 "1.79.0"
@@ -1027,7 +1034,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.77))
+ (let ((base-rust rust-1.78))
(package
(inherit base-rust)
(properties (append
@@ -1047,11 +1054,10 @@ (define-public rust
;; These are referenced by the cargo output
;; so we unbundle them.
"vendor/curl-sys/curl"
- "vendor/curl-sys-0.4.63+curl-8.1.2/curl"
"vendor/libffi-sys/libffi"
"vendor/libnghttp2-sys/nghttp2"
"vendor/libz-sys/src/zlib"
- "vendor/libz-sys-1.1.9/src/zlib"))
+ "vendor/libz-sys-1.1.12/src/zlib"))
;; Use the packaged nghttp2
(delete-file "vendor/libnghttp2-sys/build.rs")
(with-output-to-file "vendor/libnghttp2-sys/build.rs"
@@ -1167,6 +1173,11 @@ (define-public rust
(substitute* "features2.rs"
,@(make-ignore-test-list
'("fn dep_with_optional_host_deps_activated"))))))
+ (add-after 'unpack 'disable-tests-requiring-crates.io
+ (lambda _
+ (substitute* "src/tools/cargo/tests/testsuite/install.rs"
+ ,@(make-ignore-test-list
+ '("fn install_global_cargo_config")))))
(add-after 'unpack 'patch-command-exec-tests
;; This test suite includes some tests that the stdlib's
;; `Command` execution properly handles in situations where
@@ -1225,7 +1236,7 @@ (define-public rust
((" = rpath.*" all)
(string-append all
" "
- "rustflags.arg(\"-Clink-args=-Wl,-rpath="
+ "self.rustflags.arg(\"-Clink-args=-Wl,-rpath="
out "/lib\");\n"))))))
(add-after 'configure 'add-gdb-to-config
(lambda* (#:key inputs #:allow-other-keys)
--
2.45.2
B
B
brennan wrote on 26 Aug 19:40 +0200
[PATCH 3/4] gnu: rust: Add rust 1.80.1
(address . 72821@debbugs.gnu.org)
20240826174057.1285361-3-brennan@umanwizard.com
From: Brennan Vincent <brennan@umanwizard.com>

gnu/packages/rust.scm (new variable): rust-1.80

Change-Id: Ie7dd276f7b4d606660557f3da42064b04dda1435
---
gnu/packages/rust.scm | 37 ++++++++++++++++++++++++++++++++++---
1 file changed, 34 insertions(+), 3 deletions(-)

Toggle diff (57 lines)
diff --git a/gnu/packages/rust.scm b/gnu/packages/rust.scm
index 403c3933d4..0d3a11b696 100644
--- a/gnu/packages/rust.scm
+++ b/gnu/packages/rust.scm
@@ -1020,6 +1020,33 @@ (define-public rust-1.79
(("features = \\[\"fs\"" all)
(string-append all ", \"use-libc\""))))))))))
+(define-public rust-1.80
+ (let ((base-rust (rust-bootstrapped-package rust-1.79 "1.80.1"
+ "1i1dbpwnv6ak244lapsxvd26w6sbas9g4l6crc8bip2275j8y2rc")))
+ (package
+ (inherit base-rust)
+ (source
+ (origin
+ (inherit (package-source base-rust))
+ (snippet
+ '(begin
+ (for-each delete-file-recursively
+ '("src/llvm-project"
+ "vendor/jemalloc-sys-0.5.3+5.3.0-patched/jemalloc"
+ "vendor/jemalloc-sys-0.5.4+5.3.0-patched/jemalloc"
+ "vendor/openssl-src-111.28.2+1.1.1w/openssl"
+ "vendor/tikv-jemalloc-sys-0.5.4+5.3.0-patched/jemalloc"))
+ ;; Remove vendored dynamically linked libraries.
+ ;; find . -not -type d -executable -exec file {} \+ | grep ELF
+ ;; Also remove the bundled (mostly Windows) libraries.
+ (for-each delete-file
+ (find-files "vendor" "\\.(a|dll|exe|lib)$"))
+ ;; Adjust vendored dependency to explicitly use rustix with libc backend.
+ (substitute* '("vendor/tempfile-3.7.1/Cargo.toml"
+ "vendor/tempfile-3.10.1/Cargo.toml")
+ (("features = \\[\"fs\"" all)
+ (string-append all ", \"use-libc\""))))))))))
+
(define (make-ignore-test-list strs)
"Function to make creating a list to ignore tests a bit easier."
(map (lambda (str)
@@ -1070,9 +1097,13 @@ (define-public rust
(for-each delete-file
(find-files "vendor" "\\.(a|dll|exe|lib)$"))
;; Adjust vendored dependency to explicitly use rustix with libc backend.
- (substitute* "vendor/tempfile/Cargo.toml"
- (("features = \\[\"fs\"" all)
- (string-append all ", \"use-libc\"")))))))
+ (for-each
+ (lambda (f)
+ (substitute* f
+ (("features = \\[\"fs\"" all)
+ (string-append all ", \"use-libc\""))))
+ '("vendor/tempfile-3.10.1/Cargo.toml"
+ "vendor/tempfile-3.7.1/Cargo.toml"))))))
(arguments
(substitute-keyword-arguments
(strip-keyword-arguments '(#:tests?)
--
2.45.2
B
B
brennan wrote on 26 Aug 19:40 +0200
[PATCH 2/4] gnu: rust: Update to 1.79
(address . 72821@debbugs.gnu.org)
20240826174057.1285361-2-brennan@umanwizard.com
From: Brennan Vincent <brennan@umanwizard.com>

* gnu/packages/rust.scm (rust): Update to 1.79

Change-Id: Ic43b4c540413a0e1a08d46cca5a092badc221753
---
gnu/packages/rust.scm | 26 ++++++++++++++------------
1 file changed, 14 insertions(+), 12 deletions(-)

Toggle diff (56 lines)
diff --git a/gnu/packages/rust.scm b/gnu/packages/rust.scm
index 9987d5569f..403c3933d4 100644
--- a/gnu/packages/rust.scm
+++ b/gnu/packages/rust.scm
@@ -1034,7 +1034,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.78))
+ (let ((base-rust rust-1.79))
(package
(inherit base-rust)
(properties (append
@@ -1048,19 +1048,18 @@ (define-public rust
'(begin
(for-each delete-file-recursively
'("src/llvm-project"
- "vendor/jemalloc-sys/jemalloc"
- "vendor/openssl-src/openssl"
- "vendor/tikv-jemalloc-sys/jemalloc"
+ "vendor/jemalloc-sys-0.5.4+5.3.0-patched/jemalloc"
+ "vendor/openssl-src-111.28.1+1.1.1w/openssl"
+ "vendor/tikv-jemalloc-sys-0.5.4+5.3.0-patched/jemalloc"
;; These are referenced by the cargo output
;; so we unbundle them.
- "vendor/curl-sys/curl"
- "vendor/libffi-sys/libffi"
- "vendor/libnghttp2-sys/nghttp2"
- "vendor/libz-sys/src/zlib"
- "vendor/libz-sys-1.1.12/src/zlib"))
+ "vendor/curl-sys-0.4.72+curl-8.6.0/curl"
+ "vendor/libffi-sys-2.3.0/libffi"
+ "vendor/libnghttp2-sys-0.1.9+1.58.0/nghttp2"
+ "vendor/libz-sys-1.1.16/src/zlib"))
;; Use the packaged nghttp2
- (delete-file "vendor/libnghttp2-sys/build.rs")
- (with-output-to-file "vendor/libnghttp2-sys/build.rs"
+ (delete-file "vendor/libnghttp2-sys-0.1.9+1.58.0/build.rs")
+ (with-output-to-file "vendor/libnghttp2-sys-0.1.9+1.58.0/build.rs"
(lambda _
(format #t "fn main() {~@
println!(\"cargo:rustc-link-lib=nghttp2\");~@
@@ -1098,7 +1097,10 @@ (define-public rust
(lambda _
(substitute* "src/tools/cargo/tests/testsuite/git.rs"
,@(make-ignore-test-list
- '("fn fetch_downloads_with_git2_first_")))))
+ '("fn fetch_downloads_with_git2_first_")))
+ (substitute* "src/tools/cargo/tests/testsuite/build.rs"
+ ,@(make-ignore-test-list
+ '("fn build_with_symlink_to_path_dependency_with_build_script_in_git")))))
(add-after 'unpack 'disable-tests-requiring-mercurial
(lambda _
(with-directory-excursion "src/tools/cargo/tests/testsuite/cargo_init"
--
2.45.2
B
B
brennan wrote on 26 Aug 19:40 +0200
[PATCH 4/4] gnu: rust: update to 1.80
(address . 72821@debbugs.gnu.org)
20240826174057.1285361-4-brennan@umanwizard.com
From: Brennan Vincent <brennan@umanwizard.com>

gnu/packages/rust.scm (rust): update to 1.80.

Change-Id: Ife65cb52362a30df8aabd4255a3fdc3c3d60e7bb
---
gnu/packages/rust.scm | 13 +++++++++++--
1 file changed, 11 insertions(+), 2 deletions(-)

Toggle diff (40 lines)
diff --git a/gnu/packages/rust.scm b/gnu/packages/rust.scm
index 0d3a11b696..f73dad2f00 100644
--- a/gnu/packages/rust.scm
+++ b/gnu/packages/rust.scm
@@ -1061,7 +1061,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.79))
+ (let ((base-rust rust-1.80))
(package
(inherit base-rust)
(properties (append
@@ -1076,7 +1076,7 @@ (define-public rust
(for-each delete-file-recursively
'("src/llvm-project"
"vendor/jemalloc-sys-0.5.4+5.3.0-patched/jemalloc"
- "vendor/openssl-src-111.28.1+1.1.1w/openssl"
+ "vendor/openssl-src-111.28.2+1.1.1w/openssl"
"vendor/tikv-jemalloc-sys-0.5.4+5.3.0-patched/jemalloc"
;; These are referenced by the cargo output
;; so we unbundle them.
@@ -1211,6 +1211,15 @@ (define-public rust
(substitute* "src/tools/cargo/tests/testsuite/install.rs"
,@(make-ignore-test-list
'("fn install_global_cargo_config")))))
+ (add-after 'unpack 'disable-miscellaneous-broken-tests
+ (lambda _
+ (substitute* "src/tools/cargo/tests/testsuite/check_cfg.rs"
+ ;; These apparently get confused by the fact that
+ ;; we're building in a directory containing the
+ ;; string "rustc"
+ ,@(make-ignore-test-list
+ '("fn config_fingerprint"
+ "fn features_fingerprint")))))
(add-after 'unpack 'patch-command-exec-tests
;; This test suite includes some tests that the stdlib's
;; `Command` execution properly handles in situations where
--
2.45.2
E
E
Efraim Flashner wrote on 17 Sep 11:56 +0200
Re: [PATCH 0/4] Update to latest rust
(address . brennan@umanwizard.com)(address . 72821-done@debbugs.gnu.org)
ZulSQ1UChzw_ECtc@3900XT
On Mon, Aug 26, 2024 at 01:38:36PM -0400, brennan@umanwizard.com wrote:
Toggle quote (20 lines)
> From: Brennan Vincent <brennan@umanwizard.com>
>
> This is broken into four separate patches: one adds rust 1.80,
> while the other three each advance the main exported Rust
> by one major version.
>
> Brennan Vincent (4):
> gnu: rust: Update to 1.78
> gnu: rust: Update to 1.79
> gnu: rust: Add rust 1.80.1
> gnu: rust: update to 1.80
>
> .../patches/rustc-unwinding-fix.patch | 29 ++++++
> gnu/packages/rust.scm | 91 +++++++++++++++----
> 2 files changed, 101 insertions(+), 19 deletions(-)
> create mode 100644 gnu/packages/patches/rustc-unwinding-fix.patch
>
> --
> 2.45.2

Thanks. Patches pushed to the rust-team branch.

--
Efraim Flashner <efraim@flashner.co.il> ????? ?????
GPG key = A28B F40C 3E55 1372 662D 14F7 41AA E7DC CA3D 8351
Confidentiality cannot be guaranteed on emails sent or received unencrypted
-----BEGIN PGP SIGNATURE-----

iQIzBAABCAAdFiEEoov0DD5VE3JmLRT3Qarn3Mo9g1EFAmbpUkMACgkQQarn3Mo9
g1Gcrg//V2dniFwjVL8vsDEDzOUyW/pnbENri4HEz2D7vvhCoSbemquuURK1RAAl
1F+icIlbq+Qt0vLro/8tSZ0g+b4nQRIxVg/gLVqHBxae15RClMEU4FiMiHL0Bd9g
WUDkeqx7lpkVh8g0PIf/v+wXtnBIRlLp01hQI+i16oG533TaO9w52/eBqlB0RjvN
NywVku3Rl7Gh1pap9RYRqdq+7a+NQemk72SQ3rER/ZD0VktyI9wpJb8TYrJe+dRQ
+fDrFY6ND6h/CSMfww7r76Gky/NUcErXa6pj5nFKgg8qQfVNA1HPoZqd8qkB6Goz
DwvHI4U0uHUKl66fpgu11UDFiz34FNr8V9NTDfxJYqoPog9hnKePW/K/gHiiK373
LLnnTLg8TGhjszeFfudvHW76/2JSthVbJWViE4EJjbvqNDGHC8CpAZGMCvzJvjdf
4nBT+sAnVTst4mXuQQqTh2pn8VhXF0iDrEHnAnrmMSCnP0pBQlA82x6dwLPxyfB0
ehLK+PGurNBdoaRO3hzNooC+IvYRME/dE/ZqdxyJ5eaMwvjwzhy7nTyBc9TIzyHK
rfqg3msL4bd6QAKBisFgTcNAuUwG6lqtk3WKi6+bCBsEZzKAX2FdIiB0K7+rcQ1x
1fdXIEw6JCyt5wlny34xPrlKxoM8+mYMsDpvpmeno+bZjdMDOe4=
=R53R
-----END PGP SIGNATURE-----


Closed
?
Your comment

This issue is archived.

To comment on this conversation send an email to 72821@debbugs.gnu.org

To respond to this issue using the mumi CLI, first switch to it
mumi current 72821
Then, you may apply the latest patchset in this issue (with sign off)
mumi am -- -s
Or, compose a reply to this issue
mumi compose
Or, send patches to this issue
mumi send-email *.patch