diff mbox series

[bug#45307] : build-system/cargo: Use argument "--no-track" in "cargo install"

Message ID 86h7oj4zms.fsf@163.com
State Accepted
Headers show
Series [bug#45307] : build-system/cargo: Use argument "--no-track" in "cargo install" | expand

Checks

Context Check Description
cbaines/submitting builds success
cbaines/comparison success View comparision
cbaines/git branch success View Git branch
cbaines/applying patch fail View Laminar job
cbaines/issue success View issue

Commit Message

Zhu Zihao Dec. 18, 2020, 2:27 a.m. UTC
After we update rust to rust-1.45, cargo install now create
.crates2.json instead of .crates.toml. So the hack we use in
c1cc0c4865a8bfff43c5c9bd6ae8dcadb061c8a0 doesn't work.

I checked the ArchLinux Rust packaging guideline and found that we
should use --no-track in "cargo install" to prevent cargo install these
files to prefix.

Comments

Zhu Zihao Dec. 31, 2020, 9:50 a.m. UTC | #1
Ping for response.
Efraim Flashner Dec. 31, 2020, 12:41 p.m. UTC | #2
On Fri, Dec 18, 2020 at 10:27:39AM +0800, Zhu Zihao wrote:
> 
> After we update rust to rust-1.45, cargo install now create
> .crates2.json instead of .crates.toml. So the hack we use in
> c1cc0c4865a8bfff43c5c9bd6ae8dcadb061c8a0 doesn't work.
> 
> I checked the ArchLinux Rust packaging guideline and found that we
> should use --no-track in "cargo install" to prevent cargo install these
> files to prefix.
> 

I remember looking at that too after watching the archconf video. Thanks
for turning it into a patch. Patch pushed!
diff mbox series

Patch

From fadf6149f998758c1d663d3dbe1c6fe8a85e5700 Mon Sep 17 00:00:00 2001
From: Zhu Zihao <all_but_last@163.com>
Date: Fri, 18 Dec 2020 10:13:48 +0800
Subject: [PATCH] build-system/cargo: Use argument "--no-track" in "cargo
 install"

Prevent cargo install .crates.toml or .crates2.json to prefix.

* guix/build/cargo-build-system(install):
Add argument "--no-track" in "cargo install".
Remove stale hack.
---
 guix/build/cargo-build-system.scm | 6 +-----
 1 file changed, 1 insertion(+), 5 deletions(-)

diff --git a/guix/build/cargo-build-system.scm b/guix/build/cargo-build-system.scm
index c7beffc6e4..1d21b33895 100644
--- a/guix/build/cargo-build-system.scm
+++ b/guix/build/cargo-build-system.scm
@@ -183,13 +183,9 @@  directory = '" port)
     ;; otherwise cargo will raise an error.
     (or skip-build?
         (not (has-executable-target?))
-        (invoke "cargo" "install" "--path" "." "--root" out
+        (invoke "cargo" "install" "--no-track" "--path" "." "--root" out
                 "--features" (string-join features)))
 
-    ;; This is a file which we definitely don't need installed.
-    (when (file-exists? (string-append out "/.crates.toml"))
-      (delete-file (string-append out "/.crates.toml")))
-
     #t))
 
 (define %standard-phases
-- 
2.29.2