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 via email to