unofficial mirror of guix-patches@gnu.org 
 help / color / mirror / code / Atom feed
From: Efraim Flashner <efraim@flashner.co.il>
To: 37144@debbugs.gnu.org
Subject: [bug#37144] [PATCH] build/cargo-build-system: Remove 'update-cargo-lock phase.
Date: Thu, 22 Aug 2019 16:49:02 +0300	[thread overview]
Message-ID: <20190822134902.24168-1-efraim@flashner.co.il> (raw)

* guix/build/cargo-build-system.scm (update-cargo-lock): Remove
procedure.
(configure): Delete Cargo.lock file if it exists.
(%standard-phases): Remove 'update-cargo-lock.
* doc/guix.texi (Build System)[cargo-build-system]: Remove references to
the 'update-cargo-lock phase.
---
 doc/guix.texi                     |  9 ++++-----
 guix/build/cargo-build-system.scm | 19 ++++---------------
 2 files changed, 8 insertions(+), 20 deletions(-)

diff --git a/doc/guix.texi b/doc/guix.texi
index 043851e418..300d0222a6 100644
--- a/doc/guix.texi
+++ b/doc/guix.texi
@@ -5854,11 +5854,10 @@ should be added to the package definition via the
 
 In its @code{configure} phase, this build system will make any source inputs
 specified in the @code{#:cargo-inputs} and @code{#:cargo-development-inputs}
-parameters available to cargo.  The @code{update-cargo-lock} phase will,
-when there is a @code{Cargo.lock} file, update the @code{Cargo.lock} file
-with the inputs and their versions available at build time.  The
-@code{install} phase installs any crate the binaries if they are defined by
-the crate.
+parameters available to cargo.  It will also remove an included
+@code{Cargo.lock} file to be recreated by @code{cargo} during the
+@code{build} phase.  The @code{install} phase installs any crate the binaries
+if they are defined by the crate.
 @end defvr
 
 @cindex Clojure (programming language)
diff --git a/guix/build/cargo-build-system.scm b/guix/build/cargo-build-system.scm
index 7d363a18a5..06ed14b89f 100644
--- a/guix/build/cargo-build-system.scm
+++ b/guix/build/cargo-build-system.scm
@@ -134,22 +134,12 @@ directory = '" port)
   ;; upgrading the compiler for example.
   (setenv "RUSTFLAGS" "--cap-lints allow")
   (setenv "CC" (string-append (assoc-ref inputs "gcc") "/bin/gcc"))
-  #t)
 
-;; The Cargo.lock file tells the build system which crates are required for
-;; building and hardcodes their version and checksum.  In order to build with
-;; the inputs we provide, we need to recreate the file with our inputs.
-(define* (update-cargo-lock #:key
-                            (vendor-dir "guix-vendor")
-                            #:allow-other-keys)
-  "Regenerate the Cargo.lock file with the current build inputs."
+  ;; We don't use the Cargo.lock file to determine the package versions we use
+  ;; during building, and in any case if one is not present it is created
+  ;; during the 'build phase by cargo.
   (when (file-exists? "Cargo.lock")
-    (begin
-      ;; Unfortunately we can't generate a Cargo.lock file until the checksums
-      ;; are generated, so we have an extra round of generate-all-checksums here.
-      (generate-all-checksums vendor-dir)
-      (delete-file "Cargo.lock")
-      (invoke "cargo" "generate-lockfile")))
+    (delete-file "Cargo.lock"))
   #t)
 
 ;; After the 'patch-generated-file-shebangs phase any vendored crates who have
@@ -203,7 +193,6 @@ directory = '" port)
     (replace 'build build)
     (replace 'check check)
     (replace 'install install)
-    (add-after 'configure 'update-cargo-lock update-cargo-lock)
     (add-after 'patch-generated-file-shebangs 'patch-cargo-checksums patch-cargo-checksums)))
 
 (define* (cargo-build #:key inputs (phases %standard-phases)
-- 
2.23.0

             reply	other threads:[~2019-08-22 13:50 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-08-22 13:49 Efraim Flashner [this message]
2019-08-28  6:45 ` bug#37144: patch pushed Efraim Flashner

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://guix.gnu.org/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20190822134902.24168-1-efraim@flashner.co.il \
    --to=efraim@flashner.co.il \
    --cc=37144@debbugs.gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/guix.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).