[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
142/470: build: cargo-build-system: Don't try to package when skipping b
From: |
guix-commits |
Subject: |
142/470: build: cargo-build-system: Don't try to package when skipping build. |
Date: |
Thu, 16 Mar 2023 03:00:47 -0400 (EDT) |
efraim pushed a commit to branch rust-team
in repository guix.
commit 4a915307714ba6e34bd6d99b61f3b0f0342ac700
Author: Efraim Flashner <efraim@flashner.co.il>
AuthorDate: Wed Nov 10 19:48:12 2021 +0200
build: cargo-build-system: Don't try to package when skipping build.
* guix/build/cargo-build-system.scm (package): If the package isn't
going to be built then use the source instead.
---
guix/build/cargo-build-system.scm | 18 +++++++++++++++++-
1 file changed, 17 insertions(+), 1 deletion(-)
diff --git a/guix/build/cargo-build-system.scm
b/guix/build/cargo-build-system.scm
index 41766228c2..5d7bfc8eb3 100644
--- a/guix/build/cargo-build-system.scm
+++ b/guix/build/cargo-build-system.scm
@@ -210,12 +210,28 @@ directory = '" port)
#t))
(define* (package #:key
+ source
+ skip-build?
install-source?
(cargo-package-flags '("--no-metadata" "--no-verify"))
#:allow-other-keys)
"Run 'cargo-package' for a given Cargo package."
(if install-source?
- (apply invoke `("cargo" "package" ,@cargo-package-flags))
+ (if skip-build?
+ (begin
+ (install-file source "target/package")
+ (with-directory-excursion "target/package"
+ (for-each
+ (lambda (file)
+ (make-file-writable file)
+ ;; Strip the hash and replace '.tar.gz' with '.crate'.
+ (rename-file file
+ (string-append (string-drop-right
+ (string-drop file 35)
+ (string-length ".tar.gz"))
+ ".crate")))
+ (find-files "." "\\.tar\\.gz$"))))
+ (apply invoke `("cargo" "package" ,@cargo-package-flags)))
(format #t "Not installing cargo sources, skipping `cargo package`.~%"))
#t)
- 58/470: gnu: rust-cxx-1: Update to 1.0.86., (continued)
- 58/470: gnu: rust-cxx-1: Update to 1.0.86., guix-commits, 2023/03/16
- 67/470: gnu: rust-serde-urlencoded-0.7: Update to 0.7.1., guix-commits, 2023/03/16
- 69/470: gnu: rust-serde-ignored-0.1: Update to 0.1.7., guix-commits, 2023/03/16
- 71/470: gnu: rust-crossbeam-0.8: Update to 0.8.2., guix-commits, 2023/03/16
- 72/470: gnu: rust-crossbeam-epoch-0.9: Update to 0.9.13., guix-commits, 2023/03/16
- 86/470: gnu: rust-matches-0.1: Update to 0.1.9., guix-commits, 2023/03/16
- 91/470: gnu: rust-rand-0.8: Update to 0.8.5., guix-commits, 2023/03/16
- 115/470: gnu: rust-curl-0.4: Update to 0.4.43., guix-commits, 2023/03/16
- 98/470: gnu: rust-string-cache-0.8: Update to 0.8.4., guix-commits, 2023/03/16
- 95/470: gnu: rust-rand-hc-0.3: Update to 0.3.1., guix-commits, 2023/03/16
- 142/470: build: cargo-build-system: Don't try to package when skipping build.,
guix-commits <=
- 114/470: gnu: rust-crates-io-0.33: Update to 0.33.1., guix-commits, 2023/03/16
- 60/470: gnu: rust-trybuild-1: Update to 1.0.75., guix-commits, 2023/03/16
- 61/470: gnu: rust-serde-big-array-0.3: Update to 0.3.3., guix-commits, 2023/03/16
- 62/470: gnu: rust-serde-bytes-0.11: Update to 0.11.8., guix-commits, 2023/03/16
- 65/470: gnu: rust-serde-repr-0.1: Update to 0.1.10., guix-commits, 2023/03/16
- 66/470: gnu: rust-serde-test-1: Update to 1.0.152., guix-commits, 2023/03/16
- 68/470: gnu: rust-serde-yaml-0.8: Update to 0.8.26., guix-commits, 2023/03/16
- 73/470: gnu: rust-crossbeam-queue-0.3: Update to 0.3.8., guix-commits, 2023/03/16
- 76/470: gnu: rust-cast-0.2: Update to 0.2.7., guix-commits, 2023/03/16
- 138/470: gnu: Add rust-1.67., guix-commits, 2023/03/16