[Nix-dev] Chroot builds and NSS modules

Ludovic Courtès ludo at gnu.org
Tue Apr 8 17:12:07 CEST 2008


Hi,

Eelco Dolstra <e.dolstra at tudelft.nl> writes:

> Author: eelco
> Date: 2008-04-08 12:28:03 +0000 (Tue, 08 Apr 2008)
> New Revision: 11487
>
> You can view the changes in this commit at:
>    https://svn.cs.uu.nl:12443/viewvc/trace?rev=11487&view=rev
>
> Added:
>    nixpkgs/branches/stdenv-updates/pkgs/development/libraries/glibc-2.7/nss-skip-unavail.patch
> Modified:
>    nixpkgs/branches/stdenv-updates/pkgs/development/libraries/glibc-2.7/default.nix
>
> Log:
> * Ignore services in nsswitch.conf that cannot be found (like
>   "mdns4_mininal" on Ubuntu).  This is a fix for NIXPKGS-79.  It
>   doesn't *quite* fix the problem in all cases (there might be people
>   actually using mDNS; they should just run the "nscd" daemon) but at
>   least it should keep curl from failing in Nixpkgs downloads.

(I'm assuming this change relates to
http://thread.gmane.org/gmane.linux.distributions.nixos/384 ).

That seems very hackish.

I think the problem (DNS lookup failures in the chroot) stems from the
fact that the chroot sees a `resolv.conf' that specifies NSS modules
that aren't mapped in the chroot.  I can think of two solutions:

  1. The best solution IMO would be to selectively bind-mount all NSS
     modules into the chroot and somehow make sure that they are in the
     lib search path of `curl' and other applications.

  2. A simpler solution would be to provide the chroot with a
     `resolv.conf' that does not refer to any external NSS module.

Now, I fail to see where the chroot gets its `/etc/resolv.conf' from.
`DerivationGoal::startBuilder ()' in `libstore/build.cc' lists only
`/dev', `/proc', and `/nix/store' as the paths that are mounted by
default in the chroot.  So where's `/etc'?  Or is the above explanation
incorrect?

Thanks,
Ludovic.



More information about the nix-dev mailing list