On Sat, Jul 11, 2020 at 11:14:23PM +0300, Niko Tyni wrote: > Package: libio-socket-ip-perl > Version: 0.39-2 > Severity: serious > Tags: patch ipv6 > > This is a follow-up for #962047 "fails to build on IPv6-only buildds". > > The background here is that a while ago new official build daemons were > added that only have IPv6 connectivity, and this exposed a new class > of build failures, mainly due to getaddrinfo(3) behaviour with the > AI_ADDRCONFIG flag. > > Quoting Julien Cristau there: > > > FWIW, it seems IO::Socket::IP passes AI_ADDRCONFIG to getaddrinfo, which > > then doesn't return ipv4 addresses because the host doesn't have > > non-local ones, even though the address we're trying to resolve is > > "127.0.0.1". > > > > Passing either GetAddrInfoFlags => AI_NUMERICHOST or GetAddrInfoFlags => > > 0 to both IO::Socket::IP->new calls in the test file lets it pass, by > > turning off the smarts in getaddrinfo. > > We fixed the test suite of libio-socket-ip-perl itself in 0.39-2 by > making it pass AI_NUMERICHOST in all the tests. However, it turns out > that the problem is much more widespread than this. > > I've been testing systematically for these issues by test rebuilding > the whole archive, and found > > 1) 138 packages that failed to build on a host with an IPv6 address > on a "real" interface, and IPv4 + IPv6 on lo, but no internet > connection > > 2) 8 of those 138 also failed to build on a host with both an IPv6 address > and an IPv4 address on a "real interface", still without a real internet > connection (these are regular "needs internet" bugs, not IPv6 specific) > > 3) only 42 of the remaining 130 packages fail to build with the same setup > as 1), after applying the patch discussed below to IO::Socket::IP. > > So it looks like the AI_ADDRCONFIG default of IO-Socket-IP is causing > 88 potential build failures on the new IPv6-only buildds. Examples of > those can be seen on for instance > > https://buildd.debian.org/status/logs.php?pkg=libmojolicious-perl > > https://buildd.debian.org/status/logs.php?pkg=libtest-redisserver-perl > > https://buildd.debian.org/status/logs.php?pkg=libwww-mechanize-perl > > The attached patch changes IO-Socket-IP to pass AI_NUMERICHOST to > getaddrinfo(3) when the address looks like an IPv4 numeric address (rather > than a hostname), and special cases a PeerHost value of "localhost" > not to use AI_ADDRCONFIG. > > I have tried quite a few variants, and this was the best I could do > without removing AI_ADDRCONFIG (which is a documented feature) altogether. > (TODO: The patch does not currently update the documentation about the > new behaviour.) > > It would be good to get something like this upstream of course, and it > will also need to go in src:perl which has a copy of IO::Socket::IP. > > I've tested that this makes libio-socket-perl pass its own test suite > without the modifications in 0.39-2, so this supersedes the current test > suite patch. > > Build logs can currently (but not guaranteed indefinitely) be found at > > http://perl.debian.net/rebuild-logs/sid-v6only/ > > http://perl.debian.net/rebuild-logs/experimental-v6only/ > > where the latter had a patched libio-socket-ip-perl package pre-installed > in the chroot.
[snip list of affected packages] As a heads up, there was some discussion on debian-devel about how this is something which should be fixed in libc. This is the bug about the issue from this perspective: https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=952740 There doesn't seem any prospect of this being fixed in the near future, so I'm planning to apply Niko's patch to libio-socket-ip-perl (and perl, probably starting with experimental) to solve the immediate issues of failing tests. Dominic.