From patchwork Sun Oct 27 20:04:48 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Brennan Vincent X-Patchwork-Id: 69566 Return-Path: X-Original-To: patchwork@mira.cbaines.net Delivered-To: patchwork@mira.cbaines.net Received: by mira.cbaines.net (Postfix, from userid 113) id 852A827BBEA; Sun, 27 Oct 2024 20:06:08 +0000 (GMT) X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on mira.cbaines.net X-Spam-Level: X-Spam-Status: No, score=-7.6 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,MAILING_LIST_MULTI,RCVD_IN_DNSWL_BLOCKED, RCVD_IN_VALIDITY_CERTIFIED,RCVD_IN_VALIDITY_RPBL,RCVD_IN_VALIDITY_SAFE, SPF_HELO_PASS autolearn=ham autolearn_force=no version=3.4.6 Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mira.cbaines.net (Postfix) with ESMTPS id 0305B27BBE2 for ; Sun, 27 Oct 2024 20:06:05 +0000 (GMT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1t59W0-0007po-Cy; Sun, 27 Oct 2024 16:05:32 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1t59Vv-0007pD-RO for guix-patches@gnu.org; Sun, 27 Oct 2024 16:05:28 -0400 Received: from debbugs.gnu.org ([2001:470:142:5::43]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1t59Vv-0001Sh-Iv for guix-patches@gnu.org; Sun, 27 Oct 2024 16:05:27 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=debbugs.gnu.org; s=debbugs-gnu-org; h=MIME-Version:Date:References:In-Reply-To:From:To:Subject; bh=4zli4F7Bm31g/rrr14XXDNElRX29mFcMIxh1xzsXzko=; b=rjt6h/2UVmuYjDvw+fzobCDnIhGWqFhcC2J6QIrzJlO2vSFL9ETmO+7Mrk1cuBv1NWFiAg4K9CuEjuS2Kjt3E78BlAJM5KCbrPbkL2VCw2+cXjyZ1/CqoAueE4NcLzI3oltodw9MeNHiQbyAKV6au0w9Cnb3kvgtTqkkTV7T01jsIJcHgojSTHwUl9cT8IH0rTQoiX6lcE+ApM690JuWV0Alw8OL16IIj5rnQmJyYsU3mIwa8lokxev98kQzyXMxrsXK30mImAKZLF7fNCZgB9qaee1zyyGN3JiYhgig2QgghHyoAx2miPK/N8A8d44cpK+JAxgd1G8HiN//X25lKA==; Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1t59WU-0008QE-Lg for guix-patches@gnu.org; Sun, 27 Oct 2024 16:06:02 -0400 X-Loop: help-debbugs@gnu.org Subject: [bug#73864] Acknowledgement ([PATCH] gnu: rust: update to 1.82) Resent-From: "Brennan Vincent" Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Sun, 27 Oct 2024 20:06:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 73864 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: 73864@debbugs.gnu.org Cc: efraim@flashner.co.il Received: via spool by 73864-submit@debbugs.gnu.org id=B73864.173005954032063 (code B ref 73864); Sun, 27 Oct 2024 20:06:02 +0000 Received: (at 73864) by debbugs.gnu.org; 27 Oct 2024 20:05:40 +0000 Received: from localhost ([127.0.0.1]:46460 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1t59W5-0008Jr-G2 for submit@debbugs.gnu.org; Sun, 27 Oct 2024 16:05:40 -0400 Received: from smtp.umanwizard.com ([54.203.248.109]:46865) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1t59W0-0008JR-B2 for 73864@debbugs.gnu.org; Sun, 27 Oct 2024 16:05:36 -0400 Received: from localhost ([108.6.22.48]) by smtp.umanwizard.com ; 27 Oct 2024 20:04:50 +0000 X-Fes-Received-For: 73864@debbugs.gnu.org X-Fes-Received-From: From: "Brennan Vincent" In-Reply-To: References: <871q0da1lv.fsf@denver.mail-host-address-is-not-set> Date: Sun, 27 Oct 2024 16:04:48 -0400 Message-ID: <878qu9qplr.fsf@denver.mail-host-address-is-not-set> MIME-Version: 1.0 X-Fes-Encrypted: true X-Fes-Ehlo-Domain: localhost X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: guix-patches@gnu.org List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guix-patches-bounces+patchwork=mira.cbaines.net@gnu.org Sender: guix-patches-bounces+patchwork=mira.cbaines.net@gnu.org X-getmail-retrieved-from-mailbox: Patches v2 of the patch (attached) fixes 1.81 -> 1.82 bootstrap on riscv64 Efraim: I've performed the following tests, all of which are working fine. * Build `rust` on x86-64 * Build `rust` on aarch64 * Build `rust` on riscv64 * Build `zoxide` on all three platforms * Cross-build `zoxide` from x86-64 to the other two platforms Let me know if I can help further by performing any other tests. Note that I have access to quite fast x86 and aarch64 machines. But doing anything on riscv64 takes forever (I only have access to an emulated machine). help-debbugs@gnu.org (GNU bug Tracking System) writes: > Thank you for filing a new bug report with debbugs.gnu.org. > > This is an automatically generated reply to let you know your message > has been received. > > Your message is being forwarded to the package maintainers and other > interested parties for their attention; they will reply in due course. > > Your message has been sent to the package maintainer(s): > guix-patches@gnu.org > > If you wish to submit further information on this problem, please > send it to 73864@debbugs.gnu.org. > > Please do not send mail to help-debbugs@gnu.org unless you wish > to report a problem with the Bug-tracking system. > > -- > 73864: https://debbugs.gnu.org/cgi/bugreport.cgi?bug=73864 > GNU Bug Tracking System > Contact help-debbugs@gnu.org with problems From 9795a513a8555df6f6d94d5089318f39f20f832f Mon Sep 17 00:00:00 2001 Message-ID: <9795a513a8555df6f6d94d5089318f39f20f832f.1730059086.git.brennan@umanwizard.com> From: Brennan Vincent Date: Fri, 18 Oct 2024 11:10:20 -0400 Subject: [PATCH v2] gnu: rust: update to 1.82 gnu/packages/rust.scm (rust-1.81): Fix bootstrap of 1.82 on riscv64. gnu/packages/rust.scm (new variable): rust-1.82. gnu/packages/rust.scm (rust): update to 1.82. Change-Id: If6ff59011edca7a230946a3ba77b51f26cd47789 --- .../rust-1.81-fix-riscv64-bootstrap.patch | 40 ++++++++ gnu/packages/rust.scm | 94 +++++++++++++++---- 2 files changed, 118 insertions(+), 16 deletions(-) create mode 100644 gnu/packages/patches/rust-1.81-fix-riscv64-bootstrap.patch 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 0000000000..39a79a9628 --- /dev/null +++ b/gnu/packages/patches/rust-1.81-fix-riscv64-bootstrap.patch @@ -0,0 +1,40 @@ +From 99e6a28804eac57faa37134d61a2bb17069996a2 Mon Sep 17 00:00:00 2001 +From: Nicholas Bishop +Date: Thu, 30 May 2024 18:32:46 -0400 +Subject: [PATCH] Add f16/f128 handling in a couple places + +--- + compiler/rustc_codegen_llvm/src/abi.rs | 2 ++ + compiler/rustc_target/src/abi/call/mod.rs | 2 ++ + 2 files changed, 4 insertions(+) + +diff --git a/compiler/rustc_codegen_llvm/src/abi.rs b/compiler/rustc_codegen_llvm/src/abi.rs +index a6a3f0f964611..2e52d3f426a83 100644 +--- a/compiler/rustc_codegen_llvm/src/abi.rs ++++ b/compiler/rustc_codegen_llvm/src/abi.rs +@@ -121,8 +121,10 @@ impl LlvmType for Reg { + match self.kind { + RegKind::Integer => cx.type_ix(self.size.bits()), + RegKind::Float => match self.size.bits() { ++ 16 => cx.type_f16(), + 32 => cx.type_f32(), + 64 => cx.type_f64(), ++ 128 => cx.type_f128(), + _ => bug!("unsupported float: {:?}", self), + }, + RegKind::Vector => cx.type_vector(cx.type_i8(), self.size.bytes()), +diff --git a/compiler/rustc_target/src/abi/call/mod.rs b/compiler/rustc_target/src/abi/call/mod.rs +index fc79c9232d1bd..f83d0492004a2 100644 +--- a/compiler/rustc_target/src/abi/call/mod.rs ++++ b/compiler/rustc_target/src/abi/call/mod.rs +@@ -236,8 +236,10 @@ impl Reg { + _ => panic!("unsupported integer: {self:?}"), + }, + RegKind::Float => match self.size.bits() { ++ 16 => dl.f16_align.abi, + 32 => dl.f32_align.abi, + 64 => dl.f64_align.abi, ++ 128 => dl.f128_align.abi, + _ => panic!("unsupported float: {self:?}"), + }, + RegKind::Vector => dl.vector_align(self.size).abi, diff --git a/gnu/packages/rust.scm b/gnu/packages/rust.scm index 7f85402242..4fe529c5b4 100644 --- a/gnu/packages/rust.scm +++ b/gnu/packages/rust.scm @@ -1051,8 +1051,46 @@ (define-public rust-1.80 (string-append all ", \"use-libc\"")))))))))) (define-public rust-1.81 - (rust-bootstrapped-package rust-1.80 "1.81.0" - "19yggj1qivdhf68gx2652cfi7nxjkdgy39wh7h6facpzppz4h947")) + (let ((base-rust (rust-bootstrapped-package rust-1.80 "1.81.0" + "19yggj1qivdhf68gx2652cfi7nxjkdgy39wh7h6facpzppz4h947"))) + (package + (inherit base-rust) + (source + (origin + (inherit (package-source base-rust)) + ;; see https://github.com/rust-lang/rust/issues/129268#issuecomment-2430133779 + (patches (search-patches "rust-1.81-fix-riscv64-bootstrap.patch"))))))) + +(define-public rust-1.82 + (let ((base-rust (rust-bootstrapped-package rust-1.81 "1.82.0" + "0ajiryki2aqsg3ydx3nfhrb5i1mmxvasfszs9qblw66skr8g8lvw"))) + (package + (inherit base-rust) + (arguments + (substitute-keyword-arguments (package-arguments base-rust) + ((#:phases phases) + `(modify-phases ,phases + (replace 'patch-cargo-checksums + (lambda _ + (substitute* (cons* "Cargo.lock" + "src/bootstrap/Cargo.lock" + "library/Cargo.lock" + (filter + ;; don't mess with the + ;; lock files in the Cargo testsuite; it + ;; messes up the tests. + (lambda (path) + (not + (string-contains path "cargo/tests/testsuite"))) + (find-files "src/tools" "Cargo.lock"))) + (("(checksum = )\".*\"" all name) + (string-append name "\"" ,%cargo-reference-hash "\""))) + (generate-all-checksums "vendor"))))))) + (source + (origin + (inherit (package-source base-rust)) + (patches '())))))) + (define (make-ignore-test-list strs) "Function to make creating a list to ignore tests a bit easier." @@ -1068,7 +1106,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.81)) + (let ((base-rust rust-1.82)) (package (inherit base-rust) (properties (append @@ -1082,32 +1120,50 @@ (define-public rust '(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.17.0+1.1.1m/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. - "vendor/curl-sys-0.4.72+curl-8.6.0/curl" + "vendor/curl-sys-0.4.52+curl-7.81.0/curl" + "vendor/curl-sys-0.4.74+curl-8.9.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")) + "vendor/libz-sys-1.1.3/src/zlib" + "vendor/libz-sys-1.1.18/src/zlib" + "vendor/libz-sys-1.1.19/src/zlib")) ;; Use the packaged nghttp2 - (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() {~@ + (for-each + (lambda (ver) + (let ((vendored-dir (format #f "vendor/libnghttp2-sys-~a/nghttp2" ver)) + (build-rs (format #f "vendor/libnghttp2-sys-~a/build.rs" ver))) + (delete-file-recursively vendored-dir) + (delete-file build-rs) + (with-output-to-file build-rs + (lambda _ + (format #t "fn main() {~@ println!(\"cargo:rustc-link-lib=nghttp2\");~@ - }~%"))) + }~%"))))) + '("0.1.10+1.61.0" + "0.1.7+1.45.0")) ;; 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\""))))))) + (for-each + (lambda (ver) + (let ((f (format #f "vendor/tempfile-~a/Cargo.toml" ver))) + (substitute* f + (("features = \\[\"fs\"" all) + (string-append all ", \"use-libc\""))))) + '("3.3.0" + "3.4.0" + "3.7.1" + "3.10.1" + "3.12.0")))))) (arguments (substitute-keyword-arguments (strip-keyword-arguments '(#:tests?) @@ -1217,7 +1273,13 @@ (define-public rust (lambda _ (substitute* "src/tools/cargo/tests/testsuite/install.rs" ,@(make-ignore-test-list - '("fn install_global_cargo_config"))))) + '("fn install_global_cargo_config"))) + (substitute* "src/tools/cargo/tests/testsuite/cargo_info/within_ws_with_alternative_registry/mod.rs" + ,@(make-ignore-test-list + '("fn case"))) + (substitute* "src/tools/cargo/tests/testsuite/package.rs" + ,@(make-ignore-test-list + '("fn workspace_with_local_deps_index_mismatch"))))) (add-after 'unpack 'disable-miscellaneous-broken-tests (lambda _ (substitute* "src/tools/cargo/tests/testsuite/check_cfg.rs" base-commit: 14a0c80510da486fbe825f7d71544e309d482a65 -- 2.46.0