From mboxrd@z Thu Jan 1 00:00:00 1970 From: ludo@gnu.org (Ludovic =?utf-8?Q?Court=C3=A8s?=) Subject: Re: Neon and reverse address lookup Date: Sat, 18 Jan 2014 21:09:13 +0100 Message-ID: <87mwitqcgm.fsf@gnu.org> References: <20140118124847.GA6166@debian> <87zjmtpd2t.fsf@netris.org> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:33497) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1W4cHt-0007sI-3l for guix-devel@gnu.org; Sat, 18 Jan 2014 15:14:46 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1W4cHc-0003bj-D2 for guix-devel@gnu.org; Sat, 18 Jan 2014 15:14:37 -0500 Received: from hera.aquilenet.fr ([141.255.128.1]:59774) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1W4cHc-0003bQ-3n for guix-devel@gnu.org; Sat, 18 Jan 2014 15:14:20 -0500 In-Reply-To: <87zjmtpd2t.fsf@netris.org> (Mark H. Weaver's message of "Sat, 18 Jan 2014 09:41:14 -0500") List-Id: "Development of GNU Guix and the GNU System distribution." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guix-devel-bounces+gcggd-guix-devel=m.gmane.org@gnu.org Sender: guix-devel-bounces+gcggd-guix-devel=m.gmane.org@gnu.org To: Mark H Weaver Cc: guix-devel@gnu.org Mark H Weaver skribis: > Andreas Enge writes: > >> when trying to package the neon library: >> http://www.webdav.org/neon/ , >> the tests fail inside the chroot with >> addr_reverse (reverse lookup for 127.0.0.1 failed) >> >> Should I disable the corresponding test? > > I think we should include /etc/hosts in the chroot with an entry for > localhost. We might also need /etc/nsswitch.conf; I'm not sure. I see > no reason not to do this, and I suspect it would ultimately take less > time and effort than disabling tests. Actually, I just discovered that it=E2=80=99s been the case since before Gu= ix was even started. :-) nix/libstore/build.cc reads this: /* Create /etc/hosts with localhost entry. */ writeFile(chrootRootDir + "/etc/hosts", "127.0.0.1 localhost\n"); So lookups of =E2=80=98localhost=E2=80=99 should just work. To make sure this is the case, try this: --8<---------------cut here---------------start------------->8--- #!/path/to/bin/guile -s !# (use-modules (guix) (guix monads)) (define (with-/etc/hosts?) (define b '(and (file-exists? "/etc/hosts") (getaddrinfo "localhost") (call-with-output-file (assoc-ref %outputs "out") (const #t)))) (mlet* %store-monad ((d (derivation-expression "etc-hosts" b))) (built-derivations (list d)))) (let* ((s (open-connection))) (run-with-store s (with-/etc/hosts?))) --8<---------------cut here---------------end--------------->8--- I don=E2=80=99t think nsswitch.conf will be necessary. Thanks, Ludo=E2=80=99.