[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
01/20: build: cargo-build-system: Use Cargo checksum stubs.
From: |
guix-commits |
Subject: |
01/20: build: cargo-build-system: Use Cargo checksum stubs. |
Date: |
Sun, 5 Jan 2025 06:03:40 -0500 (EST) |
efraim pushed a commit to branch rust-team
in repository guix.
commit 87b34d1772cbe584e7d67c4b1b42d189365a29fd
Author: Herman Rimm <herman@rimm.ee>
AuthorDate: Fri Jan 3 17:07:23 2025 +0100
build: cargo-build-system: Use Cargo checksum stubs.
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
Signed-off-by: Efraim Flashner <efraim@flashner.co.il>
---
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 065401aa3a..5ef6b23abd 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@kadziolka.net>
;;; Copyright © 2020 Marius Bakke <marius@gnu.org>
;;; Copyright © 2024 Maxim Cournoyer <maxim.cournoyer@gmail.com>
+;;; Copyright © 2025 Herman Rimm <herman@rimm.ee>
;;;
;;; This file is part of GNU Guix.
;;;
@@ -26,7 +27,6 @@
#: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)
@@ -223,13 +223,19 @@ directory = '" vendor-dir "'") port)
(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?
- branch rust-team updated (bb6e1d6eff -> 57148c6945), guix-commits, 2025/01/05
- 01/20: build: cargo-build-system: Use Cargo checksum stubs.,
guix-commits <=
- 03/20: gnu: Add rust-nvml-wrapper-0.10., guix-commits, 2025/01/05
- 04/20: gnu: Add rust-nvml-wrapper-sys-0.8., guix-commits, 2025/01/05
- 02/20: gnu: Add rust-concat-string-1., guix-commits, 2025/01/05
- 05/20: gnu: Add rust-ratatui-0.27., guix-commits, 2025/01/05
- 06/20: gnu: Add rust-starship-battery-0.9., guix-commits, 2025/01/05
- 07/20: gnu: Add rust-unicode-ellipsis-0.2., guix-commits, 2025/01/05
- 08/20: gnu: Add rust-portable-pty-0.8., guix-commits, 2025/01/05
- 11/20: gnu: Add rust-stability-0.2., guix-commits, 2025/01/05
- 13/20: gnu: Add rust-serial-core-0.4., guix-commits, 2025/01/05
- 10/20: gnu: Add rust-pretty-bytes-0.2., guix-commits, 2025/01/05