unofficial mirror of guix-patches@gnu.org 
 help / color / mirror / code / Atom feed
From: brennan@umanwizard.com
To: 72821@debbugs.gnu.org
Cc: Brennan Vincent <brennan@umanwizard.com>, efraim@flashner.co.il
Subject: [bug#72821] [PATCH 1/4] gnu: rust: Update to 1.78
Date: Mon, 26 Aug 2024 13:40:54 -0400	[thread overview]
Message-ID: <20240826174057.1285361-1-brennan@umanwizard.com> (raw)
In-Reply-To: <20240826173836.1285159-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

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






  reply	other threads:[~2024-08-26 17:42 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-08-26 17:38 [bug#72821] [PATCH 0/4] Update to latest rust brennan
2024-08-26 17:40 ` brennan [this message]
2024-08-26 17:40   ` [bug#72821] [PATCH 2/4] gnu: rust: Update to 1.79 brennan
2024-08-26 17:40   ` [bug#72821] [PATCH 3/4] gnu: rust: Add rust 1.80.1 brennan
2024-08-26 17:40   ` [bug#72821] [PATCH 4/4] gnu: rust: update to 1.80 brennan
2024-09-17  9:56 ` bug#72821: [PATCH 0/4] Update to latest rust Efraim Flashner

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://guix.gnu.org/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20240826174057.1285361-1-brennan@umanwizard.com \
    --to=brennan@umanwizard.com \
    --cc=72821@debbugs.gnu.org \
    --cc=efraim@flashner.co.il \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/guix.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).