From patchwork Sun Mar 23 17:41:23 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Brennan Vincent X-Patchwork-Id: 40753 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 0333427BBEA; Sun, 23 Mar 2025 17:44:47 +0000 (GMT) X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on mira.cbaines.net X-Spam-Level: X-Spam-Status: No, score=-7.6 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,MAILING_LIST_MULTI,RCVD_IN_DNSWL_BLOCKED, RCVD_IN_VALIDITY_CERTIFIED,RCVD_IN_VALIDITY_RPBL,RCVD_IN_VALIDITY_SAFE, SPF_HELO_PASS,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 991C327BBE2 for ; Sun, 23 Mar 2025 17:44:46 +0000 (GMT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1twPLH-0004uf-QM; Sun, 23 Mar 2025 13:42:36 -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 1twPKk-0004en-Ui for guix-patches@gnu.org; Sun, 23 Mar 2025 13:42:03 -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 1twPKk-0003Xg-Hv for guix-patches@gnu.org; Sun, 23 Mar 2025 13:42:02 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=debbugs.gnu.org; s=debbugs-gnu-org; h=MIME-Version:Date:From:To:Subject; bh=iHAGFR2Rxa89uCfbnoyLI57GUZqK0dthYAc/ubXZ/Wo=; b=uHyXulJZ2lx734y8R82cvKbIeLW/pBWVvsecyT3wzjvClDIIq5NDpf4qn/yDXai+wCe57MfrJkO+6wpMXIZCdsdsDvZPbppRA5+4XWQMaYoynH3s4TORSAIfEDjnM3o5T/90qcbbIm0us2/RgErc083C0RQXzk3NxfjvJ9unEylbrp2EfUXhAo6oDurl9xAGuB8jSFN2qsTIwEvMzXV/iSggzKctjmkMCOMT7Oj5MFm7fuwMvItwYiMT3m+2JkZL5zwuvwTqqnpH9lb6apFVOlakbe/YNvVVb15reEYP7ISo/Mt1qimRkvuvDd06UJ518yZa3x2ycmlbSgZLNJgcYg==; Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1twPKk-0006Eh-6V for guix-patches@gnu.org; Sun, 23 Mar 2025 13:42:02 -0400 X-Loop: help-debbugs@gnu.org Subject: [bug#77212] [PATCH] gnu: rust: install stdlib manifest with original checksums Resent-From: Brennan Vincent Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Sun, 23 Mar 2025 17:42:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: report 77212 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: 77212@debbugs.gnu.org, efraim@flashner.co.il X-Debbugs-Original-To: guix-patches@gnu.org, efraim@flashner.co.il Received: via spool by submit@debbugs.gnu.org id=B.174275171123944 (code B ref -1); Sun, 23 Mar 2025 17:42:01 +0000 Received: (at submit) by debbugs.gnu.org; 23 Mar 2025 17:41:51 +0000 Received: from localhost ([127.0.0.1]:52455 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1twPKZ-0006E8-Ce for submit@debbugs.gnu.org; Sun, 23 Mar 2025 13:41:51 -0400 Received: from lists.gnu.org ([2001:470:142::17]:58122) by debbugs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.84_2) (envelope-from ) id 1twPKW-0006Dl-A7 for submit@debbugs.gnu.org; Sun, 23 Mar 2025 13:41:48 -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 1twPKJ-0002dc-0D for guix-patches@gnu.org; Sun, 23 Mar 2025 13:41:35 -0400 Received: from smtp.umanwizard.com ([54.203.248.109]) by eggs.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1twPKF-0003WP-Oy for guix-patches@gnu.org; Sun, 23 Mar 2025 13:41:33 -0400 Received: from localhost ([89.100.58.90]) by smtp.umanwizard.com ; 23 Mar 2025 17:41:28 +0000 X-Fes-Received-For: guix-patches@gnu.org X-Fes-Received-From: From: Brennan Vincent X-Envelope-From: d0948f56eb1c8adde91008a23e408d9fde88278a Mon Sep 17 00:00:00 2001 Date: Sun, 23 Mar 2025 10:41:23 -0700 Message-ID: <87msdbhcfw.fsf@eugene.mail-host-address-is-not-set> MIME-Version: 1.0 X-Fes-Encrypted: true X-Fes-Ehlo-Domain: localhost Received-SPF: pass client-ip=54.203.248.109; envelope-from=brennan@umanwizard.com; helo=smtp.umanwizard.com X-Spam_score_int: -18 X-Spam_score: -1.9 X-Spam_bar: - X-Spam_report: (-1.9 / 5.0 requ) BAYES_00=-1.9, RCVD_IN_VALIDITY_RPBL_BLOCKED=0.001, RCVD_IN_VALIDITY_SAFE_BLOCKED=0.001, SPF_HELO_PASS=-0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action 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): install stdlib manifest with original checksums Change-Id: I1100ffe4ff67c8e2026e802fc3902ec218e2efee --- gnu/packages/rust.scm | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) base-commit: b54a9ca849f013300c633fb79d80bc754f6b28a2 prerequisite-patch-id: 2b36f42a4b79ce79d12ce58a03de81902054f2a1 diff --git a/gnu/packages/rust.scm b/gnu/packages/rust.scm index 3fd7fc3433..04d88f6a82 100644 --- a/gnu/packages/rust.scm +++ b/gnu/packages/rust.scm @@ -1476,12 +1476,28 @@ (define-public rust (invoke "./x.py" "install" "clippy") (invoke "./x.py" "install" "rust-analyzer") (invoke "./x.py" "install" "rustfmt"))) + (add-before 'patch-cargo-checksums 'save-old-library-manifest + (lambda _ + (copy-file "library/Cargo.lock" ".old-library-manifest"))) (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")) + ;; rust-analyzer needs the original checksums; otherwise, + ;; it fails to cargo manifest in the stdlib, and then + ;; analysis/inference involving stdlib structs doesn't work. + ;; + ;; For example, in the following trivial program: + ;; + ;; fn main() { + ;; let x = Vec::::new(); + ;; } + ;; + ;; rust-analyzer since versino 1.82 + ;; can't infer the type of x unless the following line is present. + (copy-file ".old-library-manifest" (string-append out dest "/library/Cargo.lock")) (copy-recursively "src" (string-append out dest "/src"))))) (add-before 'install 'remove-uninstall-script (lambda _