Hi. I’m experimenting with nix on an arch linux installation. (Nix version 2.5.1.) If I try to use build-use-substitutes = false
in order to build all packages from source then I’m unable to build almost any package, with errors usually starting at either autoconf or c-ares. For example
> nix shell nixpkgs#autoconf
error: builder for '/nix/store/grfkz6z6fa9k4dg2gg7jxzn97307q4yv-autoconf-2.71.drv' failed with exit code 126;
last 10 log lines:
> unpacking sources
> unpacking source archive /nix/store/g3pzpdicszf700d5xffyk939jzxa4r2k-autoconf-2.71.tar.xz
> source root is autoconf-2.71
> setting SOURCE_DATE_EPOCH to timestamp 1611869099 of file autoconf-2.71/.tarball-version
> patching sources
> applying patch /nix/store/4hcdpxjmr4nh625ry840g70xp00vdf5a-2.71-fix-race.patch
> patching file lib/Autom4te/FileUtils.pm
> configuring
> configure flags: --prefix=/nix/store/khilbv2w0ixj55clcpsjzpaq0l1bhh2j-autoconf-2.71
> /nix/store/lwcfw5vyjlzrs35k1hanv21j1q2s5c5w-stdenv-linux/setup: ./configure: /bin/sh: bad interpreter: No such file or directory
For full logs, run 'nix log /nix/store/grfkz6z6fa9k4dg2gg7jxzn97307q4yv-autoconf-2.71.drv'.
I found 'Re: [Nix-dev] texinfo4 seems to have a /bin/sh dependency' - MARC
It seems there are some packages that are impure and require a specific environment setup to build (build-chroot-dirs
/sandbox-paths
), and that nixos will perform this setup automatically but non-nixos won’t. Is this understanding correct? Is it expected that some packages won’t build on non-nixos?
I tried setting the following config option to no success
sandbox-paths = /bin/sh:/nix/store/iqprjr5k5385bhf1dzj07zwd5p43py1n-bash-5.1-p12/bin/bash /nix/store/iqprjr5k5385bhf1dzj07zwd5p43py1n-bash-5.1-p12 /nix/store/lx7kf7spirg48miqhaj1in8ik75dr6ls-linux-headers-5.15.5 /nix/store/wl60dr9p15rwf53gxz61ijgisc1zdjc7-glibc-2.33-59
I tried strace but that didn’t show anything useful. Presumably because the actual building is initiated by the daemon on a worker?
I tried using nix develop -i nixpkgs#autoconf
to debug the issue, in that environment I can successfully run unpackPhase
and configurePhase
. So the issue affects only nix build
not nix develop
.
I found Why is there no way to run `nix-shell` in a chroot and without the user's .bashrc? · Issue #903 · NixOS/nix · GitHub - seems to be not possible to get an environment identical to the one nix build
uses. What would be the recommended way of debugging this issue?
Only other nix.conf settings I have are
build-users-group = nixbld
experimental-features = nix-command flakes