[PATCH] build/cargo-build-system: Remove 'update-cargo-lock phase.

DoneSubmitted by Efraim Flashner.
One participant
  • Efraim Flashner
Efraim Flashner wrote on 22 Aug 2019 15:49
(address . guix-patches@gnu.org)
* guix/build/cargo-build-system.scm (update-cargo-lock): Removeprocedure.(configure): Delete Cargo.lock file if it exists.(%standard-phases): Remove 'update-cargo-lock.* doc/guix.texi (Build System)[cargo-build-system]: Remove references tothe 'update-cargo-lock phase.--- doc/guix.texi | 9 ++++----- guix/build/cargo-build-system.scm | 19 ++++--------------- 2 files changed, 8 insertions(+), 20 deletions(-)
Toggle diff (61 lines)diff --git a/doc/guix.texi b/doc/guix.texiindex 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.scmindex 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
Efraim Flashner wrote on 28 Aug 2019 08:45
patch pushed
(address . 37144-done@debbugs.gnu.org)
pushed to master as 3762e31b6c8089928aad3186f70f157502950e3b

-- Efraim Flashner <efraim@flashner.co.il> אפרים פלשנרGPG key = A28B F40C 3E55 1372 662D 14F7 41AA E7DC CA3D 8351Confidentiality cannot be guaranteed on emails sent or received unencrypted
iQIzBAABCgAdFiEEoov0DD5VE3JmLRT3Qarn3Mo9g1EFAl1mIwsACgkQQarn3Mo9g1EpMRAAiBa8KY0B4t0WBi/BIfxnxli7zRTc7s6+2JNGSDHUzUtjctoJnTd+8hxHLneMi2vMiiLwufyDGFRNSeVvf2t5Kx0sYkjHpsoZDa3SMcMqXD7cSsRTPPxXP9Sb91MSKPteaZMLIqF+u3+mUxDrkpMIG7U/eG8/yaaoWOMySTYmNCtMHY3V8BiwGDAAJYlH3CwncTZxaYKGDJBI/k94nHF7DniKCtDHBFUZok0Rt1DlWUzX9lDPc1YL5XXgoTVVNItAzx81HBDZhLfYYLDSti/Vrv7lKqyVWRUSuj3FeD5X7OjqCXXApW0+4AzmK4N3uHRsUJiYeO+fEBRqaDDg8jQpgmqoO9jmGXOxRdy5wIhFPIBLyjNSuNCWN3Jg4Zh+lqCvPmddAzwr3vbhHo33zk9TPnWEoal36TJbdqfJrR8stOBgAjgBJmTHc9SR4RG/ar5KeVMHeiuvW+jl7Jt5mJyzUdqQidYUbvR46W+YJPKWtNCnuOoprkf+gPcYbIW2Yd+PQgBhUljU1TXXhYHxRlkHlPsacrM67TVCpzm2hGX0Kp/EnFbTlg0rDu7Vd/5FAzbz6XYCuZWRxXiGFBtSFD+wwd/h4jNgi3SuVW6xM2l2Tkc3VaR36X3b8oaodCGveW6WhwbzWpz1D7e2GqIt1Fs8aw7K3+qIkt4Cjv3espilmdc==chFp-----END PGP SIGNATURE-----

Your comment

This issue is archived.

To comment on this conversation send email to 37144@debbugs.gnu.org