BUG?: builtins.fetchGit ends in an endless loop when used against an archived GitHub repository

Hello.

We have GitHub - base48/old-wiki: Dump of old wiki pages repository which is public archive.
When builtins.fetchGit has been used against this repository, it ends in endless loop.

Easy reproducer:

strace -f -t nix eval --impure --expr '
  builtins.fetchGit {
    url = "https://github.com/base48/old-wiki.git";
  }
'

And it ends in endless loop on:

[pid 807896] 18:46:53 newfstatat(AT_FDCWD, "/home/user/.cache/nix/gitv3/0xcnqpnmcir8kishjyj3iv09lp1sa09h7l90pk0al5rq4gdxb08w/info/attributes", 0x7ffc90b28060, 0) = -1 ENOENT (No such file or directory)
[pid 807896] 18:46:53 access("/etc/gitattributes", F_OK) = -1 ENOENT (No such file or directory)
[pid 807896] 18:46:53 newfstatat(AT_FDCWD, "/home/user/.cache/nix/gitv3/0xcnqpnmcir8kishjyj3iv09lp1sa09h7l90pk0al5rq4gdxb08w/info/attributes", 0x7ffc90b28060, 0) = -1 ENOENT (No such file or directory)
... etc ...

Do I’m doing something wrong?
It looks like nasty bug to me.

Hangs up here as well. GIven that git clone(and git2 clone) seems to work just fine I’d say it’s a nix bug.

1 Like

I tried it and, while it did take almost 50 minutes, the command did eventually complete with a correctly-populated store path and no errors.

fetchFromGitHub from Nixpkgs is much faster, as it uses the tarball endpoint under the hood; maybe use that instead?

2 Likes

Hello. Thank you for your patience.
So it’s not endless loop but it’s just slow.

I replaced it with:

oldWikiWebDir = pkgs.fetchFromGitHub {
    owner = "base48";
    repo = "old-wiki";
    rev = "master";
    sha256 = "sha256-FVwF6aicighnX3XXl/YI7fzKQ9U9l3meQKDZ7XgCifY=";
  };

and it’s much faster (maybe because it download tar.gz archive).

It’s not endless loop, but it’s very slow.
I’m going to fill a bug :).

1 Like