GNU bug report logs - #75321
[PATCH rust-team] build: cargo-build-system: Use Cargo checksum stubs.

Previous Next

Package: guix-patches;

Reported by: Herman Rimm <herman <at> rimm.ee>

Date: Fri, 3 Jan 2025 16:09:02 UTC

Severity: normal

Tags: patch

Done: Efraim Flashner <efraim <at> flashner.co.il>

Bug is archived. No further changes may be made.

To add a comment to this bug, you must first unarchive it, by sending
a message to control AT debbugs.gnu.org, with unarchive 75321 in the body.
You can then email your comments to 75321 AT debbugs.gnu.org in the normal way.

Toggle the display of automated, internal messages from the tracker.

View this report as an mbox folder, status mbox, maintainer mbox


Report forwarded to efraim <at> flashner.co.il, guix-patches <at> gnu.org:
bug#75321; Package guix-patches. (Fri, 03 Jan 2025 16:09:02 GMT) Full text and rfc822 format available.

Acknowledgement sent to Herman Rimm <herman <at> rimm.ee>:
New bug report received and forwarded. Copy sent to efraim <at> flashner.co.il, guix-patches <at> gnu.org. (Fri, 03 Jan 2025 16:09:02 GMT) Full text and rfc822 format available.

Message #5 received at submit <at> debbugs.gnu.org (full text, mbox):

From: Herman Rimm <herman <at> rimm.ee>
To: guix-patches <at> gnu.org
Subject: [PATCH rust-team] build: cargo-build-system: Use Cargo checksum stubs.
Date: Fri,  3 Jan 2025 17:07:23 +0100
Commit 5b08b8fe1019147fe489db17a9a8ae7ebe97f9e9 of Cargo makes the
package field optional.  This is the case since Rust 1.22.0.

* guix/build/cargo-build-system.scm (patch-cargo-checksums): Create
.cargo-checksum.json stubs.

Change-Id: I474e8f73b6048e53f22a8d899a8e3e50b5332f60
---
 guix/build/cargo-build-system.scm | 16 +++++++++++-----
 1 file changed, 11 insertions(+), 5 deletions(-)

diff --git a/guix/build/cargo-build-system.scm b/guix/build/cargo-build-system.scm
index 480134402f2..bbb79a7331b 100644
--- a/guix/build/cargo-build-system.scm
+++ b/guix/build/cargo-build-system.scm
@@ -6,6 +6,7 @@
 ;;; Copyright © 2020 Jakub Kądziołka <kuba <at> kadziolka.net>
 ;;; Copyright © 2020 Marius Bakke <marius <at> gnu.org>
 ;;; Copyright © 2024 Maxim Cournoyer <maxim.cournoyer <at> gmail.com>
+;;; Copyright © 2025 Herman Rimm <herman <at> rimm.ee>
 ;;;
 ;;; This file is part of GNU Guix.
 ;;;
@@ -26,7 +27,6 @@ (define-module (guix build cargo-build-system)
   #:use-module ((guix build gnu-build-system) #:prefix gnu:)
   #:use-module (guix build json)
   #:use-module ((guix build utils) #:hide (delete))
-  #:use-module (guix build cargo-utils)
   #:use-module (ice-9 popen)
   #:use-module (ice-9 rdelim)
   #:use-module (ice-9 ftw)
@@ -222,13 +222,19 @@ (define* (configure #:key inputs
   (when (file-exists? "Cargo.lock")
     (delete-file "Cargo.lock")))
 
-;; After the 'patch-generated-file-shebangs phase any vendored crates who have
-;; their shebangs patched will have a mismatch on their checksum.
+;; See: https://github.com/rust-lang/cargo/issues/11063.
 (define* (patch-cargo-checksums #:key
                                 (vendor-dir "guix-vendor")
                                 #:allow-other-keys)
-  "Patch the checksums of the vendored crates after patching their shebangs."
-  (generate-all-checksums vendor-dir))
+  "Add a stub checksum to each crate in VENDOR-DIR."
+  (with-directory-excursion vendor-dir
+    (call-with-output-file ".cargo-checksum.json"
+      (cut display "{\"files\":{}}" <>))
+    (for-each (lambda (dir)
+                (copy-file ".cargo-checksum.json"
+                           (string-append dir "/.cargo-checksum.json")))
+              (drop (scandir ".") 3))
+    (delete-file ".cargo-checksum.json")))
 
 (define* (build #:key
                 parallel-build?

base-commit: 5f92f009a19c1a5a8b7df5a7bcb1e1f283a953f8
-- 
2.45.2





Reply sent to Efraim Flashner <efraim <at> flashner.co.il>:
You have taken responsibility. (Sun, 05 Jan 2025 11:05:04 GMT) Full text and rfc822 format available.

Notification sent to Herman Rimm <herman <at> rimm.ee>:
bug acknowledged by developer. (Sun, 05 Jan 2025 11:05:05 GMT) Full text and rfc822 format available.

Message #10 received at 75321-done <at> debbugs.gnu.org (full text, mbox):

From: Efraim Flashner <efraim <at> flashner.co.il>
To: Herman Rimm <herman <at> rimm.ee>
Cc: 75321-done <at> debbugs.gnu.org
Subject: Re: [bug#75321] [PATCH rust-team] build: cargo-build-system: Use
 Cargo checksum stubs.
Date: Sun, 5 Jan 2025 13:03:56 +0200
[Message part 1 (text/plain, inline)]
This saves an incredible amount of time especially on slower machines
(aka aarch64 and riscv64), and was on my TODO list for years.  Thanks!

-- 
Efraim Flashner   <efraim <at> 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
[signature.asc (application/pgp-signature, inline)]

bug archived. Request was from Debbugs Internal Request <help-debbugs <at> gnu.org> to internal_control <at> debbugs.gnu.org. (Sun, 02 Feb 2025 12:24:09 GMT) Full text and rfc822 format available.

This bug report was last modified 133 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.