{"action":"created","issue":{"url":"https://api.github.com/repos/NixOS/nix/issues/512","repository_url":"https://api.github.com/repos/NixOS/nix","labels_url":"https://api.github.com/repos/NixOS/nix/issues/512/labels{/name}","comments_url":"https://api.github.com/repos/NixOS/nix/issues/512/comments","events_url":"https://api.github.com/repos/NixOS/nix/issues/512/events","html_url":"https://github.com/NixOS/nix/issues/512","id":68209025,"number":512,"title":"Installing nix to a custom directory (as per wiki) fails","user":{"login":"vrthra","id":70410,"avatar_url":"https://avatars.githubusercontent.com/u/70410?v=3","gravatar_id":"","url":"https://api.github.com/users/vrthra","html_url":"https://github.com/vrthra","followers_url":"https://api.github.com/users/vrthra/followers","following_url":"https://api.github.com/users/vrthra/following{/other_user}","gists_url":"https://api.github.com/users/vrthra/gists{/gist_id}","starred_url":"https://api.github.com/users/vrthra/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/vrthra/subscriptions","organizations_url":"https://api.github.com/users/vrthra/orgs","repos_url":"https://api.github.com/users/vrthra/repos","events_url":"https://api.github.com/users/vrthra/events{/privacy}","received_events_url":"https://api.github.com/users/vrthra/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":18,"created_at":"2015-04-13T22:34:20Z","updated_at":"2016-05-31T17:29:34Z","closed_at":null,"body":"I have been trying to follow the [Nix wiki](https://nixos.org/wiki/How_to_install_nix_in_home_%28on_another_distribution%29) to install Nix on a custom path `/scratch/gopinath/nix`. The `/nix` path is not accessible to me due to the restrictions on the system provided by my university. The *PRoot* option does not fit my requirements. I also do not have root access. So here are the steps I have tried.\r\n\r\nEnvironment:\r\n\r\n    | uname -a\r\n    Linux hati.eecs.oregonstate.edu 2.6.32-431.3.1.el6.x86_64 #1 SMP Fri Dec 13 06:58:20 EST 2013 x86_64 x86_64 x86_64 GNU/Linux\r\n    | cat /etc/redhat-release\r\n    Red Hat Enterprise Linux Workstation release 6.5 (Santiago)\r\n    | gcc --version\r\n    gcc (GCC) 4.4.7 20120313 (Red Hat 4.4.7-4)\r\n\r\n\r\n# My efforts\r\n\r\nThis is what I have tried so far; I used the below script `install.sh` on the extracted folder `/scratch/gopinath/usr/nix-boot`\r\n\r\n\r\n    #!/bin/bash\r\n    set -e\r\n    export nix_boot=${NIX_BOOT-/scratch/gopinath/usr/nix-boot}\r\n    export nix_root=${NIX_ROOT-/scratch/gopinath/nix}\r\n    export RUN_EXPENSIVE_TESTS=no\r\n    export PATH=$nix_boot/bin:/scratch/gopinath/usr/bin:$PATH\r\n    export PKG_CONFIG_PATH=$nix_boot/lib/pkgconfig:$PKG_CONFIG_PATH\r\n    export LDFLAGS=\"-L$nix_boot/lib -L$nix_boot/lib64 $LDFLAGS\"\r\n    export LD_LIBRARY_PATH=\"$nix_boot/lib:$nix_boot/lib64:$LD_LIBRARY_PATH\"\r\n    export CPPFLAGS=\"-I$nix_boot/include $CPPFLAGS\"\r\n    #export PERL5OPT=\"-I$nix_boot/lib/perl\"\r\n    export PERL5OPT=\"-I$nix_boot/lib64/perl5\"\r\n    export NIXPKGS=/scratch/gopinath/nixpkgs\r\n    all=\"bzip2 curl sqlite dbi dbd wwwcurl bootstrap nix\"\r\n    case $1 in\r\n      -h) echo $all nix1.8; exit 0;;\r\n      -sh) $2; exit 0;;\r\n    bzip2)\r\n    (cd bzip2-1.0.6;\r\n      make -f Makefile-libbz2_so;\r\n      make install PREFIX=$nix_boot;\r\n      cp libbz2.so.1.0 libbz2.so.1.0.6 $nix_boot/lib; ) ;;\r\n    \r\n    curl)\r\n    (cd curl-7.35.0/;\r\n      ./configure --prefix=$nix_boot;\r\n      make;\r\n      make install; ) ;;\r\n    \r\n    sqlite)\r\n    (cd sqlite-autoconf-3080300/;\r\n      ./configure --prefix=$nix_boot;\r\n      make;\r\n      make install; ) ;;\r\n    \r\n    libxml2)\r\n      (cd libxml2-2.9.2; ./configure --prefix=$nix_boot;\r\n      make;\r\n      cp ./libxml2-2.9.2/xmllint $nix_boot/bin\r\n      # make install;\r\n      ) ;;\r\n    \r\n    libxslt)\r\n      (cd libxslt-1.1.28;  ./configure --prefix=$nix_boot;\r\n      make;\r\n      make install; ) ;;\r\n    \r\n    gcc)\r\n      (cd gcc-4.9.2; ./contrib/download_prerequisites; )\r\n      rm -rf gcc-objs;\r\n      mkdir -p gcc-objs\r\n      (cd gcc-objs; ./../gcc-4.9.2/configure --prefix=$nix_boot;\r\n      make;\r\n      make install; ) ;;\r\n    \r\n    bison)\r\n      (cd bison-3.0; ./configure --prefix=$nix_boot;\r\n      make;\r\n      make install; ) ;;\r\n    \r\n    flex)\r\n      (cd flex-2.5.39;  ./configure --prefix=$nix_boot;\r\n      make;\r\n      make install; );;\r\n    \r\n    coreutils)\r\n      (cd coreutils-8.23;  ./configure --enable-install-program=hostname --prefix=$nix_boot;\r\n      make;\r\n      make install; );;\r\n    \r\n    bash)\r\n      (cd bash-4.3;  ./configure --prefix=$nix_boot;\r\n      make;\r\n      make install; );;\r\n    \r\n    dbi)\r\n    (cd DBI-1.631/;\r\n      perl Makefile.PL PREFIX=$nix_boot PERLMAINCC=$nix_boot/bin/gcc;\r\n      make;\r\n      make install; ) ;;\r\n    \r\n    dbd)\r\n    (cd DBD-SQLite-1.40/;\r\n      perl Makefile.PL PREFIX=$nix_boot PERLMAINCC=$nix_boot/bin/gcc;\r\n      make;\r\n      make install; ) ;;\r\n    \r\n    wwwcurl)\r\n    (cd WWW-Curl-4.15;\r\n      perl Makefile.PL PREFIX=$nix_boot PERLMAINCC=$nix_boot/bin/gcc;\r\n      make;\r\n      make install; ) ;;\r\n    \r\n    bootstrap)\r\n    rm -rf nix\r\n    git clone https://github.com/NixOS/nix nix\r\n    (cd nix;\r\n      ./bootstrap.sh ) ;;\r\n    \r\n    nix)\r\n    (cd nix;\r\n      echo \"./configure --prefix=$nix_boot --with-store-dir=$nix_root/store --localstatedir=$nix_root/var\" > myconfig.sh;\r\n      ./configure --prefix=$nix_boot --with-store-dir=$nix_root/store --localstatedir=$nix_root/var --with-coreutils-bin=/scratch/gopinath/usr/bin --enable-static  --enable-static-nix ;\r\n      /usr/bin/perl -pi -e 's#--nonet# #g' doc/manual/local.mk;\r\n      echo \"GLOBAL_LDFLAGS += -lpthread\" >> doc/manual/local.mk;\r\n      make;\r\n      make install; ) ;;\r\n    \r\n    nixconfig)\r\n      nix-channel --add http://nixos.org/channels/nixpkgs-unstable && \\\r\n      nix-channel --update && \\\r\n      nix-env -iA nix -f $NIXPKGS ;\r\n     ;;\r\n    \r\n    all) for i in $all;\r\n         do env nix_boot=$nix_boot nix_root=$nix_root ./$0 $i ;\r\n         done ;;\r\n    \r\n    *) echo $all;\r\n       echo nix_root=$nix_root\r\n       echo nix_boot=$nix_boot;;\r\n    esac\r\n\r\nEvery thing works fine until I hit the `nix`. On both `nix 1.8` and on `nix` from the repository, I get\r\n\r\n    bash-4.1$ make\r\n    Makefile:28: Makefile.config: No such file or directory\r\n      GEN    Makefile.config\r\n      GEN    doc/manual/manual.is-valid\r\n    -:1: parser error : Document is empty\r\n    \r\n    ^\r\n    -:1: parser error : Start tag expected, '<' not found\r\n    \r\n    ^\r\n    make: *** [doc/manual/manual.is-valid] Error 1\r\n\r\nIf I do `make clean` and then `make` I get\r\n\r\n    bash-4.1$ make\r\n    Makefile:28: Makefile.config: No such file or directory\r\n      GEN    Makefile.config\r\n      GEN    doc/manual/version.txt\r\n      GEN    doc/manual/manual.xmli\r\n    doc/manual/command-ref/nix-env.xml:203: element include: XInclude error : failed build URL\r\n    doc/manual/command-ref/nix-env.xml:1368: element include: XInclude error : failed build URL\r\n    doc/manual/command-ref/nix-build.xml:129: element include: XInclude error : failed build URL\r\n    doc/manual/command-ref/nix-build.xml:184: element include: XInclude error : failed build URL\r\n    doc/manual/command-ref/nix-shell.xml:143: element include: XInclude error : failed build URL\r\n    doc/manual/command-ref/nix-shell.xml:195: element include: XInclude error : failed build URL\r\n    doc/manual/command-ref/nix-store.xml:119: element include: XInclude error : failed build URL\r\n    doc/manual/command-ref/nix-store.xml:1346: element include: XInclude error : failed build URL\r\n    doc/manual/command-ref/nix-instantiate.xml:166: element include: XInclude error : failed build URL\r\n    doc/manual/command-ref/nix-instantiate.xml:258: element include: XInclude error : failed build URL\r\n      GEN    doc/manual/manual.is-valid\r\n    -:1: parser error : Document is empty\r\n    \r\n    ^\r\n    -:1: parser error : Start tag expected, '<' not found\r\n    \r\n    ^\r\n    make: *** [doc/manual/manual.is-valid] Error 1\r\n\r\nOn debug, it seems that `xsltproc` is called with `--nonet` flag as in\r\n\r\n    file: doc/manual/local.mk \r\n    \r\n    $(d)/manual.is-valid: $(d)/manual.xmli\r\n    /scratch/gopinath/usr/nix-boot/bin/xsltproc --nonet \\\r\n      --param section.autolabel 1 \\\r\n      --param section.label.includes.component.label 1 \\\r\n      --param html.stylesheet \\'style.css\\' \\\r\n      --param xref.with.number.and.title 1 \\\r\n      --param toc.section.depth 3 \\\r\n      --param admon.style \\'\\' \\\r\n      --param callout.graphics.extension \\'.gif\\' \\\r\n      --param contrib.inline.enabled 0 \\\r\n      --stringparam generate.toc \"book toc\" \\\r\n      --param keep.relative.image.uris 0 \\\r\n      --novalid \\\r\n      --stringparam profile.condition manual \\\r\n               http://docbook.sourceforge.net/release/xsl-ns/1.78.1/profiling/profile.xsl \\\r\n               doc/manual/manual.xmli \\\r\n      | /scratch/gopinath/usr/nix-boot/bin/xmllint --nonet --noout --relaxng http://docbook.org/xml/5.0/rng/docbook.rng -\r\n\r\nIt seems `nonet` flag is messing with me here somehow, even when using the latest `xmllint` and `xsltproc` (mentioned in the install script above).\r\n\r\n    bash-4.1$ which xsltproc\r\n    /scratch/gopinath/usr/nix-boot/bin/xsltproc\r\n    bash-4.1$ /scratch/gopinath/usr/nix-boot/bin/xsltproc --version\r\n    Using libxml 20902, libxslt 10128 and libexslt 817\r\n    xsltproc was compiled against libxml 20902, libxslt 10128 and libexslt 817\r\n    libxslt 10128 was compiled against libxml 20902\r\n    libexslt 817 was compiled against libxml 20902\r\n    bash-4.1$ which xmllint\r\n    /scratch/gopinath/usr/nix-boot/bin/xmllint\r\n    bash-4.1$ /scratch/gopinath/usr/nix-boot/bin/xmllint --version\r\n    /scratch/gopinath/usr/nix-boot/bin/xmllint: using libxml version 20902\r\n       compiled with: Threads Tree Output Push Reader Patterns Writer SAXv1 FTP HTTP DTDValid HTML Legacy C14N Catalog XPath XPointer XInclude Iconv ISO8859X Unicode Regexps Automata Expr Schemas Schematron Modules Debug Zlib Lzma \r\n\r\nSo I did `perl -pi -e 's#--nonet# #g'` on `doc/manual/local.mk` as I mention in the above script.\r\n\r\nIt now seems that the C11 support in GCC 4.4.7 (default) is insufficient. So I am updated my GCC to 4.9.2 and installed it to the same location (updated in the above script). Now my error on building `nix` is\r\n\r\n    $ make\r\n    ...\r\n    configure: creating ./config.status\r\n    config.status: creating config.h\r\n    config.status: config.h is unchanged\r\n      GEN    Makefile.config\r\n      CXX    src/nix-hash/nix-hash.o\r\n      CXX    src/libmain/shared.o\r\n      CXX    src/libmain/stack.o\r\n      CXX    src/libstore/build.o\r\n      CXX    src/libstore/derivations.o\r\n      CXX    src/libstore/gc.o\r\n      CXX    src/libstore/globals.o\r\n      GEN    src/libstore/schema.sql.hh\r\n      CXX    src/libstore/local-store.o\r\n      CXX    src/libstore/misc.o\r\n      CXX    src/libstore/optimise-store.o\r\n      CXX    src/libstore/pathlocks.o\r\n      CXX    src/libstore/references.o\r\n      CXX    src/libstore/remote-store.o\r\n      CXX    src/libstore/store-api.o\r\n      CXX    src/libutil/affinity.o\r\n      CXX    src/libutil/archive.o\r\n      CXX    src/libutil/hash.o\r\n      CXX    src/libutil/regex.o\r\n      CXX    src/libutil/serialise.o\r\n      CXX    src/libutil/util.o\r\n      CXX    src/libutil/xml-writer.o\r\n      CXX    src/boost/format/format_implementation.o\r\n      CXX    src/boost/format/free_funcs.o\r\n      CXX    src/boost/format/parsing.o\r\n      LD     src/boost/format/libnixformat.so\r\n      LD     src/libutil/libnixutil.so\r\n      LD     src/libstore/libnixstore.so\r\n      LD     src/libmain/libnixmain.so\r\n      LD     src/nix-hash/nix-hash\r\n    /usr/bin/ld: src/nix-hash/nix-hash: undefined reference to symbol '__pthread_key_create@@GLIBC_2.2.5'\r\n    /usr/bin/ld: note: '__pthread_key_create@@GLIBC_2.2.5' is defined in DSO /lib64/libpthread.so.0 so try adding it to the linker command line\r\n    /lib64/libpthread.so.0: could not read symbols: Invalid operation\r\n    collect2: error: ld returned 1 exit status\r\n    make: *** [src/nix-hash/nix-hash] Error 1\r\n    zsh: exit 1     ./install.sh nix\r\n\r\nI worked around this error by modifying `doc/manual/local.mk` by adding a line `GLOBAL_LDFLAGS += -lpthread`. Now the error is\r\n\r\n      CXX    src/libexpr/parser-tab.o\r\n    In file included from src/libexpr/parser-tab.cc:255:0:\r\n    src/libexpr/parser-tab.hh:124:15: error: redefinition of ‘union YYSTYPE’\r\n     typedef union YYSTYPE\r\n                   ^\r\n    In file included from src/libexpr/parser.y:53:0:\r\n    src/libexpr/parser-tab.hh:124:15: error: previous definition of ‘union YYSTYPE’\r\n     typedef union YYSTYPE\r\n                   ^\r\n    In file included from src/libexpr/parser-tab.cc:255:0:\r\n    src/libexpr/parser-tab.hh:147:10: error: invalid type in declaration before ‘;’ token\r\n     } YYSTYPE;\r\n              ^\r\n    src/libexpr/parser-tab.hh:147:10: error: conflicting declaration ‘typedef int YYSTYPE’\r\n    In file included from src/libexpr/parser.y:53:0:\r\n    src/libexpr/parser-tab.hh:147:3: note: previous declaration as ‘typedef union YYSTYPE YYSTYPE’\r\n     } YYSTYPE;\r\n       ^\r\n    make: *** [src/libexpr/parser-tab.o] Error 1\r\n\r\nAnd apparently this was because my bison was old\r\n\r\n    | yacc -V       \r\n    yacc - 1.9 20070509\r\n    | bison -V\r\n    bison (GNU Bison) 2.4.1\r\n\r\nI updated this to bison 3.0 (in the script above), and the errors went away, but `flex` needs to be updated\r\n\r\n      GEN    Makefile.config\r\n      CXX    src/libexpr/parser-tab.o\r\n    In file included from src/libexpr/parser-tab.cc:255:0:\r\n    src/libexpr/parser-tab.hh:124:15: error: redefinition of ‘union YYSTYPE’\r\n     typedef union YYSTYPE\r\n                   ^\r\n    In file included from src/libexpr/parser.y:53:0:\r\n    src/libexpr/parser-tab.hh:124:15: error: previous definition of ‘union YYSTYPE’\r\n     typedef union YYSTYPE\r\n                   ^\r\n    In file included from src/libexpr/parser-tab.cc:255:0:\r\n    src/libexpr/parser-tab.hh:147:10: error: invalid type in declaration before ‘;’ token\r\n     } YYSTYPE;\r\n              ^\r\n    src/libexpr/parser-tab.hh:147:10: error: conflicting declaration ‘typedef int YYSTYPE’\r\n    In file included from src/libexpr/parser.y:53:0:\r\n    src/libexpr/parser-tab.hh:147:3: note: previous declaration as ‘typedef union YYSTYPE YYSTYPE’\r\n     } YYSTYPE;\r\n       ^\r\nAnd updating to `flex 2.5.39` seems to remove the remaining errors. Now, on adding the channel\r\n\r\n\r\n    bash-4.1$ nix-channel --add http://nixos.org/channels/nixpkgs-unstable\r\n    Can't load '/scratch/gopinath/usr/nix-boot/lib/perl5/site_perl/5.10.1/x86_64-linux-thread-multi/auto/Nix/Store/Store.so' for module Nix::Store: /usr/lib64/libstdc++.so.6: version `GLIBCXX_3.4.15' not found (required by /scratch/gopinath/usr/nix-boot/lib/perl5/site_perl/5.10.1/x86_64-linux-thread-multi/auto/Nix/Store/Store.so) at /usr/lib64/perl5/XSLoader.pm line 70.\r\n     at /scratch/gopinath/usr/nix-boot/lib/perl5/site_perl/5.10.1/x86_64-linux-thread-multi/Nix/Store.pm line 38\r\n    Compilation failed in require at /scratch/gopinath/usr/nix-boot/lib/perl5/site_perl/5.10.1/x86_64-linux-thread-multi/Nix/Manifest.pm line 13.\r\n    BEGIN failed--compilation aborted at /scratch/gopinath/usr/nix-boot/lib/perl5/site_perl/5.10.1/x86_64-linux-thread-multi/Nix/Manifest.pm line 13.\r\n    Compilation failed in require at /scratch/gopinath/usr/nix-boot/bin/nix-channel line 8.\r\n    BEGIN failed--compilation aborted at /scratch/gopinath/usr/nix-boot/bin/nix-channel line 8.\r\n\r\nThis was resolved by setting LD_LIBRARY_PATH to look in `$nix_boot/lib64`\r\nAfter that, the guide asks me to install nix with\r\n\r\n    bash-4.1$ cat ~/.nixpkgs/config.nix \r\n    pkgs:\r\n    {\r\n      packageOverrides = self: {\r\n        nix = self.nix.override {\r\n          storeDir = \"/scratch/gopinath/nix/store\";\r\n          stateDir = \"/scratch/gopinath/nix/var\";\r\n        };\r\n      };\r\n    }\r\n    \r\n    bash-4.1$ nix-env -iA nix\r\n    error: attribute ‘nix’ in selection path ‘nix’ not found\r\n\r\nIt seems that [here](https://www.mail-archive.com/nix-dev@lists.science.uu.nl/msg08939.html) is a solution. So,\r\n\r\n    $ nix-env -iA nix -f ~/.nix-defexpr/channels/nixpkgs\r\n    ...\r\n    building tests/test-suite.log\r\n    make[5]: Entering directory `/tmp/nix-build-coreutils-8.23.drv-0/coreutils-8.23'\r\n    building all\r\n    make  all-recursive\r\n    make[6]: Entering directory `/tmp/nix-build-coreutils-8.23.drv-0/coreutils-8.23'\r\n    building all-recursive\r\n    Making all in po\r\n    make[7]: Entering directory `/tmp/nix-build-coreutils-8.23.drv-0/coreutils-8.23/po'\r\n    building check-macro-version\r\n    make[7]: Leaving directory `/tmp/nix-build-coreutils-8.23.drv-0/coreutils-8.23/po'\r\n    Making all in .\r\n    make[7]: Entering directory `/tmp/nix-build-coreutils-8.23.drv-0/coreutils-8.23'\r\n    make[7]: Nothing to be done for `all-am'.\r\n    make[7]: Leaving directory `/tmp/nix-build-coreutils-8.23.drv-0/coreutils-8.23'\r\n    Making all in gnulib-tests\r\n    make[7]: Entering directory `/tmp/nix-build-coreutils-8.23.drv-0/coreutils-8.23/gnulib-tests'\r\n    building all\r\n    make  all-recursive\r\n    make[8]: Entering directory `/tmp/nix-build-coreutils-8.23.drv-0/coreutils-8.23/gnulib-tests'\r\n    building all-recursive\r\n    Making all in .\r\n    make[9]: Entering directory `/tmp/nix-build-coreutils-8.23.drv-0/coreutils-8.23/gnulib-tests'\r\n    make[9]: Nothing to be done for `all-am'.\r\n    make[9]: Leaving directory `/tmp/nix-build-coreutils-8.23.drv-0/coreutils-8.23/gnulib-tests'\r\n    make[8]: Leaving directory `/tmp/nix-build-coreutils-8.23.drv-0/coreutils-8.23/gnulib-tests'\r\n    make[7]: Leaving directory `/tmp/nix-build-coreutils-8.23.drv-0/coreutils-8.23/gnulib-tests'\r\n    make[6]: Leaving directory `/tmp/nix-build-coreutils-8.23.drv-0/coreutils-8.23'\r\n    make[5]: Leaving directory `/tmp/nix-build-coreutils-8.23.drv-0/coreutils-8.23'\r\n    ...\r\n    ============================================================================\r\n    Testsuite summary for GNU coreutils 8.23\r\n    ============================================================================\r\n    # TOTAL: 563\r\n    # PASS:  439\r\n    # SKIP:  120\r\n    # XFAIL: 0\r\n    # FAIL:  3\r\n    # XPASS: 0\r\n    # ERROR: 1\r\n    ============================================================================\r\n    See ./tests/test-suite.log\r\n    Please report to bug-coreutils@gnu.org\r\n    ============================================================================\r\n    make[4]: *** [tests/test-suite.log] Error 1\r\n    make[4]: Leaving directory `/tmp/nix-build-coreutils-8.23.drv-0/coreutils-8.23'\r\n    make[3]: *** [check-TESTS] Error 2\r\n    make[3]: Leaving directory `/tmp/nix-build-coreutils-8.23.drv-0/coreutils-8.23'\r\n    make[2]: *** [check-am] Error 2\r\n    make[2]: Leaving directory `/tmp/nix-build-coreutils-8.23.drv-0/coreutils-8.23'\r\n    make[1]: *** [check-recursive] Error 1\r\n    make[1]: Leaving directory `/tmp/nix-build-coreutils-8.23.drv-0/coreutils-8.23'\r\n    make: *** [check] Error 2\r\n    builder for ‘/scratch/gopinath/nix/store/1rcj45a27mz06rlw354k1zzwvz0wf24k-coreutils-8.23.drv’ failed\r\n     with exit code 2\r\n    cannot build derivation ‘/scratch/gopinath/nix/store/m2v75p5m7irqh0z2af5idypkil9v630m-stdenv.drv’: 1\r\n     dependencies couldn't be built\r\n    cannot build derivation ‘/scratch/gopinath/nix/store/sp3ic057ydmkv4cnxrbgz016ivy3lac3-nix-1.8.drv’: \r\n    1 dependencies couldn't be built\r\n    error: build of ‘/scratch/gopinath/nix/store/sp3ic057ydmkv4cnxrbgz016ivy3lac3-nix-1.8.drv’ failed\r\n\r\nSo `core-utils` fails. Now what do I do? The error test is\r\n\r\n    ...\r\n    ERROR: tests/chown/separator\r\n    ============================\r\n    \r\n    id: cannot find name for user ID 44172\r\n    separator.sh: set-up failure: \r\n    ...\r\n\r\nAnd fails are\r\n\r\n    FAIL: tests/misc/help-version\r\n    =============================\r\n    \r\n    0+1 records in\r\n    0+1 records out\r\n    whoami: cannot find name for user ID 44172\r\n    FAIL: whoami\r\n    FAIL: tests/id/uid\r\n    ==================\r\n    \r\n    id: cannot find name for user ID 44172\r\n    id: : no such user\r\n    id: 44172: no such user\r\n    id: 44172: no such user\r\n    id: +44172: no such user\r\n    id: 44172: no such user\r\n    id: 44172: no such user\r\n    id: +44172: no such user\r\n    id: 44172: no such user\r\n    id: 44172: no such user\r\n    id: +44172: no such user\r\n    ...\r\n    FAIL: tests/id/zero\r\n    ===================\r\n    \r\n    id: cannot find name for user ID 44172\r\n    uid=44172 gid=16473 groups=16473,5087,5105,10550,12244,13985,14073,20416\r\n    id: 44172: no such user\r\n    id: 44172: no such user\r\n    ....\r\n    id: cannot find name for group ID 16473\r\n    id: cannot find name for group ID 16473\r\n    ....\r\n    --- exp 2015-04-12 04:20:21.655856440 +0000\r\n    +++ out2        2015-04-12 04:20:21.660856355 +0000\r\n    @@ -1,5 +1,17 @@\r\n    @@ -1,5 +1,17 @@\r\n     \r\n    -id -g[z] 44172: id -gn[z] 44172: id -gr[z] 44172: id -grn[z] 44172: id -G[z] 44172: id -Gn[z] 44172\r\n    : id -Gr[z] 44172: id -Grn[z] 44172: id -u[z] 44172: id -un[z] 44172: id -ur[z] 44172: id -urn[z] 44\r\n    172: id -g[z] root: 0\r\n    +id -g[z] 44172: \r\n    +id -gn[z] 44172: \r\n    ...\r\n\r\nSo I installed coreutils-8.23 on the same prefix, and tried again. Unfortunately, the above test errors anyway. It seems that it is always trying to use the system `id` irrespective of the path settings.\r\n\r\nIt seemed that I could hack through by disabling  `doChecks` in the `coreutils-8.23.drv` file. So I cloned the repo https://github.com/nixos/nixpkgs and set `NIXPKGS` enviornment variable pointing to it. Next, I modified the `pkgs/tools/misc/coreutils/default.nix` so that `doCheck = false` always. Next I executed\r\n\r\n    nix-env -iA nix -f $NIXPKGS\r\n    ...\r\n    FAIL: tests/dump-db.sh\r\n    running test tests/case-hack.sh\r\n    + clearStore\r\n    + echo 'clearing store...'\r\n    clearing store...\r\n    + chmod -R +w /tmp/nix-build-nix-1.8.drv-0/nix-1.8/tests/test-tmp/store\r\n    + rm -rf /tmp/nix-build-nix-1.8.drv-0/nix-1.8/tests/test-tmp/store\r\n    + mkdir /tmp/nix-build-nix-1.8.drv-0/nix-1.8/tests/test-tmp/store\r\n    + rm -rf /tmp/nix-build-nix-1.8.drv-0/nix-1.8/tests/test-tmp/db\r\n    + mkdir /tmp/nix-build-nix-1.8.drv-0/nix-1.8/tests/test-tmp/db\r\n    + nix-store --init\r\n    + clearProfiles\r\n    + profiles=/tmp/nix-build-nix-1.8.drv-0/nix-1.8/tests/test-tmp/var/nix/profiles\r\n    + rm -rf /tmp/nix-build-nix-1.8.drv-0/nix-1.8/tests/test-tmp/var/nix/profiles\r\n    + rm -f /tmp/nix-build-nix-1.8.drv-0/nix-1.8/tests/test-tmp/var/nix/gcroots/auto/mqgm5a11kh8r74bbz2gzygddh00lakss\r\n    + rm -f /tmp/nix-build-nix-1.8.drv-0/nix-1.8/tests/test-tmp/var/nix/gcroots/ref\r\n    + rm -rf /tmp/nix-build-nix-1.8.drv-0/nix-1.8/tests/test-tmp/case\r\n    + opts='--option use-case-hack true'\r\n    + nix-store --option use-case-hack true --restore /tmp/nix-build-nix-1.8.drv-0/nix-1.8/tests/test-tmp/case\r\n    + nix-store --option use-case-hack true --dump /tmp/nix-build-nix-1.8.drv-0/nix-1.8/tests/test-tmp/case\r\n    + cmp case.nar /tmp/nix-build-nix-1.8.drv-0/nix-1.8/tests/test-tmp/case.nar\r\n    ++ nix-hash --option use-case-hack true --type sha256 /tmp/nix-build-nix-1.8.drv-0/nix-1.8/tests/test-tmp/case\r\n    ++ nix-hash --flat --type sha256 case.nar\r\n    + '[' ccd0c2353fbb6ff6853088e01f0557e8b9cbc9d11d2e1f8435175dc08091c2a3 = ccd0c2353fbb6ff6853088e01f0557e8b9cbc9d11d2e1f8435175dc08091c2a3 ']'\r\n    + touch /tmp/nix-build-nix-1.8.drv-0/nix-1.8/tests/test-tmp/case/xt_CONNMARK.h~nix~case~hack~3\r\n    + nix-store --option use-case-hack true --dump /tmp/nix-build-nix-1.8.drv-0/nix-1.8/tests/test-tmp/case\r\n    error: file name collision in between ‘/tmp/nix-build-nix-1.8.drv-0/nix-1.8/tests/test-tmp/case/xt_CONNMARK.h’ and ‘/tmp/nix-build-nix-1.8.drv-0/nix-1.8/tests/test-tmp/case/xt_CONNMARK.h~nix~case~hack~3’\r\n    PASS: tests/case-hack.sh\r\n    running test tests/check-reqs.sh\r\n    + RESULT=/tmp/nix-build-nix-1.8.drv-0/nix-1.8/tests/test-tmp/result\r\n    + nix-build -o /tmp/nix-build-nix-1.8.drv-0/nix-1.8/tests/test-tmp/result check-reqs.nix -A test1\r\n    download-from-binary-cache.pl: cannot figure out user name at /scratch/gopinath/nix/store/9313bj65al5bm42q6fiw7y74ayjxli1h-nix-1.8/libexec/nix/substituters/download-from-binary-cache.pl line 48.\r\n    error: substituter ‘download-from-binary-cache.pl’ died unexpectedly\r\n    FAIL: tests/check-reqs.sh\r\n    30 out of 42 tests failed \r\n    mk/tests.mk:11: recipe for target 'installcheck' failed\r\n    make: *** [installcheck] Error 1\r\n    builder for ‘/scratch/gopinath/nix/store/fl8hcbq2cqpadbdrlh2cf5zmafx79r6z-nix-1.8.drv’ failed with exit code 2\r\n    error: build of ‘/scratch/gopinath/nix/store/fl8hcbq2cqpadbdrlh2cf5zmafx79r6z-nix-1.8.drv’ failed\r\n\r\nSo I disabled `doInstallCheck` in `pkgs/tools/package-management/nix/default.nix`. Here are my changes so far\r\n\r\n    diff --git a/pkgs/tools/misc/coreutils/default.nix b/pkgs/tools/misc/coreutils/default.nix\r\n    index 1dc5bfa..635ae2c 100644\r\n    --- a/pkgs/tools/misc/coreutils/default.nix\r\n    +++ b/pkgs/tools/misc/coreutils/default.nix\r\n    @@ -59,7 +59,8 @@ let\r\n         # (http://thread.gmane.org/gmane.comp.gnu.core-utils.bugs/19025),\r\n         # Darwin (http://thread.gmane.org/gmane.comp.gnu.core-utils.bugs/19351),\r\n         # and {Open,Free}BSD.\r\n    -    doCheck = stdenv ? glibc;\r\n    +    doCheck = false;\r\n    +    # stdenv ? glibc;\r\n     \r\n         # Saw random failures like ‘help2man: can't get '--help' info from\r\n         # man/sha512sum.td/sha512sum’.\r\n    diff --git a/pkgs/tools/package-management/nix/default.nix b/pkgs/tools/package-management/nix/default.nix\r\n    index 2d10511..f272bf7 100644\r\n    --- a/pkgs/tools/package-management/nix/default.nix\r\n    +++ b/pkgs/tools/package-management/nix/default.nix\r\n    @@ -43,7 +43,7 @@ stdenv.mkDerivation rec {\r\n     \r\n       installFlags = \"sysconfdir=$(out)/etc\";\r\n     \r\n    -  doInstallCheck = true;\r\n    +  doInstallCheck = false;\r\n     \r\n       crossAttrs = {\r\n         postUnpack =\r\n\r\nNext, I ran `nix-env -iA nix -f $NIXPKGS ;` which resulted in\r\n\r\n\r\n    downloading Nix expressions from ‘http://nixos.org/releases/nixpkgs/nixpkgs-15.05pre59184.e07ea5c/nixexprs.tar.xz’...\r\n      % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current\r\n                                     Dload  Upload   Total   Spent    Left  Speed\r\n      0     0    0     0    0     0      0      0 --:--:-- --:--:-- --:--:--     0\r\n    unpacking channels...\r\n    installing ‘nix-1.8’\r\n    error: opening lock file ‘/nix/var/nix/profiles/default.lock’: No such file or directory\r\n\r\nI had passed `--localstatedir=$nix_root/var\"` to the configure. So why is it not using that directory?\r\n"},"comment":{"url":"https://api.github.com/repos/NixOS/nix/issues/comments/222760466","html_url":"https://github.com/NixOS/nix/issues/512#issuecomment-222760466","issue_url":"https://api.github.com/repos/NixOS/nix/issues/512","id":222760466,"user":{"login":"vrthra","id":70410,"avatar_url":"https://avatars.githubusercontent.com/u/70410?v=3","gravatar_id":"","url":"https://api.github.com/users/vrthra","html_url":"https://github.com/vrthra","followers_url":"https://api.github.com/users/vrthra/followers","following_url":"https://api.github.com/users/vrthra/following{/other_user}","gists_url":"https://api.github.com/users/vrthra/gists{/gist_id}","starred_url":"https://api.github.com/users/vrthra/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/vrthra/subscriptions","organizations_url":"https://api.github.com/users/vrthra/orgs","repos_url":"https://api.github.com/users/vrthra/repos","events_url":"https://api.github.com/users/vrthra/events{/privacy}","received_events_url":"https://api.github.com/users/vrthra/received_events","type":"User","site_admin":false},"created_at":"2016-05-31T17:29:34Z","updated_at":"2016-05-31T17:29:34Z","body":"Since coreutils is now fixed, I tried to run the manual installation again. This is the script I used:\r\n```bash\r\n#!/bin/bash\r\nset -e\r\nbase=$1\r\nshift;\r\nexport nix_boot=${NIX_BOOT-$base/nix-boot/usr}\r\nexport nix_root=${NIX_ROOT-$base/nix}\r\nexport RUN_EXPENSIVE_TESTS=no\r\n\r\nexport PATH=$nix_boot/bin:/usr/bin:/bin                           # wiki\r\nexport PKG_CONFIG_PATH=$nix_boot/lib/pkgconfig:$PKG_CONFIG_PATH   # wiki\r\nexport LDFLAGS=\"-L$nix_boot/lib -L$nix_boot/lib64 $LDFLAGS\"       # wiki\r\nexport CPPFLAGS=\"-I$nix_boot/include $CPPFLAGS\"                   # wiki\r\nexport PERL5OPT=\"-I$nix_boot/lib/perl\"                            # wiki\r\n#export PERL5OPT=\"-I$nix_boot/lib64/perl5\"                        # wiki on some systems.\r\nexport NIXPKGS=$base/nix-boot/nixpkgs\r\nunset PERL5LIB PERL_LOCAL_LIB_ROOT PERL_MB_OPT PERL_MM_OPT        # Perl INSTALLBASE error.\r\n\r\nall=\"get prepare \\\r\n  gcc \\\r\n  bzip2 \\\r\n  curl \\\r\n  sqlite \\\r\n  dbi \\\r\n  dbd \\\r\n  wwwcurl \\\r\n  bison \\\r\n  flex \\\r\n  coreutils \\\r\n  nixbootstrap nix nixconfig nixprofile\"\r\n\r\nget() {\r\n  # remove echo to download.\r\n  echo wget -c $1\r\n}\r\ncase $1 in\r\n  -h) echo $all; exit 0;;\r\n  get)\r\n    mkdir -p src\r\n    (cd ./static;\r\n    files=\"https://nixos.org/releases/nix/nix-1.10/nix-1.10.tar.xz\r\n           http://bzip.org/1.0.6/bzip2-1.0.6.tar.gz\r\n           http://curl.haxx.se/download/curl-7.35.0.tar.lzma\r\n           https://www.sqlite.org/2014/sqlite-autoconf-3080300.tar.gz\r\n           http://pkgs.fedoraproject.org/repo/extras/perl-DBI/DBI-1.631.tar.gz/444d3c305e86597e11092b517794a840/DBI-1.631.tar.gz\r\n           http://pkgs.fedoraproject.org/repo/pkgs/perl-DBD-SQLite/DBD-SQLite-1.40.tar.gz/b9876882186499583428b14cf5c0e29c/DBD-SQLite-1.40.tar.gz\r\n           http://search.cpan.org/CPAN/authors/id/S/SZ/SZBALINT/WWW-Curl-4.15.tar.gz\r\n           http://ftp.gnu.org/gnu/bison/bison-3.0.4.tar.gz\r\n           http://sourceforge.mirrorservice.org/f/fl/flex/flex-2.5.36.tar.gz\r\n           https://ftp.gnu.org/gnu/gcc/gcc-4.9.2/gcc-4.9.2.tar.gz\r\n           http://ftp.gnu.org/gnu/coreutils/coreutils-8.23.tar.xz\"\r\n      for i in $files;\r\n      do\r\n        y=$(echo $i | sed -e 's#.*/##g')\r\n        get -c $i;\r\n        case $i in\r\n          *xz) xzcat $y;;\r\n          *gz) zcat $y;;\r\n          *lzma) xzcat $y;;\r\n          *tar) cat $y;;\r\n          *) cat $y;;\r\n        esac | (cd ../src && tar -xvpf -)\r\n      done )\r\n    ;;\r\n  -sh) $2; exit 0;;\r\nbzip2)\r\n(cd src/bzip2-1.0.6;\r\n  make -f Makefile-libbz2_so;\r\n  make install PREFIX=$nix_boot;\r\n  cp libbz2.so.1.0 libbz2.so.1.0.6 $nix_boot/lib; ) ;;\r\n\r\ncurl)\r\n(cd src/curl-7.35.0/;\r\n  ./configure --prefix=$nix_boot;\r\n  make;\r\n  make install; ) ;;\r\n\r\nsqlite)\r\n(cd src/sqlite-autoconf-3080300/;\r\n  ./configure --prefix=$nix_boot;\r\n  make;\r\n  make install; ) ;;\r\n\r\nlibxml2)\r\n  (cd src/libxml2-2.9.2; ./configure --prefix=$nix_boot;\r\n  make;\r\n  cp ./libxml2-2.9.2/xmllint $nix_boot/bin\r\n  # make install;\r\n  ) ;;\r\n\r\nlibxslt)\r\n  (cd src/libxslt-1.1.28;  ./configure --prefix=$nix_boot;\r\n  make;\r\n  make install; ) ;;\r\n\r\ngcc)\r\n  (cd src/gcc-4.9.2; ./contrib/download_prerequisites; )\r\n  rm -rf src/gcc-objs;\r\n  mkdir -p src/gcc-objs\r\n  (cd src/gcc-objs; ./../gcc-4.9.2/configure --prefix=$nix_boot --disable-multilib;\r\n  make;\r\n  make install; ) ;;\r\n\r\nbison)\r\n  (cd src/bison-3.0*; ./configure --prefix=$nix_boot;\r\n  make;\r\n  make install; ) ;;\r\n\r\nflex)\r\n  (cd src/flex-2.5.*;  ./configure --prefix=$nix_boot;\r\n  make;\r\n  make install; );;\r\n\r\ncoreutils)\r\n  (cd src/coreutils-8.23;  ./configure --enable-install-program=hostname --prefix=$nix_boot;\r\n  make;\r\n  make install; );;\r\n\r\nbash)\r\n  (cd src/bash-4.3;  ./configure --prefix=$nix_boot;\r\n  make;\r\n  make install; );;\r\n\r\ndbi)\r\n(cd src/DBI-1.631/;\r\n  echo perl Makefile.PL PREFIX=$nix_boot PERLMAINCC=$nix_boot/bin/gcc > myconfig.sh;\r\n  chmod +x myconfig.sh;\r\n  ./myconfig.sh;\r\n  make;\r\n  make install; ) ;;\r\n\r\ndbd)\r\n(cd src/DBD-SQLite-1.40/;\r\n  echo perl Makefile.PL PREFIX=$nix_boot PERLMAINCC=$nix_boot/bin/gcc > myconfig.sh;\r\n  chmod +x myconfig.sh;\r\n  ./myconfig.sh;\r\n  make;\r\n  make install; ) ;;\r\n\r\nwwwcurl)\r\n(cd src/WWW-Curl-4.15;\r\n  echo perl Makefile.PL PREFIX=$nix_boot PERLMAINCC=$nix_boot/bin/gcc > myconfig.sh;\r\n  chmod +x myconfig.sh;\r\n  ./myconfig.sh;\r\n  make;\r\n  make install; ) ;;\r\n\r\nprepare)\r\n  rm -rf nix\r\n  rm -rf $NIXPKGS\r\n  rm -rf ~/.nix-profile\r\n  git clone https://github.com/NixOS/nix nix\r\n  git clone git@github.com:NixOS/nixpkgs.git $NIXPKGS\r\n  ;;\r\n\r\nnixbootstrap)\r\n(cd nix;\r\n  ./bootstrap.sh ) ;;\r\n\r\nnix)\r\n(cd nix;\r\n  echo \"./configure --prefix=$nix_boot \\\r\n                    --with-store-dir=$nix_root/store \\\r\n                    --localstatedir=$nix_root/var\" > myconfig.sh;\r\n  chmod +x ./myconfig.sh\r\n  ./myconfig.sh\r\n  # --with-coreutils-bin=$nix_boot/usr/bin;\r\n  /usr/bin/perl -pi -e 's#--nonet# #g' doc/manual/local.mk;\r\n  echo \"GLOBAL_LDFLAGS += -lpthread\" >> doc/manual/local.mk;\r\n  make;\r\n  make install; ) ;;\r\n\r\nnixconfig)\r\n  ( export LD_LIBRARY_PATH=\"$nix_boot/lib:$nix_boot/lib64:$LD_LIBRARY_PATH\";\r\n  echo $LD_LIBRARY_PATH;\r\n  # nix-channel --add http://nixos.org/channels/nixpkgs-unstable && \\\r\n  # nix-channel --update &&\r\n  # nix-env -i nix\r\n  $nix_boot/bin/nix-env -iA nix -f $NIXPKGS )\r\n  $nix_root/var/nix/profiles/default/bin/nix-env -iA nix -f $NIXPKGS\r\n ;;\r\n\r\nnixprofile)\r\n  ln -s $nix_root/var/nix/profiles/default $HOME/.nix-profile\r\n  ;;\r\n\r\nall) for i in $all;\r\n     do env nix_boot=$nix_boot nix_root=$nix_root ./$0 $i ;\r\n     done ;;\r\n\r\n*) echo $0 '<install-base>' all\r\n   echo $all;\r\n   echo nix_root=$nix_root\r\n   echo nix_boot=$nix_boot\r\n   echo PATH=$PATH\r\n   echo PKG_CONFIG_PATH=$PKG_CONFIG_PATH\r\n   echo LDFLAGS=$LDFLAGS\r\n   echo CPPFLAGS=$CPPFLAGS\r\n   echo PERL5OPT=$PERL5OPT\r\n   echo NIXPKGS=$NIXPKGS ;;\r\nesac\r\n```\r\nIt can be executed by giving a base directory on which `nix-boot` and `nix-store` should be created, and the target to be executed. For example, to do the complete installation the target is `all`\r\n\r\n```\r\n./nix-install.sh /scratch/gopinatr all\r\n```\r\nSo with the latest checkout, I have another problem.\r\n `nix-env` fails to read the store.\r\n```bash\r\n./nix-install.sh /scratch/gopinatr nixconfig\r\nerror: current Nix store schema is version 9, but I only support 7\r\n```\r\nor\r\n```\r\n$nix_root/var/nix/profiles/default/bin/nix-env -iA nix -f $NIXPKGS\r\nerror: current Nix store schema is version 9, but I only support 7\r\n```\r\nHowever, the nix-env that I installed in `$nix_boot/usr/bin/nix-env` has no problems with the store."}}
{"actor":{"display_login":"vrthra"}}