Open PAI5REECHO opened 10 months ago
I don't see a suitable function in the libgit2 documentation.
Closest thing is git_url_resolve_cb
, but that seems to just rewrite the URL, and putting an IP address there would affect TLS and the Host
header adversely.
So we can't seem to affect DNS resolution through the libgit2 interfaces.
In the code I find
socket_connect
, which seems to be where they start to resolve the name, and p_getaddrinfo
might be the normal getaddrinfo
or not, depending on NO_ADDRINFO
, but I don't think you're running Nix on an Amiga...
So getaddrinfo
is involved. It doesn't seem that the hints
are wrong, as no specific address family is required by socket_connect
.
I assume this is on NixOS? I'm not sure of the intricacies of how glibc is configured to do mDNS. Maybe ask in a NixOS channel?
A good summary of nsswitch support is here: https://flokli.de/posts/2022-11-18-nsncd/
Basically, loading an arbitrary .so is problematic when there is no expectation of using the same glibc system-wide.
Describe the bug
I can't use
nix
with my local git serverSteps To Reproduce
Expected behavior
I should be able to fetch from my local git server using
nix
just I can withgit
nix-env --version
outputAdditional context It fails here: https://github.com/libgit2/libgit2/blob/45fd9ed7ae1a9b74b957ef4f337bc3c8b3df01b5/src/libgit2/remote.c#L1254 Maybe
libgit2
isn't configured properly?Priorities
Add :+1: to issues you find important.