From: "Ignas Lapėnas" <ignas@lapenas.dev>
To: help-guix@gnu.org
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 [thread overview]
Message-ID: <87jznpg9by.fsf@lapenas.dev> (raw)
In-Reply-To: <254357062.342979.1706649142505@office.mailbox.org>
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
prev parent reply other threads:[~2024-01-31 9:08 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-01-30 21:12 Network error when cargo-build-system fetches dependency from external repository specified in Cargo.toml Airi via
2024-01-30 21:32 ` Ian Eure
2024-01-31 8:57 ` Ignas Lapėnas [this message]
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=87jznpg9by.fsf@lapenas.dev \
--to=ignas@lapenas.dev \
--cc=help-guix@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.
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).