Subject: [rust] Segfault when trying to download dependencies using Cargo

From: Johannes Nix <[email-masked]>
Date: Fri, 01 Aug 2025 20:53:18 +0000

> 
> mve $ cargo build
>     Updating crates.io index
> Segmentation fault (core dumped)

I am very new to Guix System - just installed it this
morning.

However, I seem to have had the same issue today,
and apparently found a workaroung.

I tried to run it under strace and it indicated that
apparently it segfaults when it tries to find and
parse several git config files, especially
$HOME/.gitconfig .

Found on the web multiple suggestions that these config
files might be faulty - but I could not find any fault
in my file.

Instead, I found a workaround that might help you:

I set the environment variable

export CARGO_NET_GIT_FETCH_WITH_CLI=true

which changes the way in which cargo uses git.
With this, it works for me.

On top of that, I had further errors with cargo 
which might or might not be unrelated, when doing a
"cargo build". There it looks like rust-cargo and
rustc-1.82.0 are somehow out of sync, leading cargo to
query rustc for a profile option which is not supported by
rustc (print-split-debuginfo). Roughly, it is failing
with this error message, which relates to a much older
version:

https://github.com/kbknapp/cargo-outdated/issues/355

But, *both* errors only happen on my new Guix System
installation, not in Guix package manager on top
of Debian 12 with the same rust-cargo version.

I'll make a separate bug tracking entry for that one
(I need to capture the output and check the version
numbers again).

I suspicion I have is that actually one of rustc or
cargo might actually refer to an out-dated version,
causing a mismatch. Perhaps because of an ci glitch.

Perhaps it is informative to check the installed
version with "cargo -vV" ? One important point
is surely to not mix up manually installed binaries
and the Guix-installed ones... but I am still new
and confused by all this.

--

Johannes Nix