[PATCH 0/3] cargo build system fixes

DoneSubmitted by Robert Vollmert.
Details
2 participants
  • Danny Milosavljevic
  • Robert Vollmert
Owner
unassigned
Severity
normal
R
R
Robert Vollmert wrote on 15 Jul 2019 21:40
(address . guix-patches@gnu.org)(name . Robert Vollmert)(address . rob@vllmrt.net)
20190715194028.91259-1-rob@vllmrt.net
Primarily this removes the build-side dependency on guile-json,but fixes some bugs along the way.
Robert Vollmert (3): guix: cargo-build-system: Set CARGO_HOME early to fix build gnu: Update rust-proc-macro2 to 0.4.30 to fix tests guix: cargo-build-system: Use bundled json instead of guile-json
gnu/packages/crates-io.scm | 4 ++-- guix/build-system/cargo.scm | 2 +- guix/build/cargo-build-system.scm | 12 +++++------- 3 files changed, 8 insertions(+), 10 deletions(-)
-- 2.20.1 (Apple Git-117)
R
R
Robert Vollmert wrote on 15 Jul 2019 21:41
[PATCH 1/3] guix: cargo-build-system: Set CARGO_HOME early to fix build
(address . 36676@debbugs.gnu.org)(name . Robert Vollmert)(address . rob@vllmrt.net)
20190715194155.91313-1-rob@vllmrt.net
This makes the packages from (gnu packages crates-io)not fail to build outright with
starting phase `build'error: failed to acquire package cache lock
Caused by: failed to open: /homeless-shelter/.cargo/.package-cache
Caused by: Permission denied (os error 13)phase `build' failed after 0.0 seconds
* guix/build/cargo-build-system.scm (configure): Set CARGO_HOME.(install): No longer set CARGO_HOME.--- guix/build/cargo-build-system.scm | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-)
Toggle diff (24 lines)diff --git a/guix/build/cargo-build-system.scm b/guix/build/cargo-build-system.scmindex 1f36304b15..e4e62dd838 100644--- a/guix/build/cargo-build-system.scm+++ b/guix/build/cargo-build-system.scm@@ -99,6 +99,7 @@ Cargo.toml file present at its root." inputs) ;; Configure cargo to actually use this new directory.+ (setenv "CARGO_HOME" (string-append (getcwd) "/.cargo")) (mkdir-p ".cargo") (let ((port (open-file ".cargo/config" "w" #:encoding "utf-8"))) (display "@@ -148,9 +149,6 @@ directory = '" port) ;; Make cargo reuse all the artifacts we just built instead ;; of defaulting to making a new temp directory (setenv "CARGO_TARGET_DIR" "./target")- ;; Force cargo to honor our .cargo/config definitions- ;; https://github.com/rust-lang/cargo/issues/6397- (setenv "CARGO_HOME" ".") ;; Only install crates which include binary targets, ;; otherwise cargo will raise an error.-- 2.20.1 (Apple Git-117)
R
R
Robert Vollmert wrote on 15 Jul 2019 21:41
[PATCH 2/3] gnu: Update rust-proc-macro2 to 0.4.30 to fix tests
(address . 36676@debbugs.gnu.org)(name . Robert Vollmert)(address . rob@vllmrt.net)
20190715194155.91313-2-rob@vllmrt.net
Previously, one test was failing:
failures: test_debug_tokenstream
test result: FAILED. 19 passed; 1 failed; 0 ignored; 0 measured; 0 filtered out
* gnu/packages/crates-io.scm (rust-proc-macro2): Update to 0.4.30.--- gnu/packages/crates-io.scm | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
Toggle diff (24 lines)diff --git a/gnu/packages/crates-io.scm b/gnu/packages/crates-io.scmindex b480b6fe56..db9665d1aa 100644--- a/gnu/packages/crates-io.scm+++ b/gnu/packages/crates-io.scm@@ -47,7 +47,7 @@ or XID_Continue properties according to Unicode Standard Annex #31.") (define-public rust-proc-macro2 (package (name "rust-proc-macro2")- (version "0.4.27")+ (version "0.4.30") (source (origin (method url-fetch)@@ -56,7 +56,7 @@ or XID_Continue properties according to Unicode Standard Annex #31.") (string-append name "-" version ".tar.gz")) (sha256 (base32- "05c92v787snyaq4ss16vxc9mdv6zndfgsdq8k3hnnyffmsf7ycad"))))+ "0nd71fl24sys066jrha6j7i34nfkjv44yzw8yww9742wmc8j0gfg")))) (build-system cargo-build-system) (arguments `(#:cargo-inputs (("rust-unicode-xid" ,rust-unicode-xid))-- 2.20.1 (Apple Git-117)
R
R
Robert Vollmert wrote on 15 Jul 2019 21:41
[PATCH 3/3] guix: cargo-build-system: Use bundled json instead of guile-json
(address . 36676@debbugs.gnu.org)(name . Robert Vollmert)(address . rob@vllmrt.net)
20190715194155.91313-3-rob@vllmrt.net
Per https://lists.gnu.org/archive/html/guix-devel/2019-07/msg00193.html
* guix/build/cargo-build-system.scm: Use (gnu build json) insteadof (json parser).* guix/build-system/cargo.scm: Import (gnu build json) instead of(json parser).--- guix/build-system/cargo.scm | 2 +- guix/build/cargo-build-system.scm | 8 ++++---- 2 files changed, 5 insertions(+), 5 deletions(-)
Toggle diff (54 lines)diff --git a/guix/build-system/cargo.scm b/guix/build-system/cargo.scmindex fa211d456d..10a1bac844 100644--- a/guix/build-system/cargo.scm+++ b/guix/build-system/cargo.scm@@ -61,7 +61,7 @@ to NAME and VERSION." (define %cargo-build-system-modules ;; Build-side modules imported by default. `((guix build cargo-build-system)- (json parser)+ (guix build json) ,@%cargo-utils-modules)) (define* (cargo-build store name inputsdiff --git a/guix/build/cargo-build-system.scm b/guix/build/cargo-build-system.scmindex e4e62dd838..f38de16cf7 100644--- a/guix/build/cargo-build-system.scm+++ b/guix/build/cargo-build-system.scm@@ -20,6 +20,7 @@ (define-module (guix build cargo-build-system) #:use-module ((guix build gnu-build-system) #:prefix gnu:)+ #:use-module (guix build json) #:use-module (guix build utils) #:use-module (guix build cargo-utils) #:use-module (ice-9 popen)@@ -27,7 +28,6 @@ #:use-module (ice-9 ftw) #:use-module (ice-9 format) #:use-module (ice-9 match)- #:use-module (json parser) #:use-module (srfi srfi-1) #:use-module (srfi srfi-26) #:export (%standard-phases@@ -42,15 +42,15 @@ (define (manifest-targets) "Extract all targets from the Cargo.toml manifest" (let* ((port (open-input-pipe "cargo read-manifest"))- (data (json->scm port))- (targets (hash-ref data "targets" '())))+ (data (read-json port))+ (targets (or (assoc-ref data "targets") '()))) (close-port port) targets)) (define (has-executable-target?) "Check if the current cargo project declares any binary targets." (let* ((bin? (lambda (kind) (string=? kind "bin")))- (get-kinds (lambda (dep) (hash-ref dep "kind")))+ (get-kinds (lambda (dep) (assoc-ref dep "kind"))) (bin-dep? (lambda (dep) (find bin? (get-kinds dep))))) (find bin-dep? (manifest-targets)))) -- 2.20.1 (Apple Git-117)
D
D
Danny Milosavljevic wrote on 15 Jul 2019 22:37
Re: [bug#36676] [PATCH 0/3] cargo build system fixes
(name . Robert Vollmert)(address . rob@vllmrt.net)(address . 36676@debbugs.gnu.org)
20190715223720.426b7967@scratchpost.org
These patches LGTM!
-----BEGIN PGP SIGNATURE-----
iQEzBAEBCAAdFiEEds7GsXJ0tGXALbPZ5xo1VCwwuqUFAl0s5AAACgkQ5xo1VCwwuqXYLAf/UURAEjBhJXVdtCZWxn/mfONOhR0wnPWUmom9l3Syra19rSj7XtVVNafugLl6UVSqvRkg5AAnNOcFuH0i1NwKNGuci2T5HVSWt85+nPb/73yJ190wo3PQBo2UFfm8mrF5CxYQCV4t5AmJmv0BUW03wa8uPW86rhB1ShSFBtylYqqFmMJzjQv+jtbCcIOTohm26cpjICNqiWtKCt11Jl4//CtODUxB/14693wFejQHRRuF+6S+e546WZMFKF11ccr0hvuexnrb4ig03tC3hYJvlf3UpPEvC7K775XPeo44dKQpy0Kf1HQade8egRb+w9jkHVz4YG2VQmPr7ja6D9fnGQ===Rs0N-----END PGP SIGNATURE-----

D
D
Danny Milosavljevic wrote on 16 Jul 2019 09:57
(name . Robert Vollmert)(address . rob@vllmrt.net)(address . 36676-done@debbugs.gnu.org)
20190716095745.12822906@scratchpost.org
Hi Robert,
thanks!
I've pushed these to guix master as commits
c82c16a6f3cfeec82ba8bd7572b11852a6152c7e,848862f0297dfb50197638a0828ba1e714a07074,4fde0030d42068b347d7af58ed3b746c5ea2f877.
-----BEGIN PGP SIGNATURE-----
iQEzBAEBCAAdFiEEds7GsXJ0tGXALbPZ5xo1VCwwuqUFAl0tg3kACgkQ5xo1VCwwuqUHCgf/TyS2p5oF3R/lrI7F/B5I3kbsaciKWSJ8wsRsyR7yXqHF7IBCObj4mLA8lj+Ydiiw85vURMeAKz79kNU7QBwmuX3a1BCVeIL/QFTHYrMNfK8qzUq05Spu2KTeay0XSdgFsYIFkvdlYyxNt2kD3E9DGS5/AHWuWK4WTi07SfUS4fh8qqcPxw713doolhThrHoAUSnAZs+5Z27+jD5vrx1RNYTMinesZ4QZh48+QXCJSsxu3w6gayb7Io6f0jQPPdxKfxOsqQTVRWwmURbTM3JDrAZzngTJXC2aTXb+/q3jAVUQaUqnhOcAqNxN5yYhw5Amy2xrJwfCi4yl7J7zIbDPLA===HEHb-----END PGP SIGNATURE-----

Closed
?
Your comment

This issue is archived.

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