It's been a while since I've complained about #RustLang itself, so…

Cargo insists on interacting with #git repositories. At the same time, cargo insists on vendoring an old version of #LibGit2 (1.6.2 FWICS). So, if your system is using a new git version (2.44.0), you won't be able to `cargo build`:

```
error: failed to determine package fingerprint for build script for uv v0.1.38 (/tmp/uv/crates/uv)

Caused by:
failed to determine the most recently modified file in /tmp/uv/crates/uv

Caused by:
failed to determine list of files in /tmp/uv/crates/uv

Caused by:
failed to open git index at /tmp/uv/.git/

Caused by:
invalid data in index - calculated checksum does not match expected; class=Index (10)
```

You have to clone everything with `-c index.skipHash=false` to work around this.

But yeah, I'm sure there's a great benefit to using an outdated vendored C library that NIHs git.

https://github.com/rust-lang/cargo/issues/11857

#Gentoo #NIH

git error `invalid data in index` with index.skipHash config · Issue #11857 · rust-lang/cargo

Problem before 1.68, this worked: # be in a git repository $ git init . # create a junk commit (required; any history) $ touch x && git add x && git commit -m x $ mkdir -p a/b && cd a/b # grab a ru...

GitHub

@mgorny Note that libgit2's versions and git's versions are independent. libgit2 doesn't support everything that git does.

Cargo 1.77.0 (branched from master in January) shipped with git2 1.7.1 (released August 14, 2023)

Cargo master uses git2 1.7.2 (released February 6, 2024)

A git2 1.8 is out which supports skipHash. It was released on March 20.

@mgorny

> But yeah, I'm sure there's a great benefit to using an outdated vendored C library that NIHs git.

The git binary is not a great interface to work with and it means we require git to be installed.

As for vendoring, on my personal projects I've gotten bug reports in from dealing with system libgit2 (if its even installed) being an incompatible version. Dealing with every system is not worth it.

@epage @mgorny cgit vendors Git sources, and so doesn't need neither libgit2 nor git binary