help-guix
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Network error when cargo-build-system fetches dependency from extern


From: Ignas Lapėnas
Subject: Re: Network error when cargo-build-system fetches dependency from external repository specified in Cargo.toml
Date: Wed, 31 Jan 2024 10:57:21 +0200
User-agent: mu4e 1.10.8; emacs 30.0.50

Hi Airi,

All rust builds are isolated from the network. In order to build a package,
usually you must provide packages from guix crates-io.scm
<https://git.savannah.gnu.org/git/guix.git/>

Using guix edit and a rust package would also open a current version of guix

for example `guix edit rust-async-recursion` would open crates-io.scm and point
to the package.

┌────
│ (define-public rust-async-recursion-1
│   (package
│     (name "rust-async-recursion")
│     (version "1.0.4")
│     (source (origin
│               (method url-fetch)
│               (uri (crate-uri "async-recursion" version))
│               (file-name (string-append name "-" version ".tar.gz"))
│               (sha256
│                (base32
│                 "1fhwz7jqgsakbjsr2nrsvgs245l1m5dkzir6f9fxw4ngwrywx5qf"))))
│     (build-system cargo-build-system)
│     (arguments
│      `(#:tests? #f      ; TODO: Tests unexpectedly pass.
│        #:cargo-inputs
│        (("rust-proc-macro2" ,rust-proc-macro2-1)
│         ("rust-quote" ,rust-quote-1)
│         ("rust-syn" ,rust-syn-2))
│        #:cargo-development-inputs
│        (("rust-futures-executor" ,rust-futures-executor-0.3)
│         ("rust-trybuild" ,rust-trybuild-1))))
│     (home-page "https://github.com/dcchut/async-recursion";)
│     (synopsis "Recursion for async functions")
│     (description "This package provides recursion for async functions in 
Rust.")
│     (license (list license:expat license:asl2.0))))
└────

The same file contains a lot of example rust packages you can check how
dependencies are “injected”

Also if there are packages that are missing `guix import crate 
<crate>@<version>`
command is a godsend. Typing it all out would be insane.

Hope it helps.

– 
Best Regards,
Ignas Lapėnas


reply via email to

[Prev in Thread] Current Thread [Next in Thread]