Message ID | 87msdbhcfw.fsf@eugene.mail-host-address-is-not-set |
---|---|
State | New |
Headers |
Return-Path: <guix-patches-bounces+patchwork=mira.cbaines.net@gnu.org> 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 <patchwork@mira.cbaines.net>; 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 <guix-patches-bounces@gnu.org>) 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 <Debian-debbugs@debbugs.gnu.org>) 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 <Debian-debbugs@debbugs.gnu.org>) 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 <Debian-debbugs@debbugs.gnu.org>) 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 <brennan@umanwizard.com> Original-Sender: "Debbugs-submit" <debbugs-submit-bounces@debbugs.gnu.org> Resent-CC: guix-patches@gnu.org Resent-Date: Sun, 23 Mar 2025 17:42:01 +0000 Resent-Message-ID: <handler.77212.B.174275171123944@debbugs.gnu.org> 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 <debbugs-submit-bounces@debbugs.gnu.org>) 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 <brennan@umanwizard.com>) 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 <brennan@umanwizard.com>) 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 <brennan@umanwizard.com>) 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: <brennan@umanwizard.com> From: Brennan Vincent <brennan@umanwizard.com> 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 Content-Type: text/plain 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: <guix-patches.gnu.org> List-Unsubscribe: <https://lists.gnu.org/mailman/options/guix-patches>, <mailto:guix-patches-request@gnu.org?subject=unsubscribe> List-Archive: <https://lists.gnu.org/archive/html/guix-patches> List-Post: <mailto:guix-patches@gnu.org> List-Help: <mailto:guix-patches-request@gnu.org?subject=help> List-Subscribe: <https://lists.gnu.org/mailman/listinfo/guix-patches>, <mailto:guix-patches-request@gnu.org?subject=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 |
Series |
[bug#77212] gnu: rust: install stdlib manifest with original checksums
|
|
Commit Message
Brennan Vincent
March 23, 2025, 5:41 p.m. UTC
* 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
Comments
Does it have to be the original checksums or will correct checksums work? Currently to save time we set all the checksums to e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855 (an empty file). What changed in rust-analyzer 1.82 that made it change? Or was that part of the error message? On Sun, Mar 23, 2025 at 10:41:23AM -0700, Brennan Vincent wrote: > * gnu/packages/rust.scm (rust): install stdlib manifest with original checksums > > Change-Id: I1100ffe4ff67c8e2026e802fc3902ec218e2efee > --- > gnu/packages/rust.scm | 16 ++++++++++++++++ > 1 file changed, 16 insertions(+) > > 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::<usize>::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 _ > > base-commit: b54a9ca849f013300c633fb79d80bc754f6b28a2 > prerequisite-patch-id: 2b36f42a4b79ce79d12ce58a03de81902054f2a1 > -- > 2.49.0 > >
Efraim Flashner <efraim@flashner.co.il> writes: > Does it have to be the original checksums or will correct checksums > work? Currently to save time we set all the checksums to > e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855 (an > empty file). Yes, sorry for being imprecise -- it needs to be the correct checksums, which in the case of the stdlib seems to be the same as the original checksums. I suppose if that ever changes we would need to change this to actually apply re-checksum everything. > > What changed in rust-analyzer 1.82 that made it change? Or was that part > of the error message? Before 1.82, rust-analyzer analyzed the stdlib in a different way, which didn't require it to run `cargo metadata`, which is the step that fails here (because cargo bails out with an error if the checksums are wrong). > > On Sun, Mar 23, 2025 at 10:41:23AM -0700, Brennan Vincent wrote: >> * gnu/packages/rust.scm (rust): install stdlib manifest with original checksums >> >> Change-Id: I1100ffe4ff67c8e2026e802fc3902ec218e2efee >> --- >> gnu/packages/rust.scm | 16 ++++++++++++++++ >> 1 file changed, 16 insertions(+) >> >> 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::<usize>::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 _ >> >> base-commit: b54a9ca849f013300c633fb79d80bc754f6b28a2 >> prerequisite-patch-id: 2b36f42a4b79ce79d12ce58a03de81902054f2a1 >> -- >> 2.49.0 >> >> > > -- > Efraim Flashner <efraim@flashner.co.il> אפרים פלשנר > GPG key = A28B F40C 3E55 1372 662D 14F7 41AA E7DC CA3D 8351 > Confidentiality cannot be guaranteed on emails sent or received unencrypted
Ping. Efraim, any thoughts on this? "Brennan Vincent" <brennan@umanwizard.com> writes: > Efraim Flashner <efraim@flashner.co.il> writes: > >> Does it have to be the original checksums or will correct checksums >> work? Currently to save time we set all the checksums to >> e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855 (an >> empty file). > > Yes, sorry for being imprecise -- it needs to be the correct checksums, > which in the case of the stdlib seems to be the same as the original > checksums. I suppose if that ever changes we would need to change this > to actually apply re-checksum everything. > >> >> What changed in rust-analyzer 1.82 that made it change? Or was that part >> of the error message? > > Before 1.82, rust-analyzer analyzed the stdlib in a different way, which > didn't require it to run `cargo metadata`, which is the step that fails > here (because cargo bails out with an error if the checksums are wrong). > >> >> On Sun, Mar 23, 2025 at 10:41:23AM -0700, Brennan Vincent wrote: >>> * gnu/packages/rust.scm (rust): install stdlib manifest with original checksums >>> >>> Change-Id: I1100ffe4ff67c8e2026e802fc3902ec218e2efee >>> --- >>> gnu/packages/rust.scm | 16 ++++++++++++++++ >>> 1 file changed, 16 insertions(+) >>> >>> 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::<usize>::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 _ >>> >>> base-commit: b54a9ca849f013300c633fb79d80bc754f6b28a2 >>> prerequisite-patch-id: 2b36f42a4b79ce79d12ce58a03de81902054f2a1 >>> -- >>> 2.49.0 >>> >>> >> >> -- >> Efraim Flashner <efraim@flashner.co.il> אפרים פלשנר >> GPG key = A28B F40C 3E55 1372 662D 14F7 41AA E7DC CA3D 8351 >> Confidentiality cannot be guaranteed on emails sent or received unencrypted
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::<usize>::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 _