unofficial mirror of help-guix@gnu.org 
 help / color / mirror / Atom feed
From: Airi via <help-guix@gnu.org>
To: "help-guix@gnu.org" <help-guix@gnu.org>
Subject: Network error when cargo-build-system fetches dependency from external repository specified in Cargo.toml
Date: Tue, 30 Jan 2024 16:12:22 -0500 (EST)	[thread overview]
Message-ID: <254357062.342979.1706649142505@office.mailbox.org> (raw)

Hello,
I am trying to package a program using the cargo-build-system.
During the build phase, it tries to fetch a dependency specified in the Cargo.toml file, but fails with a network issue. But when built outside of Guix with a hand-typed "cargo build --release", it builds without error. It's almost as though the cargo-build-system has some kind of network sandbox that prevents fetching repos from urls during the build phase...
Error logs during the build:
 
starting phase `build'
    Updating git repository `https://github.com/hearth-rs/msdfgen-rs`
warning: spurious network error (3 tries remaining): failed to resolve address for github.com: Temporary failure in name resolution; class=Net (12)
warning: spurious network error (2 tries remaining): failed to resolve address for github.com: Temporary failure in name resolution; class=Net (12)
warning: spurious network error (1 tries remaining): failed to resolve address for github.com: Temporary failure in name resolution; class=Net (12)
error: failed to get `msdfgen` as a dependency of package `font-mud v0.1.0 (/tmp/guix-build-rust-font-mud-9999.drv-0/source)`
 
The Cargo.toml file with the problematic dependency looks like this:
 
[dependencies.msdfgen]
git = "https://github.com/hearth-rs/msdfgen-rs"
branch = "fix-mac-builds"
default-features = false
features = ["ttf-parser", "png"]
 
I found that the same error occurs regardless of the url it tries to fetch from, so it's not an issue with the website. It is also not an issue with my network, since building works just fine outside of Guix package.
My assumption is that either cargo-build-system disallows connecting to websites during the build phase, or that using "git = <url>" to specify a cargo dependency in Cargo.toml is buggy with cargo-build-system. I'm really hoping that there is a cleaner fix to this than having to modify the Cargo.toml file through the package definition...
I'm wondering if perhaps there's a way clean way to override processing this dependency in Cargo.toml? And then create a separate package definition to replace that dependency? Or maybe there's a keyword for cargo-build-system that fixes this weird network issue? Or maybe the method of defining dependencies with git urls in Cargo.toml is not an appropriate practice?
The program I'm trying to package is here: https://git.disroot.org/hearth/font-mud
And here is my package definition:
 
(define rust-font-mud-9999
  (package
    (name "rust-font-mud")
    (version "9999")
    (source
     (origin
       (method git-fetch)
       (uri (git-reference
             (url "https://git.disroot.org/hearth/font-mud")
             (commit "c1e6b66f459e32ee90de2a1c29b8a2124a1a9bad")))
       (file-name (string-append name "-" version ".tar.gz"))
       (sha256
        (base32 "19a9lra546f91a3lvjjr7y9yah8q2df8754n5ch9vwdm5hdplf54"))))
    (build-system cargo-build-system)
    (home-page "https://git.disroot.org/hearth/font-mud")
    (synopsis "A library for dynamically generating and packing MSDFs of text glyphs")
    (description "A library for dynamically generating and packing MSDFs of text glyphs.")
    (license license:asl2.0)))
 
Any help would be greatly appreciated.
 
Thanks,
Airi

             reply	other threads:[~2024-01-30 21:13 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-01-30 21:12 Airi via [this message]
2024-01-30 21:32 ` Network error when cargo-build-system fetches dependency from external repository specified in Cargo.toml Ian Eure
2024-01-31  8:57 ` Ignas Lapėnas

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=254357062.342979.1706649142505@office.mailbox.org \
    --to=help-guix@gnu.org \
    --cc=senkowo@mailbox.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).