From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:470:142:3::10]:45503) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1i0nTZ-000800-3w for guix-patches@gnu.org; Thu, 22 Aug 2019 09:50:06 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1i0nTX-00075L-Vp for guix-patches@gnu.org; Thu, 22 Aug 2019 09:50:05 -0400 Received: from debbugs.gnu.org ([209.51.188.43]:56584) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1i0nTX-000755-Sz for guix-patches@gnu.org; Thu, 22 Aug 2019 09:50:03 -0400 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1i0nTW-0007I8-NT for guix-patches@gnu.org; Thu, 22 Aug 2019 09:50:02 -0400 Subject: [bug#37144] [PATCH] build/cargo-build-system: Remove 'update-cargo-lock phase. Resent-Message-ID: Received: from eggs.gnu.org ([2001:470:142:3::10]:45301) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1i0nSt-0007E4-1j for guix-patches@gnu.org; Thu, 22 Aug 2019 09:49:24 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1i0nSr-0006jY-GR for guix-patches@gnu.org; Thu, 22 Aug 2019 09:49:22 -0400 Received: from flashner.co.il ([178.62.234.194]:37612) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1i0nSr-0006hu-Ae for guix-patches@gnu.org; Thu, 22 Aug 2019 09:49:21 -0400 From: Efraim Flashner Date: Thu, 22 Aug 2019 16:49:02 +0300 Message-Id: <20190822134902.24168-1-efraim@flashner.co.il> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guix-patches-bounces+kyle=kyleam.com@gnu.org Sender: "Guix-patches" To: 37144@debbugs.gnu.org * 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 =20 In its @code{configure} phase, this build system will make any source in= puts specified in the @code{#:cargo-inputs} and @code{#:cargo-development-inp= uts} -parameters available to cargo. The @code{update-cargo-lock} phase will, -when there is a @code{Cargo.lock} file, update the @code{Cargo.lock} fil= e -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 bin= aries +if they are defined by the crate. @end defvr =20 @cindex Clojure (programming language) diff --git a/guix/build/cargo-build-system.scm b/guix/build/cargo-build-s= ystem.scm index 7d363a18a5..06ed14b89f 100644 --- a/guix/build/cargo-build-system.scm +++ b/guix/build/cargo-build-system.scm @@ -134,22 +134,12 @@ directory =3D '" port) ;; upgrading the compiler for example. (setenv "RUSTFLAGS" "--cap-lints allow") (setenv "CC" (string-append (assoc-ref inputs "gcc") "/bin/gcc")) - #t) =20 -;; 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 create= d + ;; during the 'build phase by cargo. (when (file-exists? "Cargo.lock") - (begin - ;; Unfortunately we can't generate a Cargo.lock file until the che= cksums - ;; are generated, so we have an extra round of generate-all-checks= ums here. - (generate-all-checksums vendor-dir) - (delete-file "Cargo.lock") - (invoke "cargo" "generate-lockfile"))) + (delete-file "Cargo.lock")) #t) =20 ;; After the 'patch-generated-file-shebangs phase any vendored crates wh= o have @@ -203,7 +193,6 @@ directory =3D '" 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 pat= ch-cargo-checksums))) =20 (define* (cargo-build #:key inputs (phases %standard-phases) --=20 2.23.0