From patchwork Mon Apr 7 20:07:46 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Morgan Smith X-Patchwork-Id: 41415 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 E7BEA27BC4F; Mon, 7 Apr 2025 21:09:32 +0100 (BST) X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on mira.cbaines.net X-Spam-Level: X-Spam-Status: No, score=-6.4 required=5.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED,FREEMAIL_FROM,MAILING_LIST_MULTI,RCVD_IN_DNSWL_BLOCKED, RCVD_IN_VALIDITY_CERTIFIED,RCVD_IN_VALIDITY_RPBL,RCVD_IN_VALIDITY_SAFE, SPF_HELO_PASS,URIBL_BLOCKED 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 4C38B27BC49 for ; Mon, 7 Apr 2025 21:09:30 +0100 (BST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1u1smH-0006I5-Hg; Mon, 07 Apr 2025 16:09:05 -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 1u1smG-0006Hf-0w for guix-patches@gnu.org; Mon, 07 Apr 2025 16:09:04 -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 1u1smF-0007uA-Mv for guix-patches@gnu.org; Mon, 07 Apr 2025 16:09:03 -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:References:In-Reply-To:Date:From:To:Subject; bh=hcAFnS5AVFstcHI+mjlFGbEwl754NCH7UkOPB7XeSfs=; b=PPGD2DKgjDHxCN9HCLLLk9lBwP2p6MXY5od3bSIfMtbKoCF+nrW5ID4SMC7Jo6gjMwctsvZAFRPyeyklA7zVYrtN+jJTJa5zT+Q03tiQhbg67f4FXoZzgvbSpv8xmfKttWZ7Cu/9uM74leM7TA/wyEgVpCEfQLo8EWvRvfv6NcBrRmPR64zFsin6wu6qSEE2jEWZ/OwiIeqPeQQxIWuSehLo1FKZ7+kHWPjHnffdNje+X+EkmZroCiiR0HzmCt0nhcwi+S8ES/E/Nums9x+j4NCnTY6peB/mY+F4WVmNT6VUoOxk3wsULSqkglZHGOrmJaAz3gRn264eOmrSRBV32g==; Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1u1smE-00043N-Et; Mon, 07 Apr 2025 16:09:02 -0400 X-Loop: help-debbugs@gnu.org Subject: [bug#77616] [PATCH 2/6] gnu: rust-bootstrap: Update to 1.74.0. Resent-From: Morgan Smith Original-Sender: "Debbugs-submit" Resent-CC: divya@subvertising.org, efraim@flashner.co.il, steve@futurile.net, guix-patches@gnu.org Resent-Date: Mon, 07 Apr 2025 20:09:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 77616 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: 77616@debbugs.gnu.org Cc: Morgan Smith , Divya Ranjan Pattanaik , Efraim Flashner , Steve George X-Debbugs-Original-Xcc: Divya Ranjan Pattanaik , Efraim Flashner , Steve George Received: via spool by 77616-submit@debbugs.gnu.org id=B77616.174405650115387 (code B ref 77616); Mon, 07 Apr 2025 20:09:02 +0000 Received: (at 77616) by debbugs.gnu.org; 7 Apr 2025 20:08:21 +0000 Received: from localhost ([127.0.0.1]:57035 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1u1slY-0003zs-7M for submit@debbugs.gnu.org; Mon, 07 Apr 2025 16:08:21 -0400 Received: from mail-dm6nam12olkn20817.outbound.protection.outlook.com ([2a01:111:f403:2c17::817]:25953 helo=NAM12-DM6-obe.outbound.protection.outlook.com) by debbugs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.84_2) (envelope-from ) id 1u1slT-0003z0-5G for 77616@debbugs.gnu.org; Mon, 07 Apr 2025 16:08:19 -0400 ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=hMymr5cLoehsx6J0uM1+d+ZeQF8NBx4YkYBPVWFk+/kowpdwI8HITi66RkEs8PTTZm02j10+riI4tl7cz3HkIfy21t329YzfGVtBSP6CHa4gDsp29/Lvzk2cZMZ0ZuxuB9DAQvaaCZ4HicTDncoX9nL6R/ZY9X4Ckk2fP10JxIh3MjlQxe1JtUp+WwoB+Jp3gDFkk8alpk4EEbtxxm/fWH+U7DPY9AT2MGYchJDTRqLtyG2md2Y34mBpA7MprxABvXV7KWlcARJXmUvkYdvRH/EmcNagKkZpbJyrlyf9SsQdoTm2ZR+OvvaoTWaSS2PC6KSwcVvN9siai3wj7fo/UA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector10001; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=hcAFnS5AVFstcHI+mjlFGbEwl754NCH7UkOPB7XeSfs=; b=isPkMLE+WnYDNszVxA9kjhi5keFLDJ8yYu15HFiTAtRTthVCDBrv6awEEkyddKd6QejPd5b8VDVNXErPSLaZ/LxP04FKAhMonUGCFyqTW3nsSTLh9er4y14XH+H7zRhA9nsrLt7PON/ezzUmrKkE9ZxFI+HZCcC7YMuhW3zIrz1N4RquMLuE7pvbJ8aMjLisds5C/ssr82+qij1kkbPRt1VwpcyVz97gcH+ZcJ/bWAHM7teAjT9sKx8dQuh73aCLdS1ksnDza6x4uEycHjjJG9mfJeAbWusQQqUyR5I+t+iAOP0mK7WzIhBNGxqn/sFIQ+TdE88wxs+rlqCGy12+Mw== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=none; dmarc=none; dkim=none; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=outlook.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=hcAFnS5AVFstcHI+mjlFGbEwl754NCH7UkOPB7XeSfs=; b=GoAARhG3AXW9F5cggIDuaydDk9GRFYTKQBA5k1B6foh9X4rMVG/YDn1IbquvcEtMA7eK+sc3DhyJObkppyI31TtRyJF7Y8AtEzNNRKD+YaovT7EXj1huLNXfZWWK9na7OkbULLjjeN5YCCVmwn5ki38l8+EVkmOqCrCu8/RuRggW9F2DPUZP2/chzZ5jtNJboG4Prt1NosSSL9u1NO9OxRReyHQAvntvAxZrHCCnLLOks9R0kZcWgHOtqikwCGxt/KosfF2NhSuxbzDz0VmxD4IX2mwR9OUjAQlC4veC0VyxmxRohbi+GrfH1RznEqFnh42sHgojEeapJHmD9VbX0w== Received: from CH3PR84MB3424.NAMPRD84.PROD.OUTLOOK.COM (2603:10b6:610:1c4::17) by DS0PR84MB3589.NAMPRD84.PROD.OUTLOOK.COM (2603:10b6:8:1b8::16) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.8606.31; Mon, 7 Apr 2025 20:08:10 +0000 Received: from CH3PR84MB3424.NAMPRD84.PROD.OUTLOOK.COM ([fe80::5c77:7a58:48ed:9aef]) by CH3PR84MB3424.NAMPRD84.PROD.OUTLOOK.COM ([fe80::5c77:7a58:48ed:9aef%5]) with mapi id 15.20.8606.033; Mon, 7 Apr 2025 20:08:10 +0000 From: Morgan Smith Date: Mon, 7 Apr 2025 16:07:46 -0400 Message-ID: X-Mailer: git-send-email 2.49.0 In-Reply-To: <2141283854b61187d507f0dfaf768e3416e09845.1744056453.git.Morgan.J.Smith@outlook.com> References: <2141283854b61187d507f0dfaf768e3416e09845.1744056453.git.Morgan.J.Smith@outlook.com> X-ClientProxiedBy: YQZPR01CA0108.CANPRD01.PROD.OUTLOOK.COM (2603:10b6:c01:83::14) To CH3PR84MB3424.NAMPRD84.PROD.OUTLOOK.COM (2603:10b6:610:1c4::17) X-Microsoft-Original-Message-ID: MIME-Version: 1.0 X-MS-Exchange-MessageSentRepresentingType: 1 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: CH3PR84MB3424:EE_|DS0PR84MB3589:EE_ X-MS-Office365-Filtering-Correlation-Id: 19e10efc-f1fe-41db-443c-08dd760feb19 X-Microsoft-Antispam: BCL:0; ARA:14566002|461199028|8060799006|15080799006|7092599003|19110799003|5072599009|21061999003|12071999003|41001999003|10035399004|440099028|3412199025|1710799026; X-Microsoft-Antispam-Message-Info: QxYgrDjjWCQ2HrayaHvfCQYXHiKiw5S6sMOPMDchDZ6mp9//ScvXaYcHrsqRvBFkD1uvj8kNsxe1DfrlvVAJs3VYlLmYW+hLOgbaCw/ihCxt+sNFXIZhJnjd93PEaJwYG48lQtshRESdfXWeutzE4OljyoBs3BhYP1bs+SyaWmQLOUtBTWUrT3C0yn/h3zqDICRtS2s1p7AksRLMh0JSd4GCe6eYzjlaVltuXHgB8zp14RDs2tMfOOkQwnnZ1/N5srgrPxA7kPExKI5LRg0PGZ76tXadDc1tTT1LOrV46MM+o/u4cwGcxK1g0j1+OU3kBqLjQp34cNc1S+OmNwMoW7BQ1LeLhTsj0ywR3lo2ZoM7U/QHPj1ydd0aIbAW3o090XnMaS4rHKyX78En2x+WaktaiKaCDuT8RF7WoEXgs+c3thSodRy9sYpUEbcYeJgHhv6r6iw2ev8rHXwBCWXqpL2ffRjX//C5TcCY/rhz93L++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6HfuMshFovtKFWzylbfnZ9jictV+13wJ X-OriginatorOrg: outlook.com X-MS-Exchange-CrossTenant-Network-Message-Id: 19e10efc-f1fe-41db-443c-08dd760feb19 X-MS-Exchange-CrossTenant-AuthSource: CH3PR84MB3424.NAMPRD84.PROD.OUTLOOK.COM X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 07 Apr 2025 20:08:09.9391 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 84df9e7f-e9f6-40af-b435-aaaaaaaaaaaa X-MS-Exchange-CrossTenant-RMS-PersistedConsumerOrg: 00000000-0000-0000-0000-000000000000 X-MS-Exchange-Transport-CrossTenantHeadersStamped: DS0PR84MB3589 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 * gnu/packages/rust.scm(rust-bootstrap): Update to 1.74.0. Use gexps. Change-Id: Id88e200015ed6ab246407e37eeb4159cb4df195d --- gnu/packages/rust.scm | 261 +++++++++++++++++++++--------------------- 1 file changed, 132 insertions(+), 129 deletions(-) diff --git a/gnu/packages/rust.scm b/gnu/packages/rust.scm index 3200f59abd..66703abc35 100644 --- a/gnu/packages/rust.scm +++ b/gnu/packages/rust.scm @@ -154,17 +154,17 @@ (define %mrustc-source (substitute* "minicargo.mk" (("--features vendored-openssl") ""))))))) -;;; Rust 1.54 is special in that it is built with mrustc, which shortens the +;;; Rust 1.74 is special in that it is built with mrustc, which shortens the ;;; bootstrap path. (define-public rust-bootstrap (package (name "rust") - (version "1.54.0") + (version "1.74.0") (source (origin (method url-fetch) (uri (rust-uri version)) - (sha256 (base32 "0xk9dhfff16caambmwij67zgshd8v9djw6ha0fnnanlv7rii31dc")) + (sha256 (base32 "0j8hrwjjjjf7spy0hy7gami96swhfzr6kandfzzdri91qd5mhaw8")) (modules '((guix build utils))) (snippet '(begin @@ -174,17 +174,19 @@ (define-public rust-bootstrap "vendor/tikv-jemalloc-sys/jemalloc")) ;; Remove vendored dynamically linked libraries. ;; find . -not -type d -executable -exec file {} \+ | grep ELF - (delete-file "vendor/vte/vim10m_match") - (delete-file "vendor/vte/vim10m_table") ;; Also remove the bundled (mostly Windows) libraries. - ;; find vendor -not -type d -exec file {} \+ | grep PE32 (for-each delete-file (find-files "vendor" "\\.(a|dll|exe|lib)$")) - ;; Adjust some sources for llvm-13, see llvm commit - ;; acce401068e78a8c5dc9e06802111ffad3da763f - (substitute* (find-files "." "powerpc64le_unknown_linux_gnu.rs") - (("e-m:e-i64:64-n32:64-v256:256:256-v512:512:512") - "e-m:e-i64:64-n32:64-S128-v256:256:256-v512:512:512")))))) + ;; Adjust vendored dependency to explicitly use rustix with libc backend. + (substitute* "vendor/tempfile/Cargo.toml" + (("features = \\[\"fs\"" all) + (string-append all ", \"use-libc\""))))) + ;; Rust 1.70 adds the rustix library which depends on the vendored + ;; fd-lock crate. The fd-lock crate uses Outline assembly which expects + ;; a precompiled static library. Enabling the "cc" feature tells the + ;; build.rs script to compile the assembly files instead of searching + ;; for a precompiled library. + (patches (search-patches "rust-1.70-fix-rustix-build.patch")))) (outputs '("out" "cargo")) (properties '((hidden? . #t) (timeout . 129600) ;36 hours @@ -192,136 +194,137 @@ (define-public rust-bootstrap (build-system gnu-build-system) (inputs (list bash-minimal - llvm-13 - openssl-1.1 + llvm-15 + openssl zlib)) (native-inputs - `(("pkg-config" ,pkg-config) - ("mrustc-source" ,%mrustc-source))) + (list pkg-config %mrustc-source)) (arguments - `(#:imported-modules ,%cargo-utils-modules ;for `generate-all-checksums' - #:modules ((guix build cargo-utils) + (list + #:imported-modules %cargo-utils-modules ;for `generate-all-checksums' + #:modules '((guix build cargo-utils) (guix build utils) (guix build gnu-build-system)) - #:test-target "test" - ;; Rust's own .so library files are not found in any RUNPATH, but - ;; that doesn't seem to cause issues. - #:validate-runpath? #f - #:make-flags - ,#~(let ((source #$(package-source this-package))) - (list (string-append "RUSTC_TARGET=" - #$(platform-rust-target - (lookup-platform-by-target-or-system - (or (%current-target-system) - (%current-system))))) - (string-append "RUSTC_VERSION=" #$version) - (string-append "MRUSTC_TARGET_VER=" - #$(version-major+minor version)) - (string-append "RUSTC_SRC_TARBALL=" source) - "OUTDIR_SUF=")) ;do not add version suffix to output dir - #:phases - (modify-phases %standard-phases - (replace 'unpack - (lambda* (#:key source inputs #:allow-other-keys) - ((assoc-ref %standard-phases 'unpack) - #:source (assoc-ref inputs "mrustc-source")))) - (add-after 'unpack 'patch-makefiles - ;; This disables building the (unbundled) LLVM. - (lambda* (#:key inputs #:allow-other-keys) - (substitute* '("minicargo.mk" - "run_rustc/Makefile") - ;; Use the system-provided LLVM. - (("LLVM_CONFIG [:|?]= .*") - (string-append "LLVM_CONFIG := " - (search-input-file inputs "/bin/llvm-config") "\n"))) - (substitute* "Makefile" - ;; Patch date and git obtained version information. - ((" -D VERSION_GIT_FULLHASH=.*") - (string-append - " -D VERSION_GIT_FULLHASH=\\\"" ,%mrustc-commit "\\\"" - " -D VERSION_GIT_BRANCH=\\\"master\\\"" - " -D VERSION_GIT_SHORTHASH=\\\"" - ,(string-take %mrustc-commit 7) "\\\"" - " -D VERSION_BUILDTIME=" - "\"\\\"Thu, 01 Jan 1970 00:00:01 +0000\\\"\"" - " -D VERSION_GIT_ISDIRTY=0\n"))) - (substitute* '("run_rustc/Makefile" - "run_rustc/rustc_proxy.sh") - ;; Patch the shebang of a generated wrapper for rustc - (("#!/bin/sh") - (string-append "#!" (which "sh")))))) - (add-before 'configure 'configure-cargo-home - (lambda _ - (let ((cargo-home (string-append (getcwd) "/.cargo"))) - (mkdir-p cargo-home) - (setenv "CARGO_HOME" cargo-home)))) - (replace 'configure - (lambda _ - (setenv "CC" "gcc") - (setenv "CXX" "g++") - ;; The Guix LLVM package installs only shared libraries. - (setenv "LLVM_LINK_SHARED" "1") - ;; rustc still insists on having 'cc' on PATH in some places - ;; (e.g. when building the 'test' library crate). - (mkdir-p "/tmp/bin") - (symlink (which "gcc") "/tmp/bin/cc") - (setenv "PATH" (string-append "/tmp/bin:" (getenv "PATH"))))) - (delete 'patch-generated-file-shebangs) - (replace 'build - (lambda* (#:key make-flags parallel-build? #:allow-other-keys) - (let ((job-count (if parallel-build? - (parallel-job-count) - 1))) - ;; Adapted from: - ;; https://github.com/dtolnay/bootstrap/blob/master/build-1.54.0.sh. - ;; Use PARLEVEL since both minicargo and mrustc use it - ;; to set the level of parallelism. - (setenv "PARLEVEL" (number->string job-count)) - (display "Building mrustc...\n") - (apply invoke "make" make-flags) + #:test-target "test" + ;; Rust's own .so library files are not found in any RUNPATH, but + ;; that doesn't seem to cause issues. + #:validate-runpath? #f + #:make-flags + #~(let ((source #$(package-source this-package))) + (list (string-append "RUSTC_TARGET=" + #$(platform-rust-target + (lookup-platform-by-target-or-system + (or (%current-target-system) + (%current-system))))) + (string-append "RUSTC_VERSION=" #$version) + (string-append "MRUSTC_TARGET_VER=" + #$(version-major+minor version)) + (string-append "RUSTC_SRC_TARBALL=" source) + "OUTDIR_SUF=")) ;do not add version suffix to output dir + #:phases + #~(modify-phases %standard-phases + (replace 'unpack + (lambda* (#:key source inputs #:allow-other-keys) + ((assoc-ref %standard-phases 'unpack) + #:source #$(this-package-native-input + (origin-file-name %mrustc-source))))) + (add-after 'unpack 'patch-makefiles + ;; This disables building the (unbundled) LLVM. + (lambda* (#:key inputs #:allow-other-keys) + (substitute* '("minicargo.mk" + "run_rustc/Makefile") + ;; Use the system-provided LLVM. + (("LLVM_CONFIG [:|?]= .*") + (string-append "LLVM_CONFIG := " + (search-input-file inputs "/bin/llvm-config") "\n"))) + (substitute* "Makefile" + ;; Patch date and git obtained version information. + ((" -D VERSION_GIT_FULLHASH=.*") + (string-append + " -D VERSION_GIT_FULLHASH=\\\"" #$%mrustc-commit "\\\"" + " -D VERSION_GIT_BRANCH=\\\"master\\\"" + " -D VERSION_GIT_SHORTHASH=\\\"" + #$(string-take %mrustc-commit 7) "\\\"" + " -D VERSION_BUILDTIME=" + "\"\\\"Thu, 01 Jan 1970 00:00:01 +0000\\\"\"" + " -D VERSION_GIT_ISDIRTY=0\n"))) + (substitute* '("run_rustc/Makefile" + "run_rustc/rustc_proxy.sh") + ;; Patch the shebang of a generated wrapper for rustc + (("#!/bin/sh") + (string-append "#!" (which "sh")))))) + (add-before 'configure 'configure-cargo-home + (lambda _ + (let ((cargo-home (string-append (getcwd) "/.cargo"))) + (mkdir-p cargo-home) + (setenv "CARGO_HOME" cargo-home)))) + (replace 'configure + (lambda _ + (setenv "CC" "gcc") + (setenv "CXX" "g++") + ;; The Guix LLVM package installs only shared libraries. + (setenv "LLVM_LINK_SHARED" "1") + ;; rustc still insists on having 'cc' on PATH in some places + ;; (e.g. when building the 'test' library crate). + (mkdir-p "/tmp/bin") + (symlink (which "gcc") "/tmp/bin/cc") + (setenv "PATH" (string-append "/tmp/bin:" (getenv "PATH"))))) + (delete 'patch-generated-file-shebangs) + (replace 'build + (lambda* (#:key make-flags parallel-build? #:allow-other-keys) + (let ((job-count (if parallel-build? + (parallel-job-count) + 1))) + ;; Adapted from: + ;; https://github.com/dtolnay/bootstrap/blob/master/build-1.54.0.sh. + ;; Use PARLEVEL since both minicargo and mrustc use it + ;; to set the level of parallelism. + (setenv "PARLEVEL" (number->string job-count)) + (display "Building mrustc...\n") + (apply invoke "make" make-flags) - ;; This doesn't seem to build anything, but it - ;; sets additional minicargo flags. - (display "Building RUSTCSRC...\n") - (apply invoke "make" "RUSTCSRC" make-flags) + ;; This doesn't seem to build anything, but it + ;; sets additional minicargo flags. + (display "Building RUSTCSRC...\n") + (apply invoke "make" "RUSTCSRC" make-flags) - ;; This probably doesn't need to be called explicitly. - (display "Building LIBS...\n") - (apply invoke "make" "-f" "minicargo.mk" "LIBS" make-flags) + ;; This probably doesn't need to be called explicitly. + (display "Building LIBS...\n") + (apply invoke "make" "-f" "minicargo.mk" "LIBS" make-flags) - ;; The psm crate FTBFS on ppc64le with gcc. - (display "Building rustc...\n") - (apply invoke "make" "-f" "minicargo.mk" "output/rustc" - make-flags) + ;; The psm crate FTBFS on ppc64le with gcc. + (display "Building rustc...\n") + (apply invoke "make" "-f" "minicargo.mk" "output/rustc" + make-flags) - (display "Building cargo...\n") - (apply invoke "make" "-f" "minicargo.mk" "output/cargo" - make-flags) + (display "Building cargo...\n") + (apply invoke "make" "-f" "minicargo.mk" "output/cargo" + make-flags) - ;; This one isn't listed in the build script. - (display "Rebuilding stdlib with rustc...\n") - (apply invoke "make" "-C" "run_rustc" make-flags)))) - (replace 'install - (lambda* (#:key inputs outputs #:allow-other-keys) - (let* ((out (assoc-ref outputs "out")) - (cargo (assoc-ref outputs "cargo")) - (bin (string-append out "/bin")) - (rustc (string-append bin "/rustc")) - (cargo-bin (string-append cargo "/bin")) - (lib (string-append out "/lib")) - (system-lib-prefix + ;; This one isn't listed in the build script. + (display "Rebuilding stdlib with rustc...\n") + (apply invoke "make" "-C" "run_rustc" make-flags)))) + (replace 'install + (lambda* (#:key inputs outputs #:allow-other-keys) + (let* ((out (assoc-ref outputs "out")) + (cargo (assoc-ref outputs "cargo")) + (bin (string-append out "/bin")) + (rustc (string-append bin "/rustc")) + (cargo-bin (string-append cargo "/bin")) + (lib (string-append out "/lib")) + (system-lib-prefix (string-append lib "/rustlib/" - ,(platform-rust-target + #$(platform-rust-target (lookup-platform-by-target-or-system - (or (%current-target-system) - (%current-system)))) "/lib"))) - (mkdir-p (dirname rustc)) - (copy-file "run_rustc/output/prefix/bin/rustc_binary" rustc) - (wrap-program rustc - `("LD_LIBRARY_PATH" = (,system-lib-prefix))) - (mkdir-p lib) - (copy-recursively "run_rustc/output/prefix/lib" lib) - (install-file "run_rustc/output/prefix/bin/cargo" cargo-bin))))))) + (or (%current-target-system) + (%current-system)))) "/lib"))) + (mkdir-p (dirname rustc)) + (copy-file "run_rustc/output/prefix/bin/rustc_binary" rustc) + (wrap-program rustc + `("LD_LIBRARY_PATH" = (,system-lib-prefix))) + (mkdir-p lib) + (copy-recursively "run_rustc/output/prefix/lib" lib) + (install-file "run_rustc/output/prefix/bin/cargo" cargo-bin))))))) (synopsis "Compiler for the Rust programming language") (description "Rust is a systems programming language that provides memory safety and thread safety guarantees.") From patchwork Mon Apr 7 20:07:47 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Morgan Smith X-Patchwork-Id: 41417 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 46EFC27BC49; Mon, 7 Apr 2025 21:09:34 +0100 (BST) X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on mira.cbaines.net X-Spam-Level: X-Spam-Status: No, score=-6.4 required=5.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED,FREEMAIL_FROM,MAILING_LIST_MULTI,RCVD_IN_DNSWL_BLOCKED, RCVD_IN_VALIDITY_CERTIFIED,RCVD_IN_VALIDITY_RPBL,RCVD_IN_VALIDITY_SAFE, SPF_HELO_PASS,URIBL_BLOCKED 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 A1B0B27BC4B for ; Mon, 7 Apr 2025 21:09:30 +0100 (BST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1u1smH-0006IA-Pb; Mon, 07 Apr 2025 16:09:05 -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 1u1smG-0006He-0M for guix-patches@gnu.org; Mon, 07 Apr 2025 16:09:04 -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 1u1smF-0007u4-MG for guix-patches@gnu.org; Mon, 07 Apr 2025 16:09:03 -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:References:In-Reply-To:Date:From:To:Subject; bh=FsvLrZatyQ8d2UbQSp49dFxweskLdT9EqwvmRQk2aDc=; b=vM1RQbsjLueU7X6tfQOTML3K6BvN6iFCX4PHEcbP3n9qdeQ8h09jZTkFJh4SU82PH6QmH8IkKh7uTOKDOl/aW94t5aLHN8nr8nEqbU0qEli8j4RoQ8VpY35xMQGnmrIBlcIO8nnAslLNS3ltcJPQHjVSlVlNQSqYrmeXaik2DKibGWKZCjKXMtgfrZBMrWTvuvede5hYoDOohvz/MZItLDDVjuI+cDhWUMxuO8VjQJgV0HUOR5eyqJUVep0FqFzhC6TFO++Id8HnzmibKXoFoA63No5M5Yf7CQbYRT6EVuXZMz3UsFt8JofimSGmrJY2yI5iWUvJCxhKD6uYWAtMAg==; Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1u1smF-00043Z-0s; Mon, 07 Apr 2025 16:09:03 -0400 X-Loop: help-debbugs@gnu.org Subject: [bug#77616] [PATCH 3/6] gnu: rust-1.75: Inherit from rust-bootstrap. Resent-From: Morgan Smith Original-Sender: "Debbugs-submit" Resent-CC: divya@subvertising.org, efraim@flashner.co.il, steve@futurile.net, guix-patches@gnu.org Resent-Date: Mon, 07 Apr 2025 20:09:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 77616 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: 77616@debbugs.gnu.org Cc: Morgan Smith , Divya Ranjan Pattanaik , Efraim Flashner , Steve George X-Debbugs-Original-Xcc: Divya Ranjan Pattanaik , Efraim Flashner , Steve George Received: via spool by 77616-submit@debbugs.gnu.org id=B77616.174405650415407 (code B ref 77616); Mon, 07 Apr 2025 20:09:02 +0000 Received: (at 77616) by debbugs.gnu.org; 7 Apr 2025 20:08:24 +0000 Received: from localhost ([127.0.0.1]:57039 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1u1slb-00040N-Gn for submit@debbugs.gnu.org; Mon, 07 Apr 2025 16:08:24 -0400 Received: from mail-dm6nam12olkn20817.outbound.protection.outlook.com ([2a01:111:f403:2c17::817]:25953 helo=NAM12-DM6-obe.outbound.protection.outlook.com) by debbugs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.84_2) (envelope-from ) id 1u1slX-0003z0-5D for 77616@debbugs.gnu.org; Mon, 07 Apr 2025 16:08:20 -0400 ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=SnXMkTwKpSrxEJ4N/mk63hHUtOIK9AsR02URF1lIJ/tFWUNViBglVSv3ZriFz59SnpgvLzg3aY9HqZLAbql1XgAR2XSDwla4jynx278+7nBco9rfSi0DPcPSMHSmFXbyReLKdMOTjIU0yQ9qDiqXAoUdQZMmEkEpjrWsr7FKzSzWpR9w/9xVXhVwm7HBpPurCNRhGtGRRh/0XisMbSo3myTygWEWe30OYgPxKBqt/qZ2gdxq8d0EcHin0ZapmSCAHOOm736ZkNfEI9MLx1G0ZcC4ITFh8vcfeDSy0kG8u3V31fK34hsdIsDEJSOtVHPxLGZa7NZ+TSAzh7+q63Hwrg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector10001; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=FsvLrZatyQ8d2UbQSp49dFxweskLdT9EqwvmRQk2aDc=; b=alfyuwXqP9VmpWojN5HY/rhz+QNiI3+wRwFsdMXAIX77B5wQKCoGLHF81kbVT5vI7Hdfq3W4PmR5b2G0Vyf6IMwFoB/beBMNqns7q2Ryzo8FQlKtGK+8zwMOs3oQ0xRNTJwEtFzRMwZczDHFdH7id9KJ0fyDNMIrOvprHpnpKytrXxm9EFu0S7Jc7/m5K5ijT9egeFMdBGLeVv88Mwad/nB7UPFu9CpVFERZNbh8WmyoGTrBmQIVAu85QqHDvHMt++3ezr45ce5TUzbevB6wCzPTkkq0xDUQsGmAoaIptekOY++FQHOAydhMJNqUMbbBwIIHB+AbSUvdE5j39O2jBw== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=none; dmarc=none; dkim=none; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=outlook.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=FsvLrZatyQ8d2UbQSp49dFxweskLdT9EqwvmRQk2aDc=; b=khs592UIDiws26pzcKW8IPUR7w6UcIpHYo9GYVac+0JxVLODdyII/Nkb94ggjvOg13MXWlNtxCVpZdtRZhoMerotUqXq4Tp88q+ow2s1B+3uUxp4vx9U0kepetpyWD661YdjW0h7iSg4jQ3A+r5BSavOSk04u6SI4rymIS2EGJmYOzEE5Q4Ll0TwaJ3KuCCp50RmPd4piiPSthX9FJ68sdLanXCifexet4GcqlTpPUvYyj5047/lkr+vgf7Soz/Fs7QDIxWuikF0KpxQbZl2/eFZWkLM+3fvQSYM12CBOnA5XEG2HDkTNf8IS3IpiqyvknQbpC8NrXZ7vM9ArIlCzQ== Received: from CH3PR84MB3424.NAMPRD84.PROD.OUTLOOK.COM (2603:10b6:610:1c4::17) by DS0PR84MB3589.NAMPRD84.PROD.OUTLOOK.COM (2603:10b6:8:1b8::16) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.8606.31; Mon, 7 Apr 2025 20:08:14 +0000 Received: from CH3PR84MB3424.NAMPRD84.PROD.OUTLOOK.COM ([fe80::5c77:7a58:48ed:9aef]) by CH3PR84MB3424.NAMPRD84.PROD.OUTLOOK.COM ([fe80::5c77:7a58:48ed:9aef%5]) with mapi id 15.20.8606.033; Mon, 7 Apr 2025 20:08:14 +0000 From: Morgan Smith Date: Mon, 7 Apr 2025 16:07:47 -0400 Message-ID: X-Mailer: git-send-email 2.49.0 In-Reply-To: <2141283854b61187d507f0dfaf768e3416e09845.1744056453.git.Morgan.J.Smith@outlook.com> References: <2141283854b61187d507f0dfaf768e3416e09845.1744056453.git.Morgan.J.Smith@outlook.com> X-ClientProxiedBy: YQZPR01CA0115.CANPRD01.PROD.OUTLOOK.COM (2603:10b6:c01:83::8) To CH3PR84MB3424.NAMPRD84.PROD.OUTLOOK.COM (2603:10b6:610:1c4::17) X-Microsoft-Original-Message-ID: MIME-Version: 1.0 X-MS-Exchange-MessageSentRepresentingType: 1 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: CH3PR84MB3424:EE_|DS0PR84MB3589:EE_ X-MS-Office365-Filtering-Correlation-Id: 39806e44-89db-41d9-68f8-08dd760fed2a X-Microsoft-Antispam: BCL:0; ARA:14566002|461199028|8060799006|15080799006|7092599003|19110799003|5072599009|41001999003|440099028|3412199025|1710799026; X-Microsoft-Antispam-Message-Info: bZ3woY2JZt/EGqCESvt1ystvarBLnnCxxpeWQwsOl5Ux+fr0kc7KVu0d1lThaTIk1f8QTkzwLtyLZ9hVHDZUzfSsToyQ0BkY1D15a3Z3KaNgKgSuC68MdK0LVjbkOpOa8IQlxituRudIy+flxLkZZ2GzBb76jDJb7l0aVEf46QvhBP98GwUfi7S6LdiA8zLpw0QbPnhUnVktatAS6CsxCzgzYvl+YV5W4Qer2Nh2qFNKhiuTpTk+MAWOB7S2mWwPl4wzc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R1PT4HroMa2pw95AG6mNj30KTv/BxrQEmn8uyFXjFc/GFhSMYQ+36NZzMf78UhBeuk9gbv0UPy0DJMxhvbQvc+bG8U6COHh9k5WSxIHRWkNNKRHaXblp3Pm X-OriginatorOrg: outlook.com X-MS-Exchange-CrossTenant-Network-Message-Id: 39806e44-89db-41d9-68f8-08dd760fed2a X-MS-Exchange-CrossTenant-AuthSource: CH3PR84MB3424.NAMPRD84.PROD.OUTLOOK.COM X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 07 Apr 2025 20:08:14.3549 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 84df9e7f-e9f6-40af-b435-aaaaaaaaaaaa X-MS-Exchange-CrossTenant-RMS-PersistedConsumerOrg: 00000000-0000-0000-0000-000000000000 X-MS-Exchange-Transport-CrossTenantHeadersStamped: DS0PR84MB3589 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 * gnu/packages/rust.scm (rust-1.75): Inherit from rust-bootstrap. (rust-1.75): Remove variable. Change-Id: I8474b703baebfcb7b1e5442a6593c22039997924 --- gnu/packages/rust.scm | 227 ++++++++++++++++++++---------------------- 1 file changed, 109 insertions(+), 118 deletions(-) diff --git a/gnu/packages/rust.scm b/gnu/packages/rust.scm index 66703abc35..ccedfd2c74 100644 --- a/gnu/packages/rust.scm +++ b/gnu/packages/rust.scm @@ -341,87 +341,71 @@ (define-public rust-bootstrap ;; Dual licensed. (license (list license:asl2.0 license:expat)))) -(define-public rust-1.55 +(define-public rust-1.75 (package (name "rust") - (version "1.55.0") + (version "1.75.0") (source (origin - (method url-fetch) + (inherit (package-source rust-bootstrap)) (uri (rust-uri version)) - (sha256 (base32 "07l28f7grdmi65naq71pbmvdd61hwcpi40ry7kp7dy7m233rldxj")) - (modules '((guix build utils))) - (snippet - '(begin - (for-each delete-file-recursively - '("src/llvm-project" - "vendor/openssl-src/openssl" - "vendor/tikv-jemalloc-sys/jemalloc")) - ;; Remove vendored dynamically linked libraries. - ;; find . -not -type d -executable -exec file {} \+ | grep ELF - (delete-file "vendor/vte/vim10m_match") - (delete-file "vendor/vte/vim10m_table") - ;; Also remove the bundled (mostly Windows) libraries. - ;; find vendor -not -type d -exec file {} \+ | grep PE32 - (for-each delete-file - (find-files "vendor" "\\.(a|dll|exe|lib)$")) - ;; Add support for riscv64-linux. - (substitute* "vendor/tikv-jemallocator/src/lib.rs" - ((" target_arch = \"s390x\"," all) - (string-append all "\n target_arch = \"riscv64\","))))))) + (sha256 (base32 "1260mf3066ki6y55pvr35lnf54am6z96a3ap3hniwd4xpi2rywsv")) + (patches '()))) (outputs '("out" "cargo")) (properties '((hidden? . #t) (timeout . 72000) ;20 hours (max-silent-time . 18000))) ;5 hours (for armel) (build-system gnu-build-system) (arguments - `(#:validate-runpath? #f - ;; Only the final Rust is tested, not the intermediate bootstrap ones, - ;; for performance and simplicity. - #:tests? #f - #:imported-modules ,%cargo-utils-modules ;for `generate-all-checksums' - #:modules ((guix build cargo-utils) + (list + #:disallowed-references (list rust-bootstrap) + #:validate-runpath? #f + ;; Only the final Rust is tested, not the intermediate bootstrap ones, + ;; for performance and simplicity. + #:tests? #f + #:imported-modules %cargo-utils-modules ;for `generate-all-checksums' + #:modules '((guix build cargo-utils) (guix build utils) (guix build gnu-build-system) (ice-9 match) (srfi srfi-1)) - #:phases - (modify-phases %standard-phases - (add-after 'unpack 'set-env - (lambda* (#:key inputs #:allow-other-keys) - (setenv "SHELL" (which "sh")) - (setenv "CONFIG_SHELL" (which "sh")) - (setenv "CC" (search-input-file inputs "/bin/gcc")) - ;; The Guix LLVM package installs only shared libraries. - (setenv "LLVM_LINK_SHARED" "1"))) - (add-after 'unpack 'set-linker-locale-to-utf8 - (lambda _ - (substitute* (find-files "." "^linker.rs$") - (("linker.env\\(\"LC_ALL\", \"C\"\\);") - "linker.env(\"LC_ALL\", \"C.UTF-8\");")))) - (add-after 'unpack 'add-cc-shim-to-path - (lambda _ - (mkdir-p "/tmp/bin") - (symlink (which "gcc") "/tmp/bin/cc") - (setenv "PATH" (string-append "/tmp/bin:" (getenv "PATH"))))) - (replace 'configure - (lambda* (#:key inputs outputs #:allow-other-keys) - (let* ((out (assoc-ref outputs "out")) - (gcc (assoc-ref inputs "gcc")) - (python (assoc-ref inputs "python")) - (binutils (assoc-ref inputs "binutils")) - (rustc (assoc-ref inputs "rustc-bootstrap")) - (cargo (assoc-ref inputs "cargo-bootstrap")) - (llvm (assoc-ref inputs "llvm"))) - (call-with-output-file "config.toml" - (lambda (port) - (display (string-append " + #:phases + #~(modify-phases %standard-phases + (add-after 'unpack 'set-env + (lambda* (#:key inputs #:allow-other-keys) + (setenv "SHELL" (which "sh")) + (setenv "CONFIG_SHELL" (which "sh")) + (setenv "CC" (search-input-file inputs "/bin/gcc")) + ;; The Guix LLVM package installs only shared libraries. + (setenv "LLVM_LINK_SHARED" "1"))) + (add-after 'unpack 'set-linker-locale-to-utf8 + (lambda _ + (substitute* (find-files "." "^linker.rs$") + (("linker.env\\(\"LC_ALL\", \"C\"\\);") + "linker.env(\"LC_ALL\", \"C.UTF-8\");")))) + (add-after 'unpack 'add-cc-shim-to-path + (lambda _ + (mkdir-p "/tmp/bin") + (symlink (which "gcc") "/tmp/bin/cc") + (setenv "PATH" (string-append "/tmp/bin:" (getenv "PATH"))))) + (replace 'configure + (lambda* (#:key inputs outputs #:allow-other-keys) + (let* ((out (assoc-ref outputs "out")) + (gcc (assoc-ref inputs "gcc")) + (python (search-input-file inputs "/bin/python")) + (binutils (assoc-ref inputs "binutils")) + (rustc (search-input-file inputs "/bin/rustc")) + (cargo (search-input-file inputs "/bin/cargo")) + (llvm (assoc-ref inputs "llvm"))) + (call-with-output-file "config.toml" + (lambda (port) + (display (string-append " [llvm] [build] -cargo = \"" cargo "/bin/cargo" "\" -rustc = \"" rustc "/bin/rustc" "\" +cargo = \"" cargo "\" +rustc = \"" rustc "\" docs = false -python = \"" python "/bin/python" "\" +python = \"" python "\" vendor = true submodules = false [install] @@ -433,69 +417,76 @@ (define-public rust-1.55 default-linker = \"" gcc "/bin/gcc" "\" channel = \"stable\" rpath = true -[target." ,(platform-rust-target (lookup-platform-by-system (%current-system))) "] +[target." #$(platform-rust-target (lookup-platform-by-system (%current-system))) "] llvm-config = \"" llvm "/bin/llvm-config" "\" cc = \"" gcc "/bin/gcc" "\" cxx = \"" gcc "/bin/g++" "\" ar = \"" binutils "/bin/ar" "\" [dist] ") port)))))) - (replace 'build - ;; The standard library source location moved in this release. - (lambda* (#:key parallel-build? #:allow-other-keys) - (let ((job-spec (string-append - "-j" (if parallel-build? - (number->string (parallel-job-count)) - "1")))) - (invoke "./x.py" job-spec "build" "--stage=1" - "library/std" - "src/tools/cargo")))) - (replace 'install - (lambda* (#:key outputs #:allow-other-keys) - (let* ((out (assoc-ref outputs "out")) - (cargo-out (assoc-ref outputs "cargo")) - (build (string-append "build/" - ,(platform-rust-target - (lookup-platform-by-target-or-system - (or (%current-target-system) - (%current-system))))))) - ;; Manually do the installation instead of calling './x.py - ;; install', as that is slow and needlessly rebuilds some - ;; things. - (install-file (string-append build "/stage1/bin/rustc") - (string-append out "/bin")) - (copy-recursively (string-append build "/stage1/lib") - (string-append out "/lib")) - (install-file (string-append build "/stage1-tools-bin/cargo") - (string-append cargo-out "/bin"))))) - (add-after 'install 'delete-install-logs - (lambda* (#:key outputs #:allow-other-keys) - (for-each (lambda (f) - (false-if-exception (delete-file f))) - (append-map (lambda (output) - (find-files (string-append - output "/lib/rustlib") - "(^install.log$|^manifest-)")) - (map cdr outputs))))) - (add-after 'install 'wrap-rustc - (lambda* (#:key inputs outputs #:allow-other-keys) - (let ((out (assoc-ref outputs "out")) - (libc (assoc-ref inputs "libc")) - (ld-wrapper (assoc-ref inputs "ld-wrapper"))) - ;; Let gcc find ld and libc startup files. - (wrap-program (string-append out "/bin/rustc") - `("PATH" ":" prefix (,(string-append ld-wrapper "/bin"))) - `("LIBRARY_PATH" ":" - suffix (,(string-append libc "/lib")))))))))) + (add-after 'patch-generated-file-shebangs 'patch-cargo-checksums + (lambda _ + (substitute* (cons* "Cargo.lock" + "src/bootstrap/Cargo.lock" + (find-files "src/tools" "Cargo.lock")) + (("(checksum = )\".*\"" all name) + (string-append name "\"" #$%cargo-reference-hash "\""))) + (generate-all-checksums "vendor"))) + (replace 'build + ;; The standard library source location moved in this release. + (lambda* (#:key parallel-build? #:allow-other-keys) + (let ((job-spec (string-append + "-j" (if parallel-build? + (number->string (parallel-job-count)) + "1")))) + (invoke "./x.py" job-spec "build" "--stage=1" + "library/std" + "src/tools/cargo")))) + (replace 'install + (lambda* (#:key outputs #:allow-other-keys) + (let* ((out (assoc-ref outputs "out")) + (cargo-out (assoc-ref outputs "cargo")) + (build (string-append "build/" + #$(platform-rust-target + (lookup-platform-by-target-or-system + (or (%current-target-system) + (%current-system))))))) + ;; Manually do the installation instead of calling './x.py + ;; install', as that is slow and needlessly rebuilds some + ;; things. + (install-file (string-append build "/stage1/bin/rustc") + (string-append out "/bin")) + (copy-recursively (string-append build "/stage1/lib") + (string-append out "/lib")) + (install-file (string-append build "/stage1-tools-bin/cargo") + (string-append cargo-out "/bin"))))) + (add-after 'install 'delete-install-logs + (lambda* (#:key outputs #:allow-other-keys) + (for-each (lambda (f) + (false-if-exception (delete-file f))) + (append-map (lambda (output) + (find-files (string-append + output "/lib/rustlib") + "(^install.log$|^manifest-)")) + (map cdr outputs))))) + (add-after 'install 'wrap-rustc + (lambda* (#:key inputs outputs #:allow-other-keys) + (let ((out (assoc-ref outputs "out")) + (libc (assoc-ref inputs "libc")) + (ld-wrapper (assoc-ref inputs "ld-wrapper"))) + ;; Let gcc find ld and libc startup files. + (wrap-program (string-append out "/bin/rustc") + `("PATH" ":" prefix (,(string-append ld-wrapper "/bin"))) + `("LIBRARY_PATH" ":" + suffix (,(string-append libc "/lib")))))))))) (native-inputs - `(("pkg-config" ,pkg-config) - ("python" ,python-minimal-wrapper) - ("rustc-bootstrap" ,rust-bootstrap) - ("cargo-bootstrap" ,rust-bootstrap "cargo"))) + (list + pkg-config + python-minimal-wrapper + rust-bootstrap + `(,rust-bootstrap "cargo"))) (inputs - `(("bash" ,bash-minimal) - ("llvm" ,llvm-13) - ("openssl" ,openssl))) + (list bash-minimal llvm-15 openssl)) ;; rustc invokes gcc, so we need to set its search paths accordingly. (native-search-paths %gcc-search-paths) From patchwork Mon Apr 7 20:07:48 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Morgan Smith X-Patchwork-Id: 41416 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 D02F327BC49; Mon, 7 Apr 2025 21:09:33 +0100 (BST) X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on mira.cbaines.net X-Spam-Level: X-Spam-Status: No, score=-6.4 required=5.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED,FREEMAIL_FROM,MAILING_LIST_MULTI,RCVD_IN_DNSWL_BLOCKED, RCVD_IN_VALIDITY_CERTIFIED,RCVD_IN_VALIDITY_RPBL,RCVD_IN_VALIDITY_SAFE, SPF_HELO_PASS,URIBL_BLOCKED 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 66EDD27BC4D for ; Mon, 7 Apr 2025 21:09:31 +0100 (BST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1u1smL-0006Jv-1e; Mon, 07 Apr 2025 16:09:09 -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 1u1smI-0006Iz-RB for guix-patches@gnu.org; Mon, 07 Apr 2025 16:09:06 -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 1u1smI-0007uy-IK for guix-patches@gnu.org; Mon, 07 Apr 2025 16:09:06 -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:References:In-Reply-To:Date:From:To:Subject; bh=UtN0oOHNkO5jfANeVUVTs10PoXihLDFxKT0bWbX1boA=; b=HoY1O8fdhb1iXR6fTrPMHT+teQMNWCxbIkZ04VlNEw/q1svz/L4DG8nbnFOmn3fp7QtSY00p+SLaJWiY4ifCI0P80buDfpUwGSFBLyy/atxHDcCjGaByA12Xo5BfVxhoLxZ4dJWhqx3bsWsZBy5dCBG1uGp3xZs4CAyyQV1EzsZA0JV90X1b7t6dInInBO1Ur4uIRbCIRH73OeqnDRSanTh7oYweaRsottazOPFr5Nx+sJN3E5bALLJuORmaI8vS0HtpJLa3GKTkCY6NGfcTwrk/mmd1BMgUsNTlASDOLPdO0W/RxnWRgCWtOb2v51gviCaA2KAT2dvEHGZH4cmmrw==; Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1u1smF-00043k-Fb; Mon, 07 Apr 2025 16:09:03 -0400 X-Loop: help-debbugs@gnu.org Subject: [bug#77616] [PATCH 4/6] gnu: rust-bootstrapped-package: Use modify-inputs. Resent-From: Morgan Smith Original-Sender: "Debbugs-submit" Resent-CC: divya@subvertising.org, efraim@flashner.co.il, steve@futurile.net, guix-patches@gnu.org Resent-Date: Mon, 07 Apr 2025 20:09:03 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 77616 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: 77616@debbugs.gnu.org Cc: Morgan Smith , Divya Ranjan Pattanaik , Efraim Flashner , Steve George X-Debbugs-Original-Xcc: Divya Ranjan Pattanaik , Efraim Flashner , Steve George Received: via spool by 77616-submit@debbugs.gnu.org id=B77616.174405650515414 (code B ref 77616); Mon, 07 Apr 2025 20:09:03 +0000 Received: (at 77616) by debbugs.gnu.org; 7 Apr 2025 20:08:25 +0000 Received: from localhost ([127.0.0.1]:57041 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1u1slc-00040S-G1 for submit@debbugs.gnu.org; Mon, 07 Apr 2025 16:08:24 -0400 Received: from mail-dm6nam12olkn20817.outbound.protection.outlook.com ([2a01:111:f403:2c17::817]:25953 helo=NAM12-DM6-obe.outbound.protection.outlook.com) by debbugs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.84_2) (envelope-from ) id 1u1slY-0003z0-DG for 77616@debbugs.gnu.org; Mon, 07 Apr 2025 16:08:20 -0400 ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=BnmHq//arGVJyrYqDPSy4kucfQJi8x62QMiw8qNTr65ao3aCWEMdIkvXiM3c4jddDCVQLC5Y9UkBw60uQvC5NnrX3I2YnnQhard8xqiD6hvY3xCoWIlD70tCVptPMvnBsNLsI/t/usJNEqTqhOfiNY4SEEesXpsX5Z4BU0Fy1LvWx4AOQSqVdhQ7JwHKb/UhncqXzuup9V4f0H13yf6gNQBTM9uXgg6hgIGjCNG5p5e7ijKjFmMIl9e09vFfVK2MCQ4FMfnzRyKfLiFguNehMKMIJnu40VUPNjvHKLIsBZ4U38YXGCEEYFEyojdMWgOemR/F8N9MwFfzlImlM5xdmw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector10001; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=UtN0oOHNkO5jfANeVUVTs10PoXihLDFxKT0bWbX1boA=; b=eln2u94YUR5g37KRkTY1aVfhA1hJrmOMblHApPSCB8MY2r4TeegXiW4InzNGfM5vHrUfmctubAfBfgqX695ebBn4AWaXUdXG/HSbsX7GgR7W5Kq9wl5n4NsgpKhfPrTNDGagJG7UbF7S+MtKRuvg7Zgt/quDZ24PSXaCXqe7Z1mRTx2YeWOsCe3mSCwdfWLg0MbuYOg5A7ojCaxzLX7TiOP8/x6qCNJ6p1vTvSQ8Q6YDq5U9XIS2HSIKgX8Z0FtEuEnLGPui9X7/Is2hGzV+PBMqeb0Al2rYUbCRv3aB4hDbeo0VGHoyNqUutuN+vOm5q+yTZeH6Na3gtgxO+hYZtQ== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=none; dmarc=none; dkim=none; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=outlook.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=UtN0oOHNkO5jfANeVUVTs10PoXihLDFxKT0bWbX1boA=; b=DYYHn613f+bECBu1ISXrT6DjwcrNK7IQTxRObfAs0jJMQs6Rjc0XkGXNypw0LehezRqFtQ63ZcYKvYd8uzmQEn920l8XGILTxhqm4Ogkogui/W3Hbh/PgGC08Wwj5wQV+yJmbKX3XkTE+ZbhQnvoq+NJOpS27gRlPyYOekaDrbSG+MPnbe25KG1Vy748Qzk45gQgDXmknNp3HLh/D9DBfk1erDWa6D+NzIVM9fbfoUqa8ZnOUnuCZ3d/xcWNlH38xkNNxdyk41mJt+Ob8dT4ZTJ1VEkdVn8lGfK5n4FBQHcUKPU6mj64uZL8Hm20gAQAGnKQhKBsGl6qR3HNTueZ4Q== Received: from CH3PR84MB3424.NAMPRD84.PROD.OUTLOOK.COM (2603:10b6:610:1c4::17) by DS0PR84MB3589.NAMPRD84.PROD.OUTLOOK.COM (2603:10b6:8:1b8::16) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.8606.31; Mon, 7 Apr 2025 20:08:18 +0000 Received: from CH3PR84MB3424.NAMPRD84.PROD.OUTLOOK.COM ([fe80::5c77:7a58:48ed:9aef]) by CH3PR84MB3424.NAMPRD84.PROD.OUTLOOK.COM ([fe80::5c77:7a58:48ed:9aef%5]) with mapi id 15.20.8606.033; Mon, 7 Apr 2025 20:08:17 +0000 From: Morgan Smith Date: Mon, 7 Apr 2025 16:07:48 -0400 Message-ID: X-Mailer: git-send-email 2.49.0 In-Reply-To: <2141283854b61187d507f0dfaf768e3416e09845.1744056453.git.Morgan.J.Smith@outlook.com> References: <2141283854b61187d507f0dfaf768e3416e09845.1744056453.git.Morgan.J.Smith@outlook.com> X-ClientProxiedBy: YQZPR01CA0103.CANPRD01.PROD.OUTLOOK.COM (2603:10b6:c01:83::12) To CH3PR84MB3424.NAMPRD84.PROD.OUTLOOK.COM (2603:10b6:610:1c4::17) X-Microsoft-Original-Message-ID: <8f55259a68a2c7acf8d96fc382eb8d669459332c.1744056453.git.Morgan.J.Smith@outlook.com> MIME-Version: 1.0 X-MS-Exchange-MessageSentRepresentingType: 1 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: CH3PR84MB3424:EE_|DS0PR84MB3589:EE_ X-MS-Office365-Filtering-Correlation-Id: f8928833-31db-4f07-b204-08dd760fefc6 X-Microsoft-Antispam: BCL:0; ARA:14566002|461199028|8060799006|15080799006|7092599003|19110799003|5072599009|41001999003|440099028|3412199025|13041999003|1710799026; X-Microsoft-Antispam-Message-Info: WEVwB3AdL72SEp6Mpt6wW5Wh95OMYfeaM924QD2sC83xPOfH4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9DEh8K8D6ShJXiACHuGC5sPLBZ/1BU0NJEJ7JFsb1HPTuTEk9pp/KXaRgd2ZsSZbYywasxEC9ClEQ2WQ9wZ9CE/xyLbifC/evQqtT84v/LV8yZYQbl29neD+9XHPvzUnR2Aj4qe0B9det/wwKjCjHlrJ/13ncgJD8cZ8XjnjsF9lGx+mbOyHMZeLA72M2N0XiITo6srY9Ue5Za7Z4AlzA8yITHMI2j1EV8EQxG0QXh7VQPmmCf25ahJhicEWw5s5VLhYApB5vjXy04TpXWlSDxHPkKbrH9AQZWltGInWrfCn3qfeIPJ12m6jaFvWuDZPJI1P+yUOcd/gTs12cPqHCYxDefVJYdhZoyj4J1S3vjWt1YtZ6mvZWi4qiiEgWfag X-OriginatorOrg: outlook.com X-MS-Exchange-CrossTenant-Network-Message-Id: f8928833-31db-4f07-b204-08dd760fefc6 X-MS-Exchange-CrossTenant-AuthSource: CH3PR84MB3424.NAMPRD84.PROD.OUTLOOK.COM X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 07 Apr 2025 20:08:17.8166 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 84df9e7f-e9f6-40af-b435-aaaaaaaaaaaa X-MS-Exchange-CrossTenant-RMS-PersistedConsumerOrg: 00000000-0000-0000-0000-000000000000 X-MS-Exchange-Transport-CrossTenantHeadersStamped: DS0PR84MB3589 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 * gnu/packages/rust.scm (rust-bootstrapped-package): Use modify-inputs. Also set the #:disallowed-references argument. Change-Id: Idf7390eeb3035bc509a21903e38aa0071603b484 --- gnu/packages/rust.scm | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/gnu/packages/rust.scm b/gnu/packages/rust.scm index ccedfd2c74..98be6d95ce 100644 --- a/gnu/packages/rust.scm +++ b/gnu/packages/rust.scm @@ -121,10 +121,14 @@ (define* (rust-bootstrapped-package base-rust version checksum) (inherit (package-source base-rust)) (uri (rust-uri version)) (sha256 (base32 checksum)))) + (arguments + (substitute-keyword-arguments (package-arguments base-rust) + ((#:disallowed-references _ '()) + (list base-rust)))) (native-inputs - (alist-replace "cargo-bootstrap" (list base-rust "cargo") - (alist-replace "rustc-bootstrap" (list base-rust) - (package-native-inputs base-rust)))))) + (modify-inputs (package-native-inputs base-rust) + (replace "rust" base-rust) + (replace "rust:cargo" (list base-rust "cargo")))))) ;;; Note: mrustc's only purpose is to be able to bootstap Rust; it's designed ;;; to be used in source form. From patchwork Mon Apr 7 20:07:49 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Morgan Smith X-Patchwork-Id: 41418 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 1FC6227BC4B; Mon, 7 Apr 2025 21:09:38 +0100 (BST) X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on mira.cbaines.net X-Spam-Level: X-Spam-Status: No, score=-6.4 required=5.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED,FREEMAIL_FROM,MAILING_LIST_MULTI,RCVD_IN_DNSWL_BLOCKED, RCVD_IN_VALIDITY_CERTIFIED,RCVD_IN_VALIDITY_RPBL,RCVD_IN_VALIDITY_SAFE, SPF_HELO_PASS,URIBL_BLOCKED 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 CD63127BC49 for ; Mon, 7 Apr 2025 21:09:35 +0100 (BST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1u1smI-0006Ir-Gv; Mon, 07 Apr 2025 16:09:06 -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 1u1smH-0006I6-JO for guix-patches@gnu.org; Mon, 07 Apr 2025 16:09:05 -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 1u1smH-0007uj-9r for guix-patches@gnu.org; Mon, 07 Apr 2025 16:09:05 -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:References:In-Reply-To:Date:From:To:Subject; bh=yRQ5rqLjnWkuwjPHMnU6xAZP9aa5pMgZU4ftDWCBHyY=; b=KJ3wR6J++QR96XixG86IeYnfVbN8MRqkaHK+kT7JxHrl6n0IlMDU9P7CgRv3GAql8YARL4hDkgFHIqhfFMwr9mxpwXpBowkirGRkz7R7Uow1bsYjkIh/iBwP8pbH3Roa7NLVfPaJUGHR6uGsvF6qFzPnztE5ZhVDW9W2NwFdpZ7Zv0Vrn9egEJ7KBc2YRThTYPlRl7DQvQsktqrgyaUeaRJB166FjD7NDGPBAzUUPtAobv0Qs5X07szu4rf0GP/+KF/PawRIBEwm567ew6/4s92u4w0MHWDYiZZ2B9QFWQmc2AVGLPTdPMydjhKGh79xgDFA9WjBFS1DXutVSAUlXw==; Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1u1smF-00043y-Ut; Mon, 07 Apr 2025 16:09:03 -0400 X-Loop: help-debbugs@gnu.org Subject: [bug#77616] [PATCH 5/6] gnu: Remove unneeded rust bootstrapping versions. Resent-From: Morgan Smith Original-Sender: "Debbugs-submit" Resent-CC: divya@subvertising.org, efraim@flashner.co.il, steve@futurile.net, guix-patches@gnu.org Resent-Date: Mon, 07 Apr 2025 20:09:03 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 77616 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: 77616@debbugs.gnu.org Cc: Morgan Smith , Divya Ranjan Pattanaik , Efraim Flashner , Steve George X-Debbugs-Original-Xcc: Divya Ranjan Pattanaik , Efraim Flashner , Steve George Received: via spool by 77616-submit@debbugs.gnu.org id=B77616.174405652215498 (code B ref 77616); Mon, 07 Apr 2025 20:09:03 +0000 Received: (at 77616) by debbugs.gnu.org; 7 Apr 2025 20:08:42 +0000 Received: from localhost ([127.0.0.1]:57047 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1u1sll-00041H-4Y for submit@debbugs.gnu.org; Mon, 07 Apr 2025 16:08:42 -0400 Received: from mail-dm6nam12olkn20818.outbound.protection.outlook.com ([2a01:111:f403:2c17::818]:26465 helo=NAM12-DM6-obe.outbound.protection.outlook.com) by debbugs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.84_2) (envelope-from ) id 1u1slf-00040H-JE for 77616@debbugs.gnu.org; Mon, 07 Apr 2025 16:08:31 -0400 ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=rBZQDKk9gSLm4munzOZFLgTu0+tU3GniHR6jSye6eq4rOmmbK3oUiN22E3SLWDcUhoX12xKOzQqMjpOEUBeaZ1LGFLySg5C6T0almsutlKnc2s4n4ayI/lrL38wF/7K6WtIy/61ww7ZG/LfiO1CBItuPMjZpHvKSrMRSExcv5EtJW6AyHU8lGtwb0fVL/vN+U1srp4JwEpRMLG86Oavnw7NDhMD+YjkgUdglSE2Ro32TdCO1CrX4trlk6J7oa8Ll0iJ//51YAVrTqjjlFoRFISpvLlsLobozMjiOT0eoJwoa6r+KFTgiKdOlj4jKDpwvKnV31Gd15DYTVMwLlNUc/w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector10001; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=yRQ5rqLjnWkuwjPHMnU6xAZP9aa5pMgZU4ftDWCBHyY=; b=syV9B4eOEO4BABbvmC6IYL7VYY5yLARifo1eaWcrhoHmBydfCFJ8JINrErO5A70bb0iB4usDp2ezZDsVIsOuZUjdy05aBnlcGNruq3YozxriSBoyF0j/fTacKY4+Y9+ZHuCvS/89brUCKwnAlPDOF7T4N00lY4k1QBohiJqZTArex3RySF2Fj3UxPI/28cfc1dUCqWbNjYtM6YbfyIFkiHrwZb9t+Kh9DPaJCqx3n83Afb9NDmdm1r/iH2hg+YRUEFou0VV/qgyOryd+7f2tEMVONxZ+/or2VNWWqCOgXXsIzNz8itFOoPPffzIVIkgkBFJ5d2IP1mFYAijJnNNvbg== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=none; dmarc=none; dkim=none; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=outlook.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=yRQ5rqLjnWkuwjPHMnU6xAZP9aa5pMgZU4ftDWCBHyY=; b=d+FnTnEjmdz5xwBIwGNs1gNYpp5UG6zXadsp1eyHvbd5FBN5DV7RPJifNU8Q7L+G0ip0P4fQPgM9+6eLHOIZIkpsJN5SHOHbeCsnREpKm0yrGptJmNtX83OiYRWWGjWR5sq9a18xsnyMk7MpIiHKCVmQy6Yw/scclHGhaTUSAKdoHFULq2yCJdqNHdyr/QX6nUfbwPNQsuRTd4l/Vzvmh/Be3Yq8QjH/7ViXyoFiXjHHME3gmmCUifl3qf6CPP99wThSM64/aoWIMtLREMEOIBBtmSC06DHLTpLXHVm+e2UWD/RRVHVjm0T61su2rIQ6UjIDf3illTp6mKIUueRbGA== Received: from CH3PR84MB3424.NAMPRD84.PROD.OUTLOOK.COM (2603:10b6:610:1c4::17) by DS0PR84MB3589.NAMPRD84.PROD.OUTLOOK.COM (2603:10b6:8:1b8::16) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.8606.31; Mon, 7 Apr 2025 20:08:21 +0000 Received: from CH3PR84MB3424.NAMPRD84.PROD.OUTLOOK.COM ([fe80::5c77:7a58:48ed:9aef]) by CH3PR84MB3424.NAMPRD84.PROD.OUTLOOK.COM ([fe80::5c77:7a58:48ed:9aef%5]) with mapi id 15.20.8606.033; Mon, 7 Apr 2025 20:08:21 +0000 From: Morgan Smith Date: Mon, 7 Apr 2025 16:07:49 -0400 Message-ID: X-Mailer: git-send-email 2.49.0 In-Reply-To: <2141283854b61187d507f0dfaf768e3416e09845.1744056453.git.Morgan.J.Smith@outlook.com> References: <2141283854b61187d507f0dfaf768e3416e09845.1744056453.git.Morgan.J.Smith@outlook.com> X-ClientProxiedBy: YT4PR01CA0037.CANPRD01.PROD.OUTLOOK.COM (2603:10b6:b01:fe::10) To CH3PR84MB3424.NAMPRD84.PROD.OUTLOOK.COM (2603:10b6:610:1c4::17) X-Microsoft-Original-Message-ID: <84599b0ae085f18015a7b30511d10cb4625cabcc.1744056453.git.Morgan.J.Smith@outlook.com> MIME-Version: 1.0 X-MS-Exchange-MessageSentRepresentingType: 1 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: CH3PR84MB3424:EE_|DS0PR84MB3589:EE_ X-MS-Office365-Filtering-Correlation-Id: e9d294bb-b1ee-4689-d0ce-08dd760ff1a5 X-Microsoft-Antispam: BCL:0; ARA:14566002|461199028|8060799006|15080799006|7092599003|19110799003|5072599009|41001999003|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g1qXimipWwn5WABOO8WKWXTBEsDFKu4gKyJNgJ6+cz0Jew4JHoRMqAzGScFadTDJex2WuOCNXQYoqr83dlTwTPQC3eQWHs2ESE8M8JvwPHAnu9Jbl6rmm7gpfu5BOVqTFUj28d4lu2XbVbyoUs3259X/kA2kSDaERE75m2sAdGNa739XJqZDOEZ5+DSJc2NtVz7Bur4jx4afqV3xQA29Mi3aggEHT/aXxXgln4II98k7ivmo5fRwQ0nMrdr5TcjOBkAddeld0IJaqPG9cSfYFPFXb9twZP13fbZOhR6N3VM4Zxo/sOiDakjISLtxnmqXpNFGvTOTTwWjOhalXmhbfQdOsxb9Kp/I2V4ObPuUgIDnC2HT5MbB1gQa7FPLHFntxUWZ3IoNepaMLqGDouLN7M9jc8EbyXQ2e8thaTGTuksfroecfTzu3VwEJVP6ql7bBl9HJWspxlPM83jUNZhxhSua/qoQmACb8KgIIYQM/FDN X-OriginatorOrg: outlook.com X-MS-Exchange-CrossTenant-Network-Message-Id: e9d294bb-b1ee-4689-d0ce-08dd760ff1a5 X-MS-Exchange-CrossTenant-AuthSource: CH3PR84MB3424.NAMPRD84.PROD.OUTLOOK.COM X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 07 Apr 2025 20:08:21.0501 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 84df9e7f-e9f6-40af-b435-aaaaaaaaaaaa X-MS-Exchange-CrossTenant-RMS-PersistedConsumerOrg: 00000000-0000-0000-0000-000000000000 X-MS-Exchange-Transport-CrossTenantHeadersStamped: DS0PR84MB3589 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 * gnu/packages/rust.scm (rust-1.56, rust-1.57, rust-1.58, rust-1.59, rust-1.60, rust-1.61, rust-1.62, rust-1.63, rust-1.64, rust-1.65, rust-1.66, rust-1.67, rust-1.68, rust-1.69, rust-1.70, rust-1.71, rust-1.73, rust-1.74, rust-1.75): Delete variable. * gnu/local.mk: Remove rust-1.64-fix-riscv64-bootstrap.patch. * gnu/packages/patches/rust-1.64-fix-riscv64-bootstrap.patch: Delete. Change-Id: Iee5c46c8e4b1d899cc5acbceb5cef04c25aa2801 --- gnu/local.mk | 1 - .../rust-1.64-fix-riscv64-bootstrap.patch | 565 ------------------ gnu/packages/rust.scm | 397 ------------ 3 files changed, 963 deletions(-) delete mode 100644 gnu/packages/patches/rust-1.64-fix-riscv64-bootstrap.patch diff --git a/gnu/local.mk b/gnu/local.mk index 72a6310e4c..f48e45bb47 100644 --- a/gnu/local.mk +++ b/gnu/local.mk @@ -2202,7 +2202,6 @@ dist_patch_DATA = \ %D%/packages/patches/ruby-mustache-1.1.1-fix-race-condition-tests.patch \ %D%/packages/patches/ruby-nokogiri.patch \ %D%/packages/patches/ruby-x25519-automatic-fallback-non-x86_64.patch \ - %D%/packages/patches/rust-1.64-fix-riscv64-bootstrap.patch \ %D%/packages/patches/rust-1.70-fix-rustix-build.patch \ %D%/packages/patches/rust-1.78-unwinding-fix.patch \ %D%/packages/patches/rust-1.81-fix-riscv64-bootstrap.patch \ diff --git a/gnu/packages/patches/rust-1.64-fix-riscv64-bootstrap.patch b/gnu/packages/patches/rust-1.64-fix-riscv64-bootstrap.patch deleted file mode 100644 index 4567f81224..0000000000 --- a/gnu/packages/patches/rust-1.64-fix-riscv64-bootstrap.patch +++ /dev/null @@ -1,565 +0,0 @@ -https://github.com/rust-lang/rust/commit/263edd43c5255084292329423c61a9d69715ebfa.patch -https://github.com/rust-lang/rust/issues/102155 -Issue seen on native builds on riscv64 across multiple Linux -Distributions. An alternative workaround appears to be building stage 1 -with debug enabled. - -From 27412d1e3e128349bc515c16ce882860e20f037d Mon Sep 17 00:00:00 2001 -From: 5225225 <5225225@mailbox.org> -Date: Thu, 14 Jul 2022 22:42:47 +0100 -Subject: [PATCH] Use constant eval to do strict validity checks - ---- - Cargo.lock | 1 + - .../src/intrinsics/mod.rs | 15 +---- - compiler/rustc_codegen_ssa/Cargo.toml | 1 + - compiler/rustc_codegen_ssa/src/mir/block.rs | 9 ++- - .../src/const_eval/machine.rs | 2 +- - .../src/interpret/intrinsics.rs | 56 ++++++++-------- - compiler/rustc_const_eval/src/lib.rs | 6 ++ - .../src/might_permit_raw_init.rs | 40 +++++++++++ - compiler/rustc_middle/src/query/mod.rs | 8 +++ - compiler/rustc_middle/src/ty/query.rs | 1 + - compiler/rustc_query_impl/src/keys.rs | 12 +++- - compiler/rustc_target/src/abi/mod.rs | 38 +++++------ - .../intrinsics/panic-uninitialized-zeroed.rs | 66 ++++++++++++------- - 13 files changed, 161 insertions(+), 94 deletions(-) - create mode 100644 compiler/rustc_const_eval/src/might_permit_raw_init.rs - -diff --git a/Cargo.lock b/Cargo.lock -index 147d47044078a..dd6f0345affd0 100644 ---- a/Cargo.lock -+++ b/Cargo.lock -@@ -3664,6 +3664,7 @@ dependencies = [ - "rustc_arena", - "rustc_ast", - "rustc_attr", -+ "rustc_const_eval", - "rustc_data_structures", - "rustc_errors", - "rustc_fs_util", -diff --git a/compiler/rustc_codegen_cranelift/src/intrinsics/mod.rs b/compiler/rustc_codegen_cranelift/src/intrinsics/mod.rs -index eafae1cdc8af0..4b2207f375879 100644 ---- a/compiler/rustc_codegen_cranelift/src/intrinsics/mod.rs -+++ b/compiler/rustc_codegen_cranelift/src/intrinsics/mod.rs -@@ -58,7 +58,6 @@ pub(crate) use llvm::codegen_llvm_intrinsic_call; - use rustc_middle::ty::print::with_no_trimmed_paths; - use rustc_middle::ty::subst::SubstsRef; - use rustc_span::symbol::{kw, sym, Symbol}; --use rustc_target::abi::InitKind; - - use crate::prelude::*; - use cranelift_codegen::ir::AtomicRmwOp; -@@ -672,12 +671,7 @@ fn codegen_regular_intrinsic_call<'tcx>( - return; - } - -- if intrinsic == sym::assert_zero_valid -- && !layout.might_permit_raw_init( -- fx, -- InitKind::Zero, -- fx.tcx.sess.opts.unstable_opts.strict_init_checks) { -- -+ if intrinsic == sym::assert_zero_valid && !fx.tcx.permits_zero_init(layout) { - with_no_trimmed_paths!({ - crate::base::codegen_panic( - fx, -@@ -688,12 +682,7 @@ fn codegen_regular_intrinsic_call<'tcx>( - return; - } - -- if intrinsic == sym::assert_uninit_valid -- && !layout.might_permit_raw_init( -- fx, -- InitKind::Uninit, -- fx.tcx.sess.opts.unstable_opts.strict_init_checks) { -- -+ if intrinsic == sym::assert_uninit_valid && !fx.tcx.permits_uninit_init(layout) { - with_no_trimmed_paths!({ - crate::base::codegen_panic( - fx, -diff --git a/compiler/rustc_codegen_ssa/Cargo.toml b/compiler/rustc_codegen_ssa/Cargo.toml -index faabea92f5a6c..81c8b9ceb136e 100644 ---- a/compiler/rustc_codegen_ssa/Cargo.toml -+++ b/compiler/rustc_codegen_ssa/Cargo.toml -@@ -40,6 +40,7 @@ rustc_metadata = { path = "../rustc_metadata" } - rustc_query_system = { path = "../rustc_query_system" } - rustc_target = { path = "../rustc_target" } - rustc_session = { path = "../rustc_session" } -+rustc_const_eval = { path = "../rustc_const_eval" } - - [dependencies.object] - version = "0.29.0" -diff --git a/compiler/rustc_codegen_ssa/src/mir/block.rs b/compiler/rustc_codegen_ssa/src/mir/block.rs -index 745da821c9d76..773c55cf551d5 100644 ---- a/compiler/rustc_codegen_ssa/src/mir/block.rs -+++ b/compiler/rustc_codegen_ssa/src/mir/block.rs -@@ -22,7 +22,7 @@ use rustc_span::source_map::Span; - use rustc_span::{sym, Symbol}; - use rustc_symbol_mangling::typeid_for_fnabi; - use rustc_target::abi::call::{ArgAbi, FnAbi, PassMode}; --use rustc_target::abi::{self, HasDataLayout, InitKind, WrappingRange}; -+use rustc_target::abi::{self, HasDataLayout, WrappingRange}; - use rustc_target::spec::abi::Abi; - - /// Used by `FunctionCx::codegen_terminator` for emitting common patterns -@@ -528,7 +528,6 @@ impl<'a, 'tcx, Bx: BuilderMethods<'a, 'tcx>> FunctionCx<'a, 'tcx, Bx> { - source_info: mir::SourceInfo, - target: Option, - cleanup: Option, -- strict_validity: bool, - ) -> bool { - // Emit a panic or a no-op for `assert_*` intrinsics. - // These are intrinsics that compile to panics so that we can get a message -@@ -547,12 +546,13 @@ impl<'a, 'tcx, Bx: BuilderMethods<'a, 'tcx>> FunctionCx<'a, 'tcx, Bx> { - }); - if let Some(intrinsic) = panic_intrinsic { - use AssertIntrinsic::*; -+ - let ty = instance.unwrap().substs.type_at(0); - let layout = bx.layout_of(ty); - let do_panic = match intrinsic { - Inhabited => layout.abi.is_uninhabited(), -- ZeroValid => !layout.might_permit_raw_init(bx, InitKind::Zero, strict_validity), -- UninitValid => !layout.might_permit_raw_init(bx, InitKind::Uninit, strict_validity), -+ ZeroValid => !bx.tcx().permits_zero_init(layout), -+ UninitValid => !bx.tcx().permits_uninit_init(layout), - }; - if do_panic { - let msg_str = with_no_visible_paths!({ -@@ -687,7 +687,6 @@ impl<'a, 'tcx, Bx: BuilderMethods<'a, 'tcx>> FunctionCx<'a, 'tcx, Bx> { - source_info, - target, - cleanup, -- self.cx.tcx().sess.opts.unstable_opts.strict_init_checks, - ) { - return; - } -diff --git a/compiler/rustc_const_eval/src/const_eval/machine.rs b/compiler/rustc_const_eval/src/const_eval/machine.rs -index 29ab1d187719c..e00e667fb71e2 100644 ---- a/compiler/rustc_const_eval/src/const_eval/machine.rs -+++ b/compiler/rustc_const_eval/src/const_eval/machine.rs -@@ -104,7 +104,7 @@ pub struct CompileTimeInterpreter<'mir, 'tcx> { - } - - impl<'mir, 'tcx> CompileTimeInterpreter<'mir, 'tcx> { -- pub(super) fn new(const_eval_limit: Limit, can_access_statics: bool) -> Self { -+ pub(crate) fn new(const_eval_limit: Limit, can_access_statics: bool) -> Self { - CompileTimeInterpreter { - steps_remaining: const_eval_limit.0, - stack: Vec::new(), -diff --git a/compiler/rustc_const_eval/src/interpret/intrinsics.rs b/compiler/rustc_const_eval/src/interpret/intrinsics.rs -index e2a8a9891f72f..7827fb8395b7f 100644 ---- a/compiler/rustc_const_eval/src/interpret/intrinsics.rs -+++ b/compiler/rustc_const_eval/src/interpret/intrinsics.rs -@@ -15,7 +15,7 @@ use rustc_middle::ty::layout::LayoutOf as _; - use rustc_middle::ty::subst::SubstsRef; - use rustc_middle::ty::{Ty, TyCtxt}; - use rustc_span::symbol::{sym, Symbol}; --use rustc_target::abi::{Abi, Align, InitKind, Primitive, Size}; -+use rustc_target::abi::{Abi, Align, Primitive, Size}; - - use super::{ - util::ensure_monomorphic_enough, CheckInAllocMsg, ImmTy, InterpCx, Machine, OpTy, PlaceTy, -@@ -413,35 +413,33 @@ impl<'mir, 'tcx: 'mir, M: Machine<'mir, 'tcx>> InterpCx<'mir, 'tcx, M> { - ), - )?; - } -- if intrinsic_name == sym::assert_zero_valid -- && !layout.might_permit_raw_init( -- self, -- InitKind::Zero, -- self.tcx.sess.opts.unstable_opts.strict_init_checks, -- ) -- { -- M::abort( -- self, -- format!( -- "aborted execution: attempted to zero-initialize type `{}`, which is invalid", -- ty -- ), -- )?; -+ -+ if intrinsic_name == sym::assert_zero_valid { -+ let should_panic = !self.tcx.permits_zero_init(layout); -+ -+ if should_panic { -+ M::abort( -+ self, -+ format!( -+ "aborted execution: attempted to zero-initialize type `{}`, which is invalid", -+ ty -+ ), -+ )?; -+ } - } -- if intrinsic_name == sym::assert_uninit_valid -- && !layout.might_permit_raw_init( -- self, -- InitKind::Uninit, -- self.tcx.sess.opts.unstable_opts.strict_init_checks, -- ) -- { -- M::abort( -- self, -- format!( -- "aborted execution: attempted to leave type `{}` uninitialized, which is invalid", -- ty -- ), -- )?; -+ -+ if intrinsic_name == sym::assert_uninit_valid { -+ let should_panic = !self.tcx.permits_uninit_init(layout); -+ -+ if should_panic { -+ M::abort( -+ self, -+ format!( -+ "aborted execution: attempted to leave type `{}` uninitialized, which is invalid", -+ ty -+ ), -+ )?; -+ } - } - } - sym::simd_insert => { -diff --git a/compiler/rustc_const_eval/src/lib.rs b/compiler/rustc_const_eval/src/lib.rs -index d65d4f7eb720e..72ac6af685dc4 100644 ---- a/compiler/rustc_const_eval/src/lib.rs -+++ b/compiler/rustc_const_eval/src/lib.rs -@@ -33,11 +33,13 @@ extern crate rustc_middle; - pub mod const_eval; - mod errors; - pub mod interpret; -+mod might_permit_raw_init; - pub mod transform; - pub mod util; - - use rustc_middle::ty; - use rustc_middle::ty::query::Providers; -+use rustc_target::abi::InitKind; - - pub fn provide(providers: &mut Providers) { - const_eval::provide(providers); -@@ -59,4 +61,8 @@ pub fn provide(providers: &mut Providers) { - let (param_env, value) = param_env_and_value.into_parts(); - const_eval::deref_mir_constant(tcx, param_env, value) - }; -+ providers.permits_uninit_init = -+ |tcx, ty| might_permit_raw_init::might_permit_raw_init(tcx, ty, InitKind::Uninit); -+ providers.permits_zero_init = -+ |tcx, ty| might_permit_raw_init::might_permit_raw_init(tcx, ty, InitKind::Zero); - } -diff --git a/compiler/rustc_const_eval/src/might_permit_raw_init.rs b/compiler/rustc_const_eval/src/might_permit_raw_init.rs -new file mode 100644 -index 0000000000000..f971c2238c7bb ---- /dev/null -+++ b/compiler/rustc_const_eval/src/might_permit_raw_init.rs -@@ -0,0 +1,40 @@ -+use crate::const_eval::CompileTimeInterpreter; -+use crate::interpret::{InterpCx, MemoryKind, OpTy}; -+use rustc_middle::ty::layout::LayoutCx; -+use rustc_middle::ty::{layout::TyAndLayout, ParamEnv, TyCtxt}; -+use rustc_session::Limit; -+use rustc_target::abi::InitKind; -+ -+pub fn might_permit_raw_init<'tcx>( -+ tcx: TyCtxt<'tcx>, -+ ty: TyAndLayout<'tcx>, -+ kind: InitKind, -+) -> bool { -+ let strict = tcx.sess.opts.unstable_opts.strict_init_checks; -+ -+ if strict { -+ let machine = CompileTimeInterpreter::new(Limit::new(0), false); -+ -+ let mut cx = InterpCx::new(tcx, rustc_span::DUMMY_SP, ParamEnv::reveal_all(), machine); -+ -+ let allocated = cx -+ .allocate(ty, MemoryKind::Machine(crate::const_eval::MemoryKind::Heap)) -+ .expect("OOM: failed to allocate for uninit check"); -+ -+ if kind == InitKind::Zero { -+ cx.write_bytes_ptr( -+ allocated.ptr, -+ std::iter::repeat(0_u8).take(ty.layout.size().bytes_usize()), -+ ) -+ .expect("failed to write bytes for zero valid check"); -+ } -+ -+ let ot: OpTy<'_, _> = allocated.into(); -+ -+ // Assume that if it failed, it's a validation failure. -+ cx.validate_operand(&ot).is_ok() -+ } else { -+ let layout_cx = LayoutCx { tcx, param_env: ParamEnv::reveal_all() }; -+ ty.might_permit_raw_init(&layout_cx, kind) -+ } -+} -diff --git a/compiler/rustc_middle/src/query/mod.rs b/compiler/rustc_middle/src/query/mod.rs -index bdae7e5fcd6b1..0581ef41f66c2 100644 ---- a/compiler/rustc_middle/src/query/mod.rs -+++ b/compiler/rustc_middle/src/query/mod.rs -@@ -2053,4 +2053,12 @@ rustc_queries! { - desc { |tcx| "looking up generator diagnostic data of `{}`", tcx.def_path_str(key) } - separate_provide_extern - } -+ -+ query permits_uninit_init(key: TyAndLayout<'tcx>) -> bool { -+ desc { "checking to see if {:?} permits being left uninit", key.ty } -+ } -+ -+ query permits_zero_init(key: TyAndLayout<'tcx>) -> bool { -+ desc { "checking to see if {:?} permits being left zeroed", key.ty } -+ } - } -diff --git a/compiler/rustc_middle/src/ty/query.rs b/compiler/rustc_middle/src/ty/query.rs -index 3d662ed5de4ba..2452bcf6a61b8 100644 ---- a/compiler/rustc_middle/src/ty/query.rs -+++ b/compiler/rustc_middle/src/ty/query.rs -@@ -28,6 +28,7 @@ use crate::traits::query::{ - use crate::traits::specialization_graph; - use crate::traits::{self, ImplSource}; - use crate::ty::fast_reject::SimplifiedType; -+use crate::ty::layout::TyAndLayout; - use crate::ty::subst::{GenericArg, SubstsRef}; - use crate::ty::util::AlwaysRequiresDrop; - use crate::ty::GeneratorDiagnosticData; -diff --git a/compiler/rustc_query_impl/src/keys.rs b/compiler/rustc_query_impl/src/keys.rs -index 6fbafeb1d32b3..5477431431374 100644 ---- a/compiler/rustc_query_impl/src/keys.rs -+++ b/compiler/rustc_query_impl/src/keys.rs -@@ -6,7 +6,7 @@ use rustc_middle::mir; - use rustc_middle::traits; - use rustc_middle::ty::fast_reject::SimplifiedType; - use rustc_middle::ty::subst::{GenericArg, SubstsRef}; --use rustc_middle::ty::{self, Ty, TyCtxt}; -+use rustc_middle::ty::{self, layout::TyAndLayout, Ty, TyCtxt}; - use rustc_span::symbol::{Ident, Symbol}; - use rustc_span::{Span, DUMMY_SP}; - -@@ -385,6 +385,16 @@ impl<'tcx> Key for Ty<'tcx> { - } - } - -+impl<'tcx> Key for TyAndLayout<'tcx> { -+ #[inline(always)] -+ fn query_crate_is_local(&self) -> bool { -+ true -+ } -+ fn default_span(&self, _: TyCtxt<'_>) -> Span { -+ DUMMY_SP -+ } -+} -+ - impl<'tcx> Key for (Ty<'tcx>, Ty<'tcx>) { - #[inline(always)] - fn query_crate_is_local(&self) -> bool { -diff --git a/compiler/rustc_target/src/abi/mod.rs b/compiler/rustc_target/src/abi/mod.rs -index d1eafd6ac5fb8..6f4d073d70486 100644 ---- a/compiler/rustc_target/src/abi/mod.rs -+++ b/compiler/rustc_target/src/abi/mod.rs -@@ -1372,7 +1372,7 @@ pub struct PointeeInfo { - - /// Used in `might_permit_raw_init` to indicate the kind of initialisation - /// that is checked to be valid --#[derive(Copy, Clone, Debug)] -+#[derive(Copy, Clone, Debug, PartialEq, Eq)] - pub enum InitKind { - Zero, - Uninit, -@@ -1487,14 +1487,18 @@ impl<'a, Ty> TyAndLayout<'a, Ty> { - /// - /// `init_kind` indicates if the memory is zero-initialized or left uninitialized. - /// -- /// `strict` is an opt-in debugging flag added in #97323 that enables more checks. -+ /// This code is intentionally conservative, and will not detect -+ /// * zero init of an enum whose 0 variant does not allow zero initialization -+ /// * making uninitialized types who have a full valid range (ints, floats, raw pointers) -+ /// * Any form of invalid value being made inside an array (unless the value is uninhabited) - /// -- /// This is conservative: in doubt, it will answer `true`. -+ /// A strict form of these checks that uses const evaluation exists in -+ /// `rustc_const_eval::might_permit_raw_init`, and a tracking issue for making these checks -+ /// stricter is . - /// -- /// FIXME: Once we removed all the conservatism, we could alternatively -- /// create an all-0/all-undef constant and run the const value validator to see if -- /// this is a valid value for the given type. -- pub fn might_permit_raw_init(self, cx: &C, init_kind: InitKind, strict: bool) -> bool -+ /// FIXME: Once all the conservatism is removed from here, and the checks are ran by default, -+ /// we can use the const evaluation checks always instead. -+ pub fn might_permit_raw_init(self, cx: &C, init_kind: InitKind) -> bool - where - Self: Copy, - Ty: TyAbiInterface<'a, C>, -@@ -1507,13 +1511,8 @@ impl<'a, Ty> TyAndLayout<'a, Ty> { - s.valid_range(cx).contains(0) - } - InitKind::Uninit => { -- if strict { -- // The type must be allowed to be uninit (which means "is a union"). -- s.is_uninit_valid() -- } else { -- // The range must include all values. -- s.is_always_valid(cx) -- } -+ // The range must include all values. -+ s.is_always_valid(cx) - } - } - }; -@@ -1534,19 +1533,12 @@ impl<'a, Ty> TyAndLayout<'a, Ty> { - // If we have not found an error yet, we need to recursively descend into fields. - match &self.fields { - FieldsShape::Primitive | FieldsShape::Union { .. } => {} -- FieldsShape::Array { count, .. } => { -+ FieldsShape::Array { .. } => { - // FIXME(#66151): For now, we are conservative and do not check arrays by default. -- if strict -- && *count > 0 -- && !self.field(cx, 0).might_permit_raw_init(cx, init_kind, strict) -- { -- // Found non empty array with a type that is unhappy about this kind of initialization -- return false; -- } - } - FieldsShape::Arbitrary { offsets, .. } => { - for idx in 0..offsets.len() { -- if !self.field(cx, idx).might_permit_raw_init(cx, init_kind, strict) { -+ if !self.field(cx, idx).might_permit_raw_init(cx, init_kind) { - // We found a field that is unhappy with this kind of initialization. - return false; - } -diff --git a/src/test/ui/intrinsics/panic-uninitialized-zeroed.rs b/src/test/ui/intrinsics/panic-uninitialized-zeroed.rs -index 3ffd35ecdb8da..255151a96032c 100644 ---- a/src/test/ui/intrinsics/panic-uninitialized-zeroed.rs -+++ b/src/test/ui/intrinsics/panic-uninitialized-zeroed.rs -@@ -57,6 +57,13 @@ enum LR_NonZero { - - struct ZeroSized; - -+#[allow(dead_code)] -+#[repr(i32)] -+enum ZeroIsValid { -+ Zero(u8) = 0, -+ One(NonNull<()>) = 1, -+} -+ - fn test_panic_msg(op: impl (FnOnce() -> T) + panic::UnwindSafe, msg: &str) { - let err = panic::catch_unwind(op).err(); - assert_eq!( -@@ -152,33 +159,12 @@ fn main() { - "attempted to zero-initialize type `*const dyn core::marker::Send`, which is invalid" - ); - -- /* FIXME(#66151) we conservatively do not error here yet. -- test_panic_msg( -- || mem::uninitialized::(), -- "attempted to leave type `LR_NonZero` uninitialized, which is invalid" -- ); -- test_panic_msg( -- || mem::zeroed::(), -- "attempted to zero-initialize type `LR_NonZero`, which is invalid" -- ); -- -- test_panic_msg( -- || mem::uninitialized::>(), -- "attempted to leave type `std::mem::ManuallyDrop` uninitialized, \ -- which is invalid" -- ); -- test_panic_msg( -- || mem::zeroed::>(), -- "attempted to zero-initialize type `std::mem::ManuallyDrop`, \ -- which is invalid" -- ); -- */ -- - test_panic_msg( - || mem::uninitialized::<(NonNull, u32, u32)>(), - "attempted to leave type `(core::ptr::non_null::NonNull, u32, u32)` uninitialized, \ - which is invalid" - ); -+ - test_panic_msg( - || mem::zeroed::<(NonNull, u32, u32)>(), - "attempted to zero-initialize type `(core::ptr::non_null::NonNull, u32, u32)`, \ -@@ -196,11 +182,23 @@ fn main() { - which is invalid" - ); - -+ test_panic_msg( -+ || mem::uninitialized::(), -+ "attempted to leave type `LR_NonZero` uninitialized, which is invalid" -+ ); -+ -+ test_panic_msg( -+ || mem::uninitialized::>(), -+ "attempted to leave type `core::mem::manually_drop::ManuallyDrop` uninitialized, \ -+ which is invalid" -+ ); -+ - test_panic_msg( - || mem::uninitialized::(), - "attempted to leave type `NoNullVariant` uninitialized, \ - which is invalid" - ); -+ - test_panic_msg( - || mem::zeroed::(), - "attempted to zero-initialize type `NoNullVariant`, \ -@@ -212,10 +210,12 @@ fn main() { - || mem::uninitialized::(), - "attempted to leave type `bool` uninitialized, which is invalid" - ); -+ - test_panic_msg( - || mem::uninitialized::(), - "attempted to leave type `LR` uninitialized, which is invalid" - ); -+ - test_panic_msg( - || mem::uninitialized::>(), - "attempted to leave type `core::mem::manually_drop::ManuallyDrop` uninitialized, which is invalid" -@@ -229,6 +229,7 @@ fn main() { - let _val = mem::zeroed::>(); - let _val = mem::zeroed::>>(); - let _val = mem::zeroed::<[!; 0]>(); -+ let _val = mem::zeroed::(); - let _val = mem::uninitialized::>(); - let _val = mem::uninitialized::<[!; 0]>(); - let _val = mem::uninitialized::<()>(); -@@ -259,12 +260,33 @@ fn main() { - || mem::zeroed::<[NonNull<()>; 1]>(), - "attempted to zero-initialize type `[core::ptr::non_null::NonNull<()>; 1]`, which is invalid" - ); -+ -+ // FIXME(#66151) we conservatively do not error here yet (by default). -+ test_panic_msg( -+ || mem::zeroed::(), -+ "attempted to zero-initialize type `LR_NonZero`, which is invalid" -+ ); -+ -+ test_panic_msg( -+ || mem::zeroed::>(), -+ "attempted to zero-initialize type `core::mem::manually_drop::ManuallyDrop`, \ -+ which is invalid" -+ ); - } else { - // These are UB because they have not been officially blessed, but we await the resolution - // of before doing - // anything about that. - let _val = mem::uninitialized::(); - let _val = mem::uninitialized::<*const ()>(); -+ -+ // These are UB, but best to test them to ensure we don't become unintentionally -+ // stricter. -+ -+ // It's currently unchecked to create invalid enums and values inside arrays. -+ let _val = mem::zeroed::(); -+ let _val = mem::zeroed::<[LR_NonZero; 1]>(); -+ let _val = mem::zeroed::<[NonNull<()>; 1]>(); -+ let _val = mem::uninitialized::<[NonNull<()>; 1]>(); - } - } - } diff --git a/gnu/packages/rust.scm b/gnu/packages/rust.scm index 98be6d95ce..4b0e9a3666 100644 --- a/gnu/packages/rust.scm +++ b/gnu/packages/rust.scm @@ -503,403 +503,6 @@ (define-public rust-1.75 ;; Dual licensed. (license (list license:asl2.0 license:expat)))) -(define-public rust-1.56 - (let ((base-rust (rust-bootstrapped-package - rust-1.55 "1.56.1" - "04cmqx7nn63hzz7z27b2b0dj2qx18rck9ifvip43s6dampx8v2f3"))) - (package - (inherit base-rust) - (arguments - (substitute-keyword-arguments - (strip-keyword-arguments '(#:validate-runpath?) - (package-arguments base-rust)) - ((#:phases phases) - `(modify-phases ,phases - (delete 'add-cc-shim-to-path) - (add-after 'patch-generated-file-shebangs 'patch-cargo-checksums - (lambda _ - (substitute* "Cargo.lock" - (("(checksum = )\".*\"" all name) - (string-append name "\"" ,%cargo-reference-hash "\""))) - (generate-all-checksums "vendor")))))))))) - -(define-public rust-1.57 - (rust-bootstrapped-package - ;; Verified that it *doesn't* build with 1.55. e.g.: - ;; * feature `edition2021` is required - rust-1.56 "1.57.0" "06jw8ka2p3kls8p0gd4p0chhhb1ia1mlvj96zn78n7qvp71zjiim")) - -(define-public rust-1.58 - (rust-bootstrapped-package - ;; Verified that it *doesn't* build with 1.56. e.g.: - ;; * error: attributes starting with `rustc` are reserved for use by the - ;; `rustc` compiler - ;; * error: cannot find attribute `rustc_do_not_const_check` in this scope - ;; * error[E0522]: definition of an unknown language item: - ;; `const_eval_select_ct` - rust-1.57 "1.58.1" "1iq7kj16qfpkx8gvw50d8rf7glbm6s0pj2y1qkrz7mi56vfsyfd8")) - -(define-public rust-1.59 - (let ((base-rust - (rust-bootstrapped-package - ;; Verified that it *doesn't* build with 1.57. e.g.: - ;; * error: `doc(primitive)` should never have been stable - ;; * error[E0522]: definition of an unknown language item: - ;; `generator_return` - ;; * error[E0206]: the trait `Copy` may not be implemented for this type - rust-1.58 "1.59.0" "1yc5bwcbmbwyvpfq7zvra78l0r8y3lbv60kbr62fzz2vx2pfxj57"))) - (package - (inherit base-rust) - (arguments - (if (target-riscv64?) - (substitute-keyword-arguments (package-arguments base-rust) - ((#:phases phases) - `(modify-phases ,phases - (add-after 'unpack 'revert-riscv-pause-instruction - (lambda _ - ;; This fails with: - ;; error: unknown directive, referring to '.insn'. - ;; This is due to building with llvm < 14. - ;; https://github.com/rust-lang/stdarch/issues/1291 - ;; Partial roll-back from this commit: - ;; https://github.com/rust-lang/stdarch/pull/1271 - (substitute* - "library/stdarch/crates/core_arch/src/riscv_shared/mod.rs" - (("\\.insn i 0x0F, 0, x0, x0, 0x010") ".word 0x0100000F"))))))) - (package-arguments base-rust)))))) - -(define-public rust-1.60 - (rust-bootstrapped-package - ;; Verified that it *doesn't* build with 1.58. e.g.: - ;; * error: unknown codegen option: `symbol-mangling-version` - rust-1.59 "1.60.0" "1drqr0a26x1rb2w3kj0i6abhgbs3jx5qqkrcwbwdlx7n3inq5ji0")) - -(define-public rust-1.61 - (let ((base-rust - (rust-bootstrapped-package - rust-1.60 "1.61.0" "1vfs05hkf9ilk19b2vahqn8l6k17pl9nc1ky9kgspaascx8l62xd"))) - (package - (inherit base-rust) - (source - (origin - (inherit (package-source base-rust)) - (snippet - '(begin - (for-each delete-file-recursively - '("src/llvm-project" - "vendor/openssl-src/openssl" - "vendor/tikv-jemalloc-sys/jemalloc")) - ;; Remove vendored dynamically linked libraries. - ;; find . -not -type d -executable -exec file {} \+ | grep ELF - (delete-file "vendor/vte/vim10m_match") - (delete-file "vendor/vte/vim10m_table") - ;; Also remove the bundled (mostly Windows) libraries. - (for-each delete-file - (find-files "vendor" "\\.(a|dll|exe|lib)$"))))))))) - -(define-public rust-1.62 - (rust-bootstrapped-package - rust-1.61 "1.62.1" "0gqkg34ic77dcvsz69qbdng6g3zfhl6hnhx7ha1mjkyrzipvxb3j")) - -(define-public rust-1.63 - (rust-bootstrapped-package - rust-1.62 "1.63.0" "1l4rrbzhxv88pnfq94nbyb9m6lfnjwixma3mwjkmvvs2aqlq158z")) - -(define-public rust-1.64 - (let ((base-rust - (rust-bootstrapped-package - rust-1.63 "1.64.0" "018j720b2n12slp4xk64jc6shkncd46d621qdyzh2a8s3r49zkdk"))) - (package - (inherit base-rust) - (source - (origin - (inherit (package-source base-rust)) - (snippet - '(begin - (for-each delete-file-recursively - '("src/llvm-project" - "vendor/openssl-src/openssl" - "vendor/tikv-jemalloc-sys/jemalloc")) - ;; ERROR: could not find native static library - ;; `rustix_outline_powerpc64`, perhaps an -L flag is missing? - ;; Adjust rustix to always build with cc. - (substitute* "src/bootstrap/Cargo.lock" - (("\"errno\",") "\"cc\",\n \"errno\",")) - ;; Add a dependency on the the 'cc' feature of rustix. - (substitute* "vendor/fd-lock/Cargo.toml" - (("\"fs\"") "\"fs\", \"cc\"")) - ;; Remove vendored dynamically linked libraries. - ;; find . -not -type d -executable -exec file {} \+ | grep ELF - (delete-file "vendor/vte/vim10m_match") - (delete-file "vendor/vte/vim10m_table") - ;; Also remove the bundled (mostly Windows) libraries. - (for-each delete-file - (find-files "vendor" "\\.(a|dll|exe|lib)$")))) - (patches (search-patches "rust-1.64-fix-riscv64-bootstrap.patch")) - (patch-flags '("-p1" "--reverse")))) - (arguments - (substitute-keyword-arguments (package-arguments base-rust) - ((#:phases phases) - `(modify-phases ,phases - (replace 'patch-cargo-checksums - (lambda _ - (substitute* '("Cargo.lock" - "src/bootstrap/Cargo.lock" - "src/tools/rust-analyzer/Cargo.lock") - (("(checksum = )\".*\"" all name) - (string-append name "\"" ,%cargo-reference-hash "\""))) - (generate-all-checksums "vendor")))))))))) - -(define-public rust-1.65 - (let ((base-rust - (rust-bootstrapped-package - rust-1.64 "1.65.0" "0f005kc0vl7qyy298f443i78ibz71hmmh820726bzskpyrkvna2q"))) - (package - (inherit base-rust) - (source - (origin - (inherit (package-source base-rust)) - (patches '()) - (patch-flags '("-p1"))))))) - -(define-public rust-1.66 - (rust-bootstrapped-package - rust-1.65 "1.66.1" "1fjr94gsicsxd2ypz4zm8aad1zdbiccr7qjfbmq8f8f7jhx96g2v")) - -(define-public rust-1.67 - (let ((base-rust - (rust-bootstrapped-package - rust-1.66 "1.67.1" "0vpzv6rm3w1wbni17ryvcw83k5klhghklylfdza3nnp8blz3sj26"))) - (package - (inherit base-rust) - (source - (origin - (inherit (package-source base-rust)) - (snippet - '(begin - (for-each delete-file-recursively - '("src/llvm-project" - "vendor/openssl-src/openssl" - "vendor/tikv-jemalloc-sys/jemalloc")) - ;; Adjust rustix to always build with cc. - (substitute* '("Cargo.lock" - "src/bootstrap/Cargo.lock") - (("\"errno\",") "\"cc\",\n \"errno\",")) - ;; Add a dependency on the the 'cc' feature of rustix. - (substitute* "vendor/fd-lock/Cargo.toml" - (("\"fs\"") "\"fs\", \"cc\"")) - (substitute* "vendor/is-terminal/Cargo.toml" - (("\"termios\"") "\"termios\", \"cc\"")) - ;; Remove vendored dynamically linked libraries. - ;; find . -not -type d -executable -exec file {} \+ | grep ELF - (delete-file "vendor/vte/vim10m_match") - (delete-file "vendor/vte/vim10m_table") - ;; Also remove the bundled (mostly Windows) libraries. - (for-each delete-file - (find-files "vendor" "\\.(a|dll|exe|lib)$")))))) - (inputs (modify-inputs (package-inputs base-rust) - (replace "llvm" llvm-15)))))) - -(define-public rust-1.68 - (rust-bootstrapped-package - rust-1.67 "1.68.2" "15ifyd5jj8rd979dkakp887hgmhndr68pqaqvd2hqkfdywirqcwk")) - -(define-public rust-1.69 - (let ((base-rust - (rust-bootstrapped-package - rust-1.68 "1.69.0" - "03zn7kx5bi5mdfsqfccj4h8gd6abm7spj0kjsfxwlv5dcwc9f1gv"))) - (package - (inherit base-rust) - (source - (origin - (inherit (package-source base-rust)) - (snippet - '(begin - (for-each delete-file-recursively - '("src/llvm-project" - "vendor/openssl-src/openssl" - "vendor/tikv-jemalloc-sys/jemalloc")) - ;; Adjust rustix to always build with cc. - (substitute* '("Cargo.lock" - "src/bootstrap/Cargo.lock") - (("\"errno\",") "\"cc\",\n \"errno\",")) - ;; Add a dependency on the the 'cc' feature of rustix. - (substitute* "vendor/fd-lock/Cargo.toml" - (("\"fs\"") "\"fs\", \"cc\"")) - (substitute* "vendor/is-terminal/Cargo.toml" - (("\"termios\"") "\"termios\", \"cc\"")) - ;; Also remove the bundled (mostly Windows) libraries. - (for-each delete-file - (find-files "vendor" "\\.(a|dll|exe|lib)$"))))))))) - -(define-public rust-1.70 - (let ((base-rust - (rust-bootstrapped-package - rust-1.69 "1.70.0" - "0z6j7d0ni0rmfznv0w3mrf882m11kyh51g2bxkj40l3s1c0axgxj"))) - (package - (inherit base-rust) - (source - (origin - (inherit (package-source base-rust)) - (snippet - '(begin - (for-each delete-file-recursively - '("src/llvm-project" - "vendor/openssl-src/openssl" - "vendor/tikv-jemalloc-sys/jemalloc")) - ;; Adjust rustix to always build with cc. - (substitute* "Cargo.lock" - (("\"errno\",") "\"cc\",\n \"errno\",")) - ;; Add a dependency on the the 'cc' feature of rustix. - (substitute* '("vendor/is-terminal/Cargo.toml" - "vendor/is-terminal-0.4.4/Cargo.toml") - (("\"termios\"") "\"termios\", \"cc\"")) - ;; Also remove the bundled (mostly Windows) libraries. - (for-each delete-file - (find-files "vendor" "\\.(a|dll|exe|lib)$")))) - ;; Rust 1.70 adds the rustix library which depends on the vendored - ;; fd-lock crate. The fd-lock crate uses Outline assembly which expects - ;; a precompiled static library. Enabling the "cc" feature tells the - ;; build.rs script to compile the assembly files instead of searching - ;; for a precompiled library. - (patches (search-patches "rust-1.70-fix-rustix-build.patch"))))))) - -(define-public rust-1.71 - (let ((base-rust - (rust-bootstrapped-package - rust-1.70 "1.71.1" "0bj79syjap1kgpg9pc0r4jxc0zkxwm6phjf3digsfafms580vabg"))) - (package - (inherit base-rust) - (source - (origin - (inherit (package-source base-rust)) - (snippet - '(begin - (for-each delete-file-recursively - '("src/llvm-project" - "vendor/openssl-src/openssl" - "vendor/tikv-jemalloc-sys/jemalloc")) - ;; Adjust rustix to always build with cc. - (substitute* '("Cargo.lock" - "src/tools/cargo/Cargo.lock") - (("\"errno\",") "\"cc\",\n \"errno\",")) - ;; Add a dependency on the the 'cc' feature of rustix. - (substitute* '("vendor/is-terminal/Cargo.toml" - "vendor/is-terminal-0.4.6/Cargo.toml") - (("\"termios\"") "\"termios\", \"cc\"")) - ;; Also remove the bundled (mostly Windows) libraries. - (for-each delete-file - (find-files "vendor" "\\.(a|dll|exe|lib)$")))))) - (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" - (find-files "src/tools" "Cargo.lock")) - (("(checksum = )\".*\"" all name) - (string-append name "\"" ,%cargo-reference-hash "\""))) - (generate-all-checksums "vendor")))))))))) - -(define-public rust-1.72 - (let ((base-rust - (rust-bootstrapped-package - rust-1.71 "1.72.1" "15gqd1jzhnc16a7gjmav4x1v83jjbzyjh1gvcdfvpkajd9gq8j3z"))) - (package - (inherit base-rust) - (source - (origin - (inherit (package-source base-rust)) - (snippet - '(begin - (for-each delete-file-recursively - '("src/llvm-project" - "vendor/openssl-src/openssl" - "vendor/tikv-jemalloc-sys/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 some crates to explicitly use rustix with the libc backend. - (substitute* '("vendor/is-terminal/Cargo.toml" - "vendor/is-terminal-0.4.7/Cargo.toml") - (("\"termios\"") "\"termios\", \"use-libc\"")) - (substitute* "compiler/rustc_driver/Cargo.toml" - (("rustix = \"=0.37.11\"") - (string-append "rustix = { version = \"=0.37.11\"," - " features = [\"use-libc\"] }")))))))))) - -(define-public rust-1.73 - (let ((base-rust (rust-bootstrapped-package rust-1.72 "1.73.0" - "0fmvn7vg3qg9xprgfwv10g3ygy8i4j4bkcxcr1xdy89d3xnjxmln"))) - (package - (inherit base-rust) - (source - (origin - (inherit (package-source base-rust)) - (snippet - '(begin - (for-each delete-file-recursively - '("src/llvm-project" - "vendor/openssl-src/openssl" - "vendor/tikv-jemalloc-sys/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.6.0/Cargo.toml" - (("features = \\[\"fs\"" all) - (string-append all ", \"use-libc\"")))))))))) - -(define-public rust-1.74 - (let ((base-rust (rust-bootstrapped-package rust-1.73 "1.74.1" - "07930r17dkj3dnsrmilywb6p9i2g2jx56ndfpa2wh8crzhi3xnv7"))) - (package - (inherit base-rust) - (source - (origin - (inherit (package-source base-rust)) - (snippet - '(begin - (for-each delete-file-recursively - '("src/llvm-project" - "vendor/openssl-src/openssl" - "vendor/tikv-jemalloc-sys/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/Cargo.toml" - (("features = \\[\"fs\"" all) - (string-append all ", \"use-libc\""))))))) - (arguments - (if (target-riscv64?) - (substitute-keyword-arguments (package-arguments base-rust) - ((#:phases phases) - `(modify-phases ,phases - ;; This phase is no longer needed. - (delete 'revert-riscv-pause-instruction)))) - (package-arguments base-rust)))))) - -(define-public rust-1.75 - (let ((base-rust (rust-bootstrapped-package rust-1.74 "1.75.0" - "1260mf3066ki6y55pvr35lnf54am6z96a3ap3hniwd4xpi2rywsv"))) - (package - (inherit base-rust) - (source - (origin - (inherit (package-source base-rust)) - (patches '())))))) - (define-public rust-1.76 (let ((base-rust (rust-bootstrapped-package rust-1.75 "1.76.0" "08f06shp6l72qrv5fwg1is7yzr6kwj8av0l9h5k243bz781zyp4y"))) From patchwork Mon Apr 7 20:07:50 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Morgan Smith X-Patchwork-Id: 41420 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 4E05027BC4A; Mon, 7 Apr 2025 21:10:00 +0100 (BST) X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on mira.cbaines.net X-Spam-Level: X-Spam-Status: No, score=-6.4 required=5.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED,FREEMAIL_FROM,MAILING_LIST_MULTI,RCVD_IN_DNSWL_BLOCKED, RCVD_IN_VALIDITY_CERTIFIED,RCVD_IN_VALIDITY_RPBL,RCVD_IN_VALIDITY_SAFE, SPF_HELO_PASS,URIBL_BLOCKED autolearn=unavailable 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 65B9F27BC49 for ; Mon, 7 Apr 2025 21:09:57 +0100 (BST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1u1smI-0006IZ-3E; Mon, 07 Apr 2025 16:09:06 -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 1u1smG-0006Hx-U4 for guix-patches@gnu.org; Mon, 07 Apr 2025 16:09:04 -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 1u1smG-0007uW-KD for guix-patches@gnu.org; Mon, 07 Apr 2025 16:09:04 -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:References:In-Reply-To:Date:From:To:Subject; bh=5LgOlzt4Idrhlf8yuamcD+d0iSbXRMEyGQXaKPwTKKE=; b=BbUxj12QcWX3ko9TuU2tmRyI7rcgq0VX3Wnju2UFJStrZCGkDDZAMKeod/EeQJ8z0FLRQ8HW8eOAZ+PL6B8WwjkR6SQ2BQEdGeCnqN3zzIIVfKfFwTcPQjKVM9xi5I6tt8X92X1cwK4WwIhGFHut3rSczzi1qjFqlyNPEhmcfAtNk8tQlAh1R+Jl7OXXrgE4DGgD7eGUSyTgKO8Yd927ZIPmD8M0VqV9DUT4Ry7WyMZRQh1GAwKc80xz7sLLJvXxr3232DzLqg7cCRUF4/lEMN9WHffFkCeZH89CwNfQEO7BIuEcSmO3er9KzU9fo7ZUa2Y5ISwRiuOeCLf7o29Itw==; Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1u1smG-000448-F1; Mon, 07 Apr 2025 16:09:04 -0400 X-Loop: help-debbugs@gnu.org Subject: [bug#77616] [PATCH 6/6] gnu: rust: Use gexps. Resent-From: Morgan Smith Original-Sender: "Debbugs-submit" Resent-CC: divya@subvertising.org, efraim@flashner.co.il, steve@futurile.net, guix-patches@gnu.org Resent-Date: Mon, 07 Apr 2025 20:09:04 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 77616 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: 77616@debbugs.gnu.org Cc: Morgan Smith , Divya Ranjan Pattanaik , Efraim Flashner , Steve George X-Debbugs-Original-Xcc: Divya Ranjan Pattanaik , Efraim Flashner , Steve George Received: via spool by 77616-submit@debbugs.gnu.org id=B77616.174405652615522 (code B ref 77616); Mon, 07 Apr 2025 20:09:04 +0000 Received: (at 77616) by debbugs.gnu.org; 7 Apr 2025 20:08:46 +0000 Received: from localhost ([127.0.0.1]:57049 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1u1slu-000420-IW for submit@debbugs.gnu.org; Mon, 07 Apr 2025 16:08:46 -0400 Received: from mail-dm6nam12olkn20818.outbound.protection.outlook.com ([2a01:111:f403:2c17::818]:26465 helo=NAM12-DM6-obe.outbound.protection.outlook.com) by debbugs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.84_2) (envelope-from ) id 1u1slj-00040H-7h for 77616@debbugs.gnu.org; Mon, 07 Apr 2025 16:08:33 -0400 ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=tCE5Y5kcA5b+grgrNpHfWMFudyg1UzE1mrEh3lqBHmR/q2yc5niLZ2/fO8OaJTys5WmfI58vS/ceJVB3/HdJh2CALAuJC5Vzh5vEKS+BgmMBFsgBZhJwfAq+JBGoEYrjQb7GKJ9Q82UvyCplzuwguuLFwVvQsJPbe/pnYeZGPGYhHGUKOVIZ8Et/flxJPHfEJuX4+pong5oeBaGXOW2faQk/GMwlKl0IZz7A9W98aoTGd00ljLeLvJieYkWpfBJ1Bw+X9sZO6/ARzBG8e1INiXlJcDx7v1AQQ67hbORhjOzHbysu3MgXHW37Yvt28qZzToDQAv+wFAcGxvc37naoZQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector10001; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=5LgOlzt4Idrhlf8yuamcD+d0iSbXRMEyGQXaKPwTKKE=; b=K7/OohbpTVHKo5L5NYTaUK/F7gJG8tjQooA2ALoH2NIiJHtqUTP5HsirCCjahvpKRTEP75x9aWr2HZHKefhwgyFg46UVp4qEnaWlHJSQRCi5snnDL2calyZF4Hc3f63TE9V+xsitL+6sMxgav0lmC2eQpg/iWlYU75tmeBIN0GmEGKeUHF2S2hqpePERtksztZmZlkrUW7Tm3ffvuZYGUo6Z2gKpgQ0BJ8rA4bl09F0wFPbOtlm4r2PvEUfR/+E87FE/nDtjMzBPNXCS5g93/ItBTEjFeBSA0qsAfZ25ZlkEgn62Kkri9ob37MXpg4KLnYH6SS+9q4wy1ei5sUzJfg== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=none; dmarc=none; dkim=none; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=outlook.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=5LgOlzt4Idrhlf8yuamcD+d0iSbXRMEyGQXaKPwTKKE=; b=HInwz3aNzSPXlq2/jtBynsmEqobHr+4Eu9koSVkQX7xOQiJGrRHmIIYNjZoOpkVWpUN4QOm0CM4ms9hxPOkgiE5gxAazoWtf0GsrCRAMpH8gt0NLbB5j/djSYW4B4BYeKZVSBidpGMCWbR1kJSEK2g89aP1irH/T7dJd+lGfQoAguIyjk2yogUZgaCn5SV0mBNCy7LXF2QxfwCBMTLteeL28SZILvAzs7ZmZlrRTHKzBHYhx00kVPUXap/ZnsQ2VoQsXlBtqrPjqdSZfvRFJmbMcdjT8RJ7G4WlQ4GH9X5tOe6Sd6nxl8q6lLvIDjFnL9QGzcBqf+zCeaO6SdXHSsw== Received: from CH3PR84MB3424.NAMPRD84.PROD.OUTLOOK.COM (2603:10b6:610:1c4::17) by DS0PR84MB3589.NAMPRD84.PROD.OUTLOOK.COM (2603:10b6:8:1b8::16) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.8606.31; Mon, 7 Apr 2025 20:08:24 +0000 Received: from CH3PR84MB3424.NAMPRD84.PROD.OUTLOOK.COM ([fe80::5c77:7a58:48ed:9aef]) by CH3PR84MB3424.NAMPRD84.PROD.OUTLOOK.COM ([fe80::5c77:7a58:48ed:9aef%5]) with mapi id 15.20.8606.033; Mon, 7 Apr 2025 20:08:24 +0000 From: Morgan Smith Date: Mon, 7 Apr 2025 16:07:50 -0400 Message-ID: X-Mailer: git-send-email 2.49.0 In-Reply-To: <2141283854b61187d507f0dfaf768e3416e09845.1744056453.git.Morgan.J.Smith@outlook.com> References: <2141283854b61187d507f0dfaf768e3416e09845.1744056453.git.Morgan.J.Smith@outlook.com> X-ClientProxiedBy: YT4PR01CA0026.CANPRD01.PROD.OUTLOOK.COM (2603:10b6:b01:fe::11) To CH3PR84MB3424.NAMPRD84.PROD.OUTLOOK.COM (2603:10b6:610:1c4::17) X-Microsoft-Original-Message-ID: <31f87e1cdcd51500c16e37ab5aca27a797db6029.1744056453.git.Morgan.J.Smith@outlook.com> MIME-Version: 1.0 X-MS-Exchange-MessageSentRepresentingType: 1 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: CH3PR84MB3424:EE_|DS0PR84MB3589:EE_ X-MS-Office365-Filtering-Correlation-Id: 55bf99cc-ef02-44df-334e-08dd760ff37a X-Microsoft-Antispam: BCL:0; ARA:14566002|461199028|8060799006|15080799006|7092599003|19110799003|5072599009|41001999003|440099028|3412199025|1710799026; X-Microsoft-Antispam-Message-Info: DHlOvqKiVsR62ucrb6+KZfzTkeEehQuXs27s/iX7YNFUSPM3JkIbL0NrgryUx4iwpdb7guqGSarVHnG+r45rnrd7twNwrJo8DnQwNaXu05p6XXAciG4eaLbd9djkr4RcvtjsUs5YA7VTVmY+yRRoIMWzteG7X7tqF7SIhwFSqsQnPGW+OZKk6V3YmZqPHQ4mESM0BXTWl4YM7mDjWjiAE3i05AbiyU4E5oURolJc0Mhct/BbtMsDLwezOdbPCcAOheZTr0jAwM2mocvL3mU1PruvC4hK7XdlFICyTB9O47i3Y1ihvPUFsH0ZgW0RNmBXW9eBmvvYjb6j7AWvFo8J+uOL4av0cFuATXUIBf2T7jzRTn3acjiVsFZsOUZZHlsQr0LBIDOjsJPFNbWu44KR5jLSigfJ2ga4dkCnP/9o+JPTUDSU0L0Bj1nuWHdP7renkhgu+X8KjcFw4Cob3eU1Kxk+AUw00OVAAsikrmkbFKMQdoJ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8RvpZLkfJqTxuH87pzTZR4+mXqLblpE9SxQFNURd8gJEhhuqHfVy6ncZVNPAmETMnUeAcbvWfnAzQ07tE0hCQ+Ca7KFCURczN5QP/l0sXJW7HwYKFocpGfW0U3wYK1A9RTAqNyzsEsfdceNqn+mb8sBouwp+WtplIsKYg8r+sWRFltpujPYuc4+hz8qFZqIhJunmcRRL8NrjRIHFlWmE+AgZqX2lnpyEArvZxe9H4K5i3OId4AoGCE4W7zunn8FqAFglHRSd9JZO4t6suZDYc93gxJOt9OZ8JguZ/5+IiU5kN0BXntP0ONhoWxJp2jIpmw5j+ds/+HjcE6NfIOjhLD+zpwddvKNN665yIyT9eoNuPMtlyrh39+As8JQpniBuo6ygfIIcPCg+LJLmiXvbbeGqYuRPn51HZimifMfy6E0MsrArLgYQzDArMOHqx/CwdCVtDKDKEIDAXX9/HxN0Y76PWBB+fwKCcn+IotAcPN7FZj6oD//vIrMKsu7B5JaoJfP+Gd8GdmViUcOKOiqR174OfRkG85cwcTqJs9lRlIVM8WeF8FcNQDom6XSj12JPP4WtBp4SSUPDHr95TYG5h3N68pJZIJ2nNMDWacdRRz06NezFkR9SPRfnaVSFBvIQTB6L1sF2BVIiPemg6M4UzT6CadB/wiTVCKoku19gJtGvolUDyPr1XIbCpxlzmkK/kbMBaajbCiBhhAeSGjGNY5QhIWhYCQGqfJ0QQk/07kH0uim+0Du36Zmis18JKsyV1LGVHKY5bWZEFLhaatb9zV16i0C/EK/LdPBZ3PZl2ItjOLufEJHhqoWe7Im1vGgbcZBuyKmJReO3TKQpVjXaxRGt7Nlmn9BoIUoAIr6BiHTCKD+ZpE64nEc3w+MZZc1CAsoF09Blv0qf3XqBjE5hxIA2B8EKKBUZTjepY634RkG5W7u+iijN6iNVdRZB7PSP X-OriginatorOrg: outlook.com X-MS-Exchange-CrossTenant-Network-Message-Id: 55bf99cc-ef02-44df-334e-08dd760ff37a X-MS-Exchange-CrossTenant-AuthSource: CH3PR84MB3424.NAMPRD84.PROD.OUTLOOK.COM X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 07 Apr 2025 20:08:24.0978 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 84df9e7f-e9f6-40af-b435-aaaaaaaaaaaa X-MS-Exchange-CrossTenant-RMS-PersistedConsumerOrg: 00000000-0000-0000-0000-000000000000 X-MS-Exchange-Transport-CrossTenantHeadersStamped: DS0PR84MB3589 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 * gnu/packages/rust.scm(rust-1.77, rust-1.82, rust-1.83, rust-1.85): Use gexps. Change-Id: I87d7cd80cb1d294b6f4d8fc56bfcef141fe01120 --- gnu/packages/rust.scm | 697 +++++++++++++++++++++--------------------- 1 file changed, 349 insertions(+), 348 deletions(-) diff --git a/gnu/packages/rust.scm b/gnu/packages/rust.scm index 4b0e9a3666..563923a677 100644 --- a/gnu/packages/rust.scm +++ b/gnu/packages/rust.scm @@ -520,21 +520,21 @@ (define-public rust-1.77 (arguments (substitute-keyword-arguments (package-arguments base-rust) ((#:phases phases) - `(modify-phases ,phases - (add-after 'configure 'no-optimized-compiler-builtins - (lambda _ - ;; Pre-1.77, the behavior was equivalent to this flag being - ;; "false" if the llvm-project submodule wasn't checked out. - ;; - ;; Now there's an explicit check, so the build fails if we don't - ;; manually disable this (given that we don't have the submodule checked out). - ;; Thus making the build behave the same as it did in 1.76 and earlier. - ;; - ;; TODO - make the build system depend on system llvm for this, so we - ;; can get the performance benefits of setting this to true? - (substitute* "config.toml" - (("\\[build\\]") - "[build]\noptimized-compiler-builtins = false"))))))))))) + #~(modify-phases #$phases + (add-after 'configure 'no-optimized-compiler-builtins + (lambda _ + ;; Pre-1.77, the behavior was equivalent to this flag being + ;; "false" if the llvm-project submodule wasn't checked out. + ;; + ;; Now there's an explicit check, so the build fails if we don't + ;; manually disable this (given that we don't have the submodule checked out). + ;; Thus making the build behave the same as it did in 1.76 and earlier. + ;; + ;; TODO - make the build system depend on system llvm for this, so we + ;; can get the performance benefits of setting this to true? + (substitute* "config.toml" + (("\\[build\\]") + "[build]\noptimized-compiler-builtins = false"))))))))))) (define-public rust-1.78 (let ((base-rust (rust-bootstrapped-package rust-1.77 "1.78.0" @@ -623,22 +623,22 @@ (define-public rust-1.82 (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 + #~(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")))))))))) + (find-files "src/tools" "Cargo.lock"))) + (("(checksum = )\".*\"" all name) + (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" @@ -671,12 +671,12 @@ (define-public rust-1.83 (arguments (substitute-keyword-arguments (package-arguments base-rust) ((#:phases phases) - `(modify-phases ,phases - (add-after 'configure 'use-system-llvm - (lambda _ - (substitute* "config.toml" - (("\\[llvm\\]") "[llvm]\ndownload-ci-llvm = false") - (("\\[rust\\]") "[rust]\ndownload-rustc = false")))))))) + #~(modify-phases #$phases + (add-after 'configure 'use-system-llvm + (lambda _ + (substitute* "config.toml" + (("\\[llvm\\]") "[llvm]\ndownload-ci-llvm = false") + (("\\[rust\\]") "[rust]\ndownload-rustc = false")))))))) ;; Need llvm >= 18.0 (inputs (modify-inputs (package-inputs base-rust) (replace "llvm" llvm-19)))))) @@ -792,327 +792,328 @@ (define-public rust (strip-keyword-arguments '(#:tests?) (package-arguments base-rust)) ((#:phases phases) - `(modify-phases ,phases - (add-after 'unpack 'relax-gdb-auto-load-safe-path - ;; Allow GDB to load binaries from any location, otherwise the - ;; gdbinfo tests fail. This is only useful when testing with a - ;; GDB version newer than 8.2. - (lambda _ - (setenv "HOME" (getcwd)) - (with-output-to-file (string-append (getenv "HOME") "/.gdbinit") - (lambda _ - (format #t "set auto-load safe-path /~%"))) - ;; Do not launch gdb with '-nx' which causes it to not execute - ;; any init file. - (substitute* "src/tools/compiletest/src/runtest.rs" - (("\"-nx\".as_ref\\(\\), ") - "")))) - (add-after 'unpack 'disable-tests-requiring-git - (lambda _ - (substitute* "src/tools/cargo/tests/testsuite/git.rs" - ,@(make-ignore-test-list - '("fn fetch_downloads_with_git2_first_" - "fn corrupted_checkout_with_cli"))) - (substitute* "src/tools/cargo/tests/testsuite/build.rs" - ,@(make-ignore-test-list - '("fn build_with_symlink_to_path_dependency_with_build_script_in_git"))) - (substitute* "src/tools/cargo/tests/testsuite/publish_lockfile.rs" - ,@(make-ignore-test-list - '("fn note_resolve_changes"))))) - (add-after 'unpack 'disable-tests-requiring-mercurial - (lambda _ - (with-directory-excursion "src/tools/cargo/tests/testsuite/cargo_init" - (substitute* '("mercurial_autodetect/mod.rs" - "simple_hg_ignore_exists/mod.rs") - ,@(make-ignore-test-list - '("fn case")))))) - (add-after 'unpack 'disable-tests-using-cargo-publish - (lambda _ - (with-directory-excursion "src/tools/cargo/tests/testsuite" - (substitute* "alt_registry.rs" - ,@(make-ignore-test-list - '("fn warn_for_unused_fields"))) - (substitute* '("cargo_add/locked_unchanged/mod.rs" - "cargo_add/lockfile_updated/mod.rs" - "cargo_remove/update_lock_file/mod.rs") - ,@(make-ignore-test-list - '("fn case"))) - (substitute* "git_shallow.rs" - ,@(make-ignore-test-list - '("fn gitoxide_clones_git_dependency_with_shallow_protocol_and_git2_is_used_for_followup_fetches" - "fn gitoxide_clones_registry_with_shallow_protocol_and_aborts_and_updates_again" - "fn gitoxide_clones_registry_with_shallow_protocol_and_follow_up_fetch_maintains_shallowness" - "fn gitoxide_clones_registry_with_shallow_protocol_and_follow_up_with_git2_fetch" - "fn gitoxide_clones_registry_without_shallow_protocol_and_follow_up_fetch_uses_shallowness" - "fn gitoxide_shallow_clone_followed_by_non_shallow_update" - "fn gitoxide_clones_shallow_two_revs_same_deps" - "fn gitoxide_git_dependencies_switch_from_branch_to_rev" - "fn shallow_deps_work_with_revisions_and_branches_mixed_on_same_dependency"))) - (substitute* "install.rs" - ,@(make-ignore-test-list - '("fn failed_install_retains_temp_directory"))) - (substitute* "offline.rs" - ,@(make-ignore-test-list - '("fn gitoxide_cargo_compile_offline_with_cached_git_dep_shallow_dep"))) - (substitute* "patch.rs" - ,@(make-ignore-test-list - '("fn gitoxide_clones_shallow_old_git_patch")))))) - ,@(if (target-riscv64?) - ;; Keep this phase separate so it can be adjusted without needing - ;; to adjust the skipped tests on other architectures. - `((add-after 'unpack 'disable-tests-broken-on-riscv64 - (lambda _ - (with-directory-excursion "src/tools/cargo/tests/testsuite" - (substitute* "build.rs" - ,@(make-ignore-test-list - '("fn uplift_dwp_of_bin_on_linux"))) - (substitute* "cache_lock.rs" - ,@(make-ignore-test-list - '("fn multiple_shared" - "fn multiple_download" - "fn download_then_mutate" - "fn mutate_err_is_atomic"))) - (substitute* "global_cache_tracker.rs" - ,@(make-ignore-test-list - '("fn package_cache_lock_during_build")))) - (with-directory-excursion "src/tools/clippy/tests" - ;; `"vectorcall"` is not a supported ABI for the current target - (delete-file "ui/missing_const_for_fn/could_be_const.rs") - (substitute* "missing-test-files.rs" - ,@(make-ignore-test-list - '("fn test_missing_tests"))))))) - `()) - ,@(if (target-aarch64?) - ;; Keep this phase separate so it can be adjusted without needing - ;; to adjust the skipped tests on other architectures. - `((add-after 'unpack 'disable-tests-broken-on-aarch64 - (lambda _ - (with-directory-excursion "src/tools/cargo/tests/testsuite" - (substitute* "build_script_extra_link_arg.rs" - ,@(make-ignore-test-list - '("fn build_script_extra_link_arg_bin_single"))) - (substitute* "build_script.rs" - ,@(make-ignore-test-list - '("fn env_test"))) - (substitute* "cache_lock.rs" - ,@(make-ignore-test-list - '("fn download_then_mutate"))) - (substitute* "collisions.rs" - ,@(make-ignore-test-list - '("fn collision_doc_profile_split"))) - (substitute* "concurrent.rs" - ,@(make-ignore-test-list - '("fn no_deadlock_with_git_dependencies"))) - (substitute* "features2.rs" - ,@(make-ignore-test-list - '("fn dep_with_optional_host_deps_activated")))) - (with-directory-excursion "src/tools/clippy/tests" - ;; `"vectorcall"` is not a supported ABI for the current target - (delete-file "ui/missing_const_for_fn/could_be_const.rs") - (substitute* "missing-test-files.rs" - ,@(make-ignore-test-list - '("fn test_missing_tests"))))))) - `()) - (add-after 'unpack 'disable-tests-requiring-crates.io - (lambda _ - (with-directory-excursion "src/tools/cargo/tests/testsuite" - (substitute* "install.rs" - ,@(make-ignore-test-list - '("fn install_global_cargo_config"))) - (substitute* '("cargo_add/normalize_name_path_existing/mod.rs" - "cargo_info/within_ws_with_alternative_registry/mod.rs") - ,@(make-ignore-test-list - '("fn case"))) - (substitute* "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" - ;; 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"))) - (substitute* "src/tools/cargo/tests/testsuite/git_auth.rs" - ;; This checks for a specific networking error message - ;; that's different from the one we see in the builder - ,@(make-ignore-test-list - '("fn net_err_suggests_fetch_with_cli"))))) - (add-after 'unpack 'patch-command-exec-tests - ;; This test suite includes some tests that the stdlib's - ;; `Command` execution properly handles in situations where - ;; the environment or PATH variable are empty, but this fails - ;; since we don't have `echo` available at its usual FHS - ;; location. - (lambda _ - (substitute* "tests/ui/command/command-exec.rs" - (("Command::new\\(\"echo\"\\)") - (format #f "Command::new(~s)" (which "echo")))))) - (add-after 'unpack 'patch-command-uid-gid-test - (lambda _ - (substitute* "tests/ui/command/command-uid-gid.rs" - (("/bin/sh") (which "sh")) - (("/bin/ls") (which "ls"))))) - (add-after 'unpack 'skip-shebang-tests - ;; This test make sure that the parser behaves properly when a - ;; source file starts with a shebang. Unfortunately, the - ;; patch-shebangs phase changes the meaning of these edge-cases. - ;; We skip the test since it's drastically unlikely Guix's - ;; packaging will introduce a bug here. - (lambda _ - (delete-file "tests/ui/parser/shebang/sneaky-attrib.rs"))) - (add-after 'unpack 'patch-process-tests - (lambda* (#:key inputs #:allow-other-keys) - (let ((bash (assoc-ref inputs "bash"))) - (with-directory-excursion "library/std/src" - (substitute* "process/tests.rs" - (("\"/bin/sh\"") - (string-append "\"" bash "/bin/sh\""))) - ;; The three tests which are known to fail upstream on QEMU - ;; emulation on aarch64 and riscv64 also fail on x86_64 in - ;; Guix's build system. Skip them on all builds. - (substitute* "sys/pal/unix/process/process_common/tests.rs" - ;; We can't use make-ignore-test-list because we will get - ;; build errors due to the double [ignore] block. - (("target_arch = \"arm\"" arm) - (string-append "target_os = \"linux\",\n" - " " arm))))))) - (add-after 'unpack 'disable-interrupt-tests - (lambda _ - ;; This test hangs in the build container; disable it. - (substitute* "src/tools/cargo/tests/testsuite/freshness.rs" - ,@(make-ignore-test-list - '("fn linking_interrupted"))) - ;; Likewise for the ctrl_c_kills_everyone test. - (substitute* "src/tools/cargo/tests/testsuite/death.rs" - ,@(make-ignore-test-list - '("fn ctrl_c_kills_everyone"))))) - (add-after 'unpack 'adjust-rpath-values - ;; This adds %output:out to rpath, allowing us to install utilities in - ;; different outputs while reusing the shared libraries. - (lambda* (#:key outputs #:allow-other-keys) - (let ((out (assoc-ref outputs "out"))) - (substitute* "src/bootstrap/src/core/builder/cargo.rs" - ((" = rpath.*" all) - (string-append all - " " - "self.rustflags.arg(\"-Clink-args=-Wl,-rpath=" - out "/lib\");\n")))))) - (add-after 'unpack 'unpack-profiler-rt - ;; Copy compiler-rt sources to where libprofiler_builtins looks - ;; for its vendored copy. - (lambda* (#:key inputs #:allow-other-keys) - (mkdir-p "src/llvm-project/compiler-rt") - (copy-recursively - (string-append (assoc-ref inputs "clang-source") - "/compiler-rt") + #~(modify-phases #$phases + (add-after 'unpack 'relax-gdb-auto-load-safe-path + ;; Allow GDB to load binaries from any location, otherwise the + ;; gdbinfo tests fail. This is only useful when testing with a + ;; GDB version newer than 8.2. + (lambda _ + (setenv "HOME" (getcwd)) + (with-output-to-file (string-append (getenv "HOME") "/.gdbinit") + (lambda _ + (format #t "set auto-load safe-path /~%"))) + ;; Do not launch gdb with '-nx' which causes it to not execute + ;; any init file. + (substitute* "src/tools/compiletest/src/runtest.rs" + (("\"-nx\".as_ref\\(\\), ") + "")))) + (add-after 'unpack 'disable-tests-requiring-git + (lambda _ + (substitute* "src/tools/cargo/tests/testsuite/git.rs" + #$@(make-ignore-test-list + '("fn fetch_downloads_with_git2_first_" + "fn corrupted_checkout_with_cli"))) + (substitute* "src/tools/cargo/tests/testsuite/build.rs" + #$@(make-ignore-test-list + '("fn build_with_symlink_to_path_dependency_with_build_script_in_git"))) + (substitute* "src/tools/cargo/tests/testsuite/publish_lockfile.rs" + #$@(make-ignore-test-list + '("fn note_resolve_changes"))))) + (add-after 'unpack 'disable-tests-requiring-mercurial + (lambda _ + (with-directory-excursion "src/tools/cargo/tests/testsuite/cargo_init" + (substitute* '("mercurial_autodetect/mod.rs" + "simple_hg_ignore_exists/mod.rs") + #$@(make-ignore-test-list + '("fn case")))))) + (add-after 'unpack 'disable-tests-using-cargo-publish + (lambda _ + (with-directory-excursion "src/tools/cargo/tests/testsuite" + (substitute* "alt_registry.rs" + #$@(make-ignore-test-list + '("fn warn_for_unused_fields"))) + (substitute* '("cargo_add/locked_unchanged/mod.rs" + "cargo_add/lockfile_updated/mod.rs" + "cargo_remove/update_lock_file/mod.rs") + #$@(make-ignore-test-list + '("fn case"))) + (substitute* "git_shallow.rs" + #$@(make-ignore-test-list + '("fn gitoxide_clones_git_dependency_with_shallow_protocol_and_git2_is_used_for_followup_fetches" + "fn gitoxide_clones_registry_with_shallow_protocol_and_aborts_and_updates_again" + "fn gitoxide_clones_registry_with_shallow_protocol_and_follow_up_fetch_maintains_shallowness" + "fn gitoxide_clones_registry_with_shallow_protocol_and_follow_up_with_git2_fetch" + "fn gitoxide_clones_registry_without_shallow_protocol_and_follow_up_fetch_uses_shallowness" + "fn gitoxide_shallow_clone_followed_by_non_shallow_update" + "fn gitoxide_clones_shallow_two_revs_same_deps" + "fn gitoxide_git_dependencies_switch_from_branch_to_rev" + "fn shallow_deps_work_with_revisions_and_branches_mixed_on_same_dependency"))) + (substitute* "install.rs" + #$@(make-ignore-test-list + '("fn failed_install_retains_temp_directory"))) + (substitute* "offline.rs" + #$@(make-ignore-test-list + '("fn gitoxide_cargo_compile_offline_with_cached_git_dep_shallow_dep"))) + (substitute* "patch.rs" + #$@(make-ignore-test-list + '("fn gitoxide_clones_shallow_old_git_patch")))))) + #$@(if (target-riscv64?) + ;; Keep this phase separate so it can be adjusted without needing + ;; to adjust the skipped tests on other architectures. + `((add-after 'unpack 'disable-tests-broken-on-riscv64 + (lambda _ + (with-directory-excursion "src/tools/cargo/tests/testsuite" + (substitute* "build.rs" + #$@(make-ignore-test-list + '("fn uplift_dwp_of_bin_on_linux"))) + (substitute* "cache_lock.rs" + #$@(make-ignore-test-list + '("fn multiple_shared" + "fn multiple_download" + "fn download_then_mutate" + "fn mutate_err_is_atomic"))) + (substitute* "global_cache_tracker.rs" + #$@(make-ignore-test-list + '("fn package_cache_lock_during_build")))) + (with-directory-excursion "src/tools/clippy/tests" + ;; `"vectorcall"` is not a supported ABI for the current target + (delete-file "ui/missing_const_for_fn/could_be_const.rs") + (substitute* "missing-test-files.rs" + #$@(make-ignore-test-list + '("fn test_missing_tests"))))))) + `()) + #$@(if (target-aarch64?) + ;; Keep this phase separate so it can be adjusted without needing + ;; to adjust the skipped tests on other architectures. + `((add-after 'unpack 'disable-tests-broken-on-aarch64 + (lambda _ + (with-directory-excursion "src/tools/cargo/tests/testsuite" + (substitute* "build_script_extra_link_arg.rs" + #$@(make-ignore-test-list + '("fn build_script_extra_link_arg_bin_single"))) + (substitute* "build_script.rs" + #$@(make-ignore-test-list + '("fn env_test"))) + (substitute* "cache_lock.rs" + #$@(make-ignore-test-list + '("fn download_then_mutate"))) + (substitute* "collisions.rs" + #$@(make-ignore-test-list + '("fn collision_doc_profile_split"))) + (substitute* "concurrent.rs" + #$@(make-ignore-test-list + '("fn no_deadlock_with_git_dependencies"))) + (substitute* "features2.rs" + #$@(make-ignore-test-list + '("fn dep_with_optional_host_deps_activated")))) + (with-directory-excursion "src/tools/clippy/tests" + ;; `"vectorcall"` is not a supported ABI for the current target + (delete-file "ui/missing_const_for_fn/could_be_const.rs") + (substitute* "missing-test-files.rs" + #$@(make-ignore-test-list + '("fn test_missing_tests"))))))) + `()) + (add-after 'unpack 'disable-tests-requiring-crates.io + (lambda _ + (with-directory-excursion "src/tools/cargo/tests/testsuite" + (substitute* "install.rs" + #$@(make-ignore-test-list + '("fn install_global_cargo_config"))) + (substitute* '("cargo_add/normalize_name_path_existing/mod.rs" + "cargo_info/within_ws_with_alternative_registry/mod.rs") + #$@(make-ignore-test-list + '("fn case"))) + (substitute* "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" + ;; 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"))) + (substitute* "src/tools/cargo/tests/testsuite/git_auth.rs" + ;; This checks for a specific networking error message + ;; that's different from the one we see in the builder + #$@(make-ignore-test-list + '("fn net_err_suggests_fetch_with_cli"))))) + (add-after 'unpack 'patch-command-exec-tests + ;; This test suite includes some tests that the stdlib's + ;; `Command` execution properly handles in situations where + ;; the environment or PATH variable are empty, but this fails + ;; since we don't have `echo` available at its usual FHS + ;; location. + (lambda _ + (substitute* "tests/ui/command/command-exec.rs" + (("Command::new\\(\"echo\"\\)") + (format #f "Command::new(~s)" (which "echo")))))) + (add-after 'unpack 'patch-command-uid-gid-test + (lambda _ + (substitute* "tests/ui/command/command-uid-gid.rs" + (("/bin/sh") (which "sh")) + (("/bin/ls") (which "ls"))))) + (add-after 'unpack 'skip-shebang-tests + ;; This test make sure that the parser behaves properly when a + ;; source file starts with a shebang. Unfortunately, the + ;; patch-shebangs phase changes the meaning of these edge-cases. + ;; We skip the test since it's drastically unlikely Guix's + ;; packaging will introduce a bug here. + (lambda _ + (delete-file "tests/ui/parser/shebang/sneaky-attrib.rs"))) + (add-after 'unpack 'patch-process-tests + (lambda* (#:key inputs #:allow-other-keys) + (let ((bash (assoc-ref inputs "bash"))) + (with-directory-excursion "library/std/src" + (substitute* "process/tests.rs" + (("\"/bin/sh\"") + (string-append "\"" bash "/bin/sh\""))) + ;; The three tests which are known to fail upstream on QEMU + ;; emulation on aarch64 and riscv64 also fail on x86_64 in + ;; Guix's build system. Skip them on all builds. + (substitute* "sys/pal/unix/process/process_common/tests.rs" + ;; We can't use make-ignore-test-list because we will get + ;; build errors due to the double [ignore] block. + (("target_arch = \"arm\"" arm) + (string-append "target_os = \"linux\",\n" + " " arm))))))) + (add-after 'unpack 'disable-interrupt-tests + (lambda _ + ;; This test hangs in the build container; disable it. + (substitute* "src/tools/cargo/tests/testsuite/freshness.rs" + #$@(make-ignore-test-list + '("fn linking_interrupted"))) + ;; Likewise for the ctrl_c_kills_everyone test. + (substitute* "src/tools/cargo/tests/testsuite/death.rs" + #$@(make-ignore-test-list + '("fn ctrl_c_kills_everyone"))))) + (add-after 'unpack 'adjust-rpath-values + ;; This adds %output:out to rpath, allowing us to install utilities in + ;; different outputs while reusing the shared libraries. + (lambda* (#:key outputs #:allow-other-keys) + (let ((out (assoc-ref outputs "out"))) + (substitute* "src/bootstrap/src/core/builder/cargo.rs" + ((" = rpath.*" all) + (string-append all + " " + "self.rustflags.arg(\"-Clink-args=-Wl,-rpath=" + out "/lib\");\n")))))) + (add-after 'unpack 'unpack-profiler-rt + ;; Copy compiler-rt sources to where libprofiler_builtins looks + ;; for its vendored copy. + (lambda* (#:key inputs #:allow-other-keys) + (mkdir-p "src/llvm-project/compiler-rt") + (copy-recursively + ;; clang-source + (search-input-directory inputs "/compiler-rt") "src/llvm-project/compiler-rt"))) - (add-after 'configure 'enable-profiling - (lambda _ - (substitute* "config.toml" - (("^profiler =.*$") "") - (("\\[build\\]") "\n[build]\nprofiler = true\n")))) - (add-after 'configure 'add-gdb-to-config - (lambda* (#:key inputs #:allow-other-keys) - (let ((gdb (assoc-ref inputs "gdb"))) - (substitute* "config.toml" - (("^python =.*" all) - (string-append all - "gdb = \"" gdb "/bin/gdb\"\n")))))) - (replace 'build - ;; Phase overridden to also build more tools. - (lambda* (#:key parallel-build? #:allow-other-keys) - (let ((job-spec (string-append - "-j" (if parallel-build? - (number->string (parallel-job-count)) - "1")))) - (invoke "./x.py" job-spec "build" - "library/std" ;rustc - "src/tools/cargo" - "src/tools/clippy" - "src/tools/rust-analyzer" - "src/tools/rustfmt" - ;; Needed by rust-analyzer and editor plugins - "src/tools/rust-analyzer/crates/proc-macro-srv-cli")))) - (replace 'check - ;; Phase overridden to also test more tools. - (lambda* (#:key tests? parallel-build? #:allow-other-keys) - (when tests? - (let ((job-spec (string-append - "-j" (if parallel-build? - (number->string (parallel-job-count)) - "1")))) - (invoke "./x.py" job-spec "test" "-vv" - "library/std" - "src/tools/cargo" - "src/tools/clippy" - "src/tools/rust-analyzer" - "src/tools/rustfmt"))))) - (replace 'install - ;; Phase overridden to also install more tools. - (lambda* (#:key outputs #:allow-other-keys) - (invoke "./x.py" "install") - ;; This one doesn't have an install target so - ;; we need to install manually. - (install-file (string-append + (add-after 'configure 'enable-profiling + (lambda _ + (substitute* "config.toml" + (("^profiler =.*$") "") + (("\\[build\\]") "\n[build]\nprofiler = true\n")))) + (add-after 'configure 'add-gdb-to-config + (lambda* (#:key inputs #:allow-other-keys) + (let ((gdb (search-input-file inputs "/bin/gdb"))) + (substitute* "config.toml" + (("^python =.*" all) + (string-append all + "gdb = \"" gdb "\"\n")))))) + (replace 'build + ;; Phase overridden to also build more tools. + (lambda* (#:key parallel-build? #:allow-other-keys) + (let ((job-spec (string-append + "-j" (if parallel-build? + (number->string (parallel-job-count)) + "1")))) + (invoke "./x.py" job-spec "build" + "library/std" ;rustc + "src/tools/cargo" + "src/tools/clippy" + "src/tools/rust-analyzer" + "src/tools/rustfmt" + ;; Needed by rust-analyzer and editor plugins + "src/tools/rust-analyzer/crates/proc-macro-srv-cli")))) + (replace 'check + ;; Phase overridden to also test more tools. + (lambda* (#:key tests? parallel-build? #:allow-other-keys) + (when tests? + (let ((job-spec (string-append + "-j" (if parallel-build? + (number->string (parallel-job-count)) + "1")))) + (invoke "./x.py" job-spec "test" "-vv" + "library/std" + "src/tools/cargo" + "src/tools/clippy" + "src/tools/rust-analyzer" + "src/tools/rustfmt"))))) + (replace 'install + ;; Phase overridden to also install more tools. + (lambda* (#:key outputs #:allow-other-keys) + (invoke "./x.py" "install") + ;; This one doesn't have an install target so + ;; we need to install manually. + (install-file (string-append "build/" - ,(platform-rust-target + #$(platform-rust-target (lookup-platform-by-system - (%current-system))) + (%current-system))) "/stage1-tools-bin/rust-analyzer-proc-macro-srv") - (string-append (assoc-ref outputs "out") "/libexec")) - (substitute* "config.toml" - ;; Adjust the prefix to the 'cargo' output. - (("prefix = \"[^\"]*\"") - (format #f "prefix = ~s" (assoc-ref outputs "cargo")))) - (invoke "./x.py" "install" "cargo") - (substitute* "config.toml" - ;; Adjust the prefix to the 'tools' output. - (("prefix = \"[^\"]*\"") - (format #f "prefix = ~s" (assoc-ref outputs "tools")))) - (invoke "./x.py" "install" "clippy") - (invoke "./x.py" "install" "rust-analyzer") - (invoke "./x.py" "install" "rustfmt"))) - (add-after 'install 'install-rust-src - (lambda* (#:key outputs #:allow-other-keys) - (let ((out (assoc-ref outputs "rust-src")) - (dest "/lib/rustlib/src/rust")) - (mkdir-p (string-append out dest)) - (copy-recursively "library" (string-append out dest "/library")) - (copy-recursively "src" (string-append out dest "/src"))))) - (add-before 'install 'remove-uninstall-script - (lambda _ - ;; Don't install the uninstall script. It has no use - ;; on Guix and it retains a reference to the host's bash. - (substitute* "src/tools/rust-installer/install-template.sh" - (("install_uninstaller \"") "# install_uninstaller \"")))) - (add-after 'install-rust-src 'wrap-rust-analyzer - (lambda* (#:key outputs #:allow-other-keys) - (let ((bin (string-append (assoc-ref outputs "tools") "/bin"))) - (rename-file (string-append bin "/rust-analyzer") - (string-append bin "/.rust-analyzer-real")) - (call-with-output-file (string-append bin "/rust-analyzer") - (lambda (port) - (format port "#!~a + (string-append (assoc-ref outputs "out") "/libexec")) + (substitute* "config.toml" + ;; Adjust the prefix to the 'cargo' output. + (("prefix = \"[^\"]*\"") + (format #f "prefix = ~s" (assoc-ref outputs "cargo")))) + (invoke "./x.py" "install" "cargo") + (substitute* "config.toml" + ;; Adjust the prefix to the 'tools' output. + (("prefix = \"[^\"]*\"") + (format #f "prefix = ~s" (assoc-ref outputs "tools")))) + (invoke "./x.py" "install" "clippy") + (invoke "./x.py" "install" "rust-analyzer") + (invoke "./x.py" "install" "rustfmt"))) + (add-after 'install 'install-rust-src + (lambda* (#:key outputs #:allow-other-keys) + (let ((out (assoc-ref outputs "rust-src")) + (dest "/lib/rustlib/src/rust")) + (mkdir-p (string-append out dest)) + (copy-recursively "library" (string-append out dest "/library")) + (copy-recursively "src" (string-append out dest "/src"))))) + (add-before 'install 'remove-uninstall-script + (lambda _ + ;; Don't install the uninstall script. It has no use + ;; on Guix and it retains a reference to the host's bash. + (substitute* "src/tools/rust-installer/install-template.sh" + (("install_uninstaller \"") "# install_uninstaller \"")))) + (add-after 'install-rust-src 'wrap-rust-analyzer + (lambda* (#:key outputs #:allow-other-keys) + (let ((bin (string-append (assoc-ref outputs "tools") "/bin"))) + (rename-file (string-append bin "/rust-analyzer") + (string-append bin "/.rust-analyzer-real")) + (call-with-output-file (string-append bin "/rust-analyzer") + (lambda (port) + (format port "#!~a if test -z \"${RUST_SRC_PATH}\";then export RUST_SRC_PATH=~S;fi; exec -a \"$0\" \"~a\" \"$@\"" - (which "bash") - (string-append (assoc-ref outputs "rust-src") - "/lib/rustlib/src/rust/library") - (string-append bin "/.rust-analyzer-real")))) - (chmod (string-append bin "/rust-analyzer") #o755)))))))) + (which "bash") + (string-append (assoc-ref outputs "rust-src") + "/lib/rustlib/src/rust/library") + (string-append bin "/.rust-analyzer-real")))) + (chmod (string-append bin "/rust-analyzer") #o755)))))))) (inputs (modify-inputs (package-inputs base-rust) (prepend curl libffi `(,nghttp2 "lib") zlib))) - (native-inputs (cons* - ;; Keep in sync with the llvm used to build rust. - `("clang-source" ,(package-source clang-runtime-19)) - ;; Add test inputs. - `("gdb" ,gdb/pinned) - `("procps" ,procps) - (package-native-inputs base-rust))) + (native-inputs + (modify-inputs (package-native-inputs base-rust) + (prepend + ;; Keep in sync with the llvm used to build rust. + (package-source clang-runtime-19) + ;; Add test inputs. + gdb/pinned + procps))) (native-search-paths (cons ;; For HTTPS access, Cargo reads from a single-file certificate