我的努力

我的努力

我一直在努力遵循Nix 维基在自定义路径上安装 Nix /scratch/gopinath/nix/nix由于我所在大学提供的系统限制,我无法访问该路径。普鲁特选项不符合我的要求。我也没有 root 访问权限。

环境:

| uname -a
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
| cat /etc/redhat-release
Red Hat Enterprise Linux Workstation release 6.5 (Santiago)
| gcc --version
gcc (GCC) 4.4.7 20120313 (Red Hat 4.4.7-4)

我的努力

这是我到目前为止尝试过的;我install.sh在提取的文件夹上使用了以下脚本/scratch/gopinath/usr/nix-boot

#!/bin/bash
set -e
export nix_boot=${NIX_BOOT-/scratch/gopinath/usr/nix-boot}
export nix_root=${NIX_ROOT-/scratch/gopinath/nix}
export RUN_EXPENSIVE_TESTS=no
export PATH=$nix_boot/bin:/scratch/gopinath/usr/bin:$PATH
export PKG_CONFIG_PATH=$nix_boot/lib/pkgconfig:$PKG_CONFIG_PATH
export LDFLAGS="-L$nix_boot/lib -L$nix_boot/lib64 $LDFLAGS"
export LD_LIBRARY_PATH="$nix_boot/lib:$nix_boot/lib64:$LD_LIBRARY_PATH"
export CPPFLAGS="-I$nix_boot/include $CPPFLAGS"
#export PERL5OPT="-I$nix_boot/lib/perl"
export PERL5OPT="-I$nix_boot/lib64/perl5"
export NIXPKGS=/scratch/gopinath/nixpkgs
all="bzip2 curl sqlite dbi dbd wwwcurl bootstrap nix"
case $1 in
  -h) echo $all nix1.8; exit 0;;
  -sh) $2; exit 0;;
bzip2)
(cd bzip2-1.0.6;
  make -f Makefile-libbz2_so;
  make install PREFIX=$nix_boot;
  cp libbz2.so.1.0 libbz2.so.1.0.6 $nix_boot/lib; ) ;;

curl)
(cd curl-7.35.0/;
  ./configure --prefix=$nix_boot;
  make;
  make install; ) ;;

sqlite)
(cd sqlite-autoconf-3080300/;
  ./configure --prefix=$nix_boot;
  make;
  make install; ) ;;

libxml2)
  (cd libxml2-2.9.2; ./configure --prefix=$nix_boot;
  make;
  cp ./libxml2-2.9.2/xmllint $nix_boot/bin
  # make install;
  ) ;;

libxslt)
  (cd libxslt-1.1.28;  ./configure --prefix=$nix_boot;
  make;
  make install; ) ;;

gcc)
  (cd gcc-4.9.2; ./contrib/download_prerequisites; )
  rm -rf gcc-objs;
  mkdir -p gcc-objs
  (cd gcc-objs; ./../gcc-4.9.2/configure --prefix=$nix_boot;
  make;
  make install; ) ;;

bison)
  (cd bison-3.0; ./configure --prefix=$nix_boot;
  make;
  make install; ) ;;

flex)
  (cd flex-2.5.39;  ./configure --prefix=$nix_boot;
  make;
  make install; );;

coreutils)
  (cd coreutils-8.23;  ./configure --enable-install-program=hostname --prefix=$nix_boot;
  make;
  make install; );;

bash)
  (cd bash-4.3;  ./configure --prefix=$nix_boot;
  make;
  make install; );;

dbi)
(cd DBI-1.631/;
  perl Makefile.PL PREFIX=$nix_boot PERLMAINCC=$nix_boot/bin/gcc;
  make;
  make install; ) ;;

dbd)
(cd DBD-SQLite-1.40/;
  perl Makefile.PL PREFIX=$nix_boot PERLMAINCC=$nix_boot/bin/gcc;
  make;
  make install; ) ;;

wwwcurl)
(cd WWW-Curl-4.15;
  perl Makefile.PL PREFIX=$nix_boot PERLMAINCC=$nix_boot/bin/gcc;
  make;
  make install; ) ;;

bootstrap)
rm -rf nix
git clone https://github.com/NixOS/nix nix
(cd nix;
  ./bootstrap.sh ) ;;

nix)
(cd nix;
  echo "./configure --prefix=$nix_boot --with-store-dir=$nix_root/store --localstatedir=$nix_root/var" > myconfig.sh;
  ./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 ;
  /usr/bin/perl -pi -e 's#--nonet# #g' doc/manual/local.mk;
  echo "GLOBAL_LDFLAGS += -lpthread" >> doc/manual/local.mk;
  make;
  make install; ) ;;

nixconfig)
  nix-channel --add http://nixos.org/channels/nixpkgs-unstable && \
  nix-channel --update && \
  nix-env -iA nix -f $NIXPKGS ;
 ;;

all) for i in $all;
     do env nix_boot=$nix_boot nix_root=$nix_root ./$0 $i ;
     done ;;

*) echo $all;
   echo nix_root=$nix_root
   echo nix_boot=$nix_boot;;
esac

一切都运行正常,直到我点击nix。在存储库上,我得到nix 1.8nix

bash-4.1$ make
Makefile:28: Makefile.config: No such file or directory
  GEN    Makefile.config
  GEN    doc/manual/manual.is-valid
-:1: parser error : Document is empty

^
-:1: parser error : Start tag expected, '<' not found

^
make: *** [doc/manual/manual.is-valid] Error 1

如果我这样做make clean,然后make我得到

bash-4.1$ make
Makefile:28: Makefile.config: No such file or directory
  GEN    Makefile.config
  GEN    doc/manual/version.txt
  GEN    doc/manual/manual.xmli
doc/manual/command-ref/nix-env.xml:203: element include: XInclude error : failed build URL
doc/manual/command-ref/nix-env.xml:1368: element include: XInclude error : failed build URL
doc/manual/command-ref/nix-build.xml:129: element include: XInclude error : failed build URL
doc/manual/command-ref/nix-build.xml:184: element include: XInclude error : failed build URL
doc/manual/command-ref/nix-shell.xml:143: element include: XInclude error : failed build URL
doc/manual/command-ref/nix-shell.xml:195: element include: XInclude error : failed build URL
doc/manual/command-ref/nix-store.xml:119: element include: XInclude error : failed build URL
doc/manual/command-ref/nix-store.xml:1346: element include: XInclude error : failed build URL
doc/manual/command-ref/nix-instantiate.xml:166: element include: XInclude error : failed build URL
doc/manual/command-ref/nix-instantiate.xml:258: element include: XInclude error : failed build URL
  GEN    doc/manual/manual.is-valid
-:1: parser error : Document is empty

^
-:1: parser error : Start tag expected, '<' not found

^
make: *** [doc/manual/manual.is-valid] Error 1

在调试时,似乎xsltproc使用--nonet标志调用,如下所示

file: doc/manual/local.mk 

$(d)/manual.is-valid: $(d)/manual.xmli
/scratch/gopinath/usr/nix-boot/bin/xsltproc --nonet \
  --param section.autolabel 1 \
  --param section.label.includes.component.label 1 \
  --param html.stylesheet \'style.css\' \
  --param xref.with.number.and.title 1 \
  --param toc.section.depth 3 \
  --param admon.style \'\' \
  --param callout.graphics.extension \'.gif\' \
  --param contrib.inline.enabled 0 \
  --stringparam generate.toc "book toc" \
  --param keep.relative.image.uris 0 \
  --novalid \
  --stringparam profile.condition manual \
           http://docbook.sourceforge.net/release/xsl-ns/1.78.1/profiling/profile.xsl \
           doc/manual/manual.xmli \
  | /scratch/gopinath/usr/nix-boot/bin/xmllint --nonet --noout --relaxng http://docbook.org/xml/5.0/rng/docbook.rng -

即使使用最新的(在上面的安装脚本中提到),标志似乎也nonet以某种方式困扰着我。xmllintxsltproc

bash-4.1$ which xsltproc
/scratch/gopinath/usr/nix-boot/bin/xsltproc
bash-4.1$ /scratch/gopinath/usr/nix-boot/bin/xsltproc --version
Using libxml 20902, libxslt 10128 and libexslt 817
xsltproc was compiled against libxml 20902, libxslt 10128 and libexslt 817
libxslt 10128 was compiled against libxml 20902
libexslt 817 was compiled against libxml 20902
bash-4.1$ which xmllint
/scratch/gopinath/usr/nix-boot/bin/xmllint
bash-4.1$ /scratch/gopinath/usr/nix-boot/bin/xmllint --version
/scratch/gopinath/usr/nix-boot/bin/xmllint: using libxml version 20902
   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 

因此我按照上面的脚本中提到的进行了perl -pi -e 's#--nonet# #g'操作。doc/manual/local.mk

现在看来,GCC 4.4.7(默认)对 C11 的支持不够。因此,我将 GCC 更新到 4.9.2,并将其安装到同一位置(在上述脚本中更新)。现在我在构建时遇到的错误nix

$ make
...
configure: creating ./config.status
config.status: creating config.h
config.status: config.h is unchanged
  GEN    Makefile.config
  CXX    src/nix-hash/nix-hash.o
  CXX    src/libmain/shared.o
  CXX    src/libmain/stack.o
  CXX    src/libstore/build.o
  CXX    src/libstore/derivations.o
  CXX    src/libstore/gc.o
  CXX    src/libstore/globals.o
  GEN    src/libstore/schema.sql.hh
  CXX    src/libstore/local-store.o
  CXX    src/libstore/misc.o
  CXX    src/libstore/optimise-store.o
  CXX    src/libstore/pathlocks.o
  CXX    src/libstore/references.o
  CXX    src/libstore/remote-store.o
  CXX    src/libstore/store-api.o
  CXX    src/libutil/affinity.o
  CXX    src/libutil/archive.o
  CXX    src/libutil/hash.o
  CXX    src/libutil/regex.o
  CXX    src/libutil/serialise.o
  CXX    src/libutil/util.o
  CXX    src/libutil/xml-writer.o
  CXX    src/boost/format/format_implementation.o
  CXX    src/boost/format/free_funcs.o
  CXX    src/boost/format/parsing.o
  LD     src/boost/format/libnixformat.so
  LD     src/libutil/libnixutil.so
  LD     src/libstore/libnixstore.so
  LD     src/libmain/libnixmain.so
  LD     src/nix-hash/nix-hash
/usr/bin/ld: src/nix-hash/nix-hash: undefined reference to symbol '__pthread_key_create@@GLIBC_2.2.5'
/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
/lib64/libpthread.so.0: could not read symbols: Invalid operation
collect2: error: ld returned 1 exit status
make: *** [src/nix-hash/nix-hash] Error 1
zsh: exit 1     ./install.sh nix

doc/manual/local.mk我通过添加一行来修改解决了此错误GLOBAL_LDFLAGS += -lpthread。现在的错误是

  CXX    src/libexpr/parser-tab.o
In file included from src/libexpr/parser-tab.cc:255:0:
src/libexpr/parser-tab.hh:124:15: error: redefinition of ‘union YYSTYPE’
 typedef union YYSTYPE
               ^
In file included from src/libexpr/parser.y:53:0:
src/libexpr/parser-tab.hh:124:15: error: previous definition of ‘union YYSTYPE’
 typedef union YYSTYPE
               ^
In file included from src/libexpr/parser-tab.cc:255:0:
src/libexpr/parser-tab.hh:147:10: error: invalid type in declaration before ‘;’ token
 } YYSTYPE;
          ^
src/libexpr/parser-tab.hh:147:10: error: conflicting declaration ‘typedef int YYSTYPE’
In file included from src/libexpr/parser.y:53:0:
src/libexpr/parser-tab.hh:147:3: note: previous declaration as ‘typedef union YYSTYPE YYSTYPE’
 } YYSTYPE;
   ^
make: *** [src/libexpr/parser-tab.o] Error 1

显然这是因为我的野牛已经老了

| yacc -V       
yacc - 1.9 20070509
| bison -V
bison (GNU Bison) 2.4.1

我将其更新为 bison 3.0(在上面的脚本中),错误消失了,但flex需要更新

  GEN    Makefile.config
  CXX    src/libexpr/parser-tab.o
In file included from src/libexpr/parser-tab.cc:255:0:
src/libexpr/parser-tab.hh:124:15: error: redefinition of ‘union YYSTYPE’
 typedef union YYSTYPE
               ^
In file included from src/libexpr/parser.y:53:0:
src/libexpr/parser-tab.hh:124:15: error: previous definition of ‘union YYSTYPE’
 typedef union YYSTYPE
               ^
In file included from src/libexpr/parser-tab.cc:255:0:
src/libexpr/parser-tab.hh:147:10: error: invalid type in declaration before ‘;’ token
 } YYSTYPE;
          ^
src/libexpr/parser-tab.hh:147:10: error: conflicting declaration ‘typedef int YYSTYPE’
In file included from src/libexpr/parser.y:53:0:
src/libexpr/parser-tab.hh:147:3: note: previous declaration as ‘typedef union YYSTYPE YYSTYPE’
 } YYSTYPE;
   ^

更新到flex 2.5.39似乎可以消除剩余的错误。现在,添加频道

bash-4.1$ nix-channel --add http://nixos.org/channels/nixpkgs-unstable
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.
 at /scratch/gopinath/usr/nix-boot/lib/perl5/site_perl/5.10.1/x86_64-linux-thread-multi/Nix/Store.pm line 38
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.
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.
Compilation failed in require at /scratch/gopinath/usr/nix-boot/bin/nix-channel line 8.
BEGIN failed--compilation aborted at /scratch/gopinath/usr/nix-boot/bin/nix-channel line 8.

通过设置 LD_LIBRARY_PATH 来解决这个问题,$nix_boot/lib64 之后,指南要求我使用

bash-4.1$ cat ~/.nixpkgs/config.nix 
pkgs:
{
  packageOverrides = self: {
    nix = self.nix.override {
      storeDir = "/scratch/gopinath/nix/store";
      stateDir = "/scratch/gopinath/nix/var";
    };
  };
}

bash-4.1$ nix-env -iA nix
error: attribute ‘nix’ in selection path ‘nix’ not found

看起来这里是一个解决方案。因此,

$ nix-env -iA nix -f ~/.nix-defexpr/channels/nixpkgs
...
building tests/test-suite.log
make[5]: Entering directory `/tmp/nix-build-coreutils-8.23.drv-0/coreutils-8.23'
building all
make  all-recursive
make[6]: Entering directory `/tmp/nix-build-coreutils-8.23.drv-0/coreutils-8.23'
building all-recursive
Making all in po
make[7]: Entering directory `/tmp/nix-build-coreutils-8.23.drv-0/coreutils-8.23/po'
building check-macro-version
make[7]: Leaving directory `/tmp/nix-build-coreutils-8.23.drv-0/coreutils-8.23/po'
Making all in .
make[7]: Entering directory `/tmp/nix-build-coreutils-8.23.drv-0/coreutils-8.23'
make[7]: Nothing to be done for `all-am'.
make[7]: Leaving directory `/tmp/nix-build-coreutils-8.23.drv-0/coreutils-8.23'
Making all in gnulib-tests
make[7]: Entering directory `/tmp/nix-build-coreutils-8.23.drv-0/coreutils-8.23/gnulib-tests'
building all
make  all-recursive
make[8]: Entering directory `/tmp/nix-build-coreutils-8.23.drv-0/coreutils-8.23/gnulib-tests'
building all-recursive
Making all in .
make[9]: Entering directory `/tmp/nix-build-coreutils-8.23.drv-0/coreutils-8.23/gnulib-tests'
make[9]: Nothing to be done for `all-am'.
make[9]: Leaving directory `/tmp/nix-build-coreutils-8.23.drv-0/coreutils-8.23/gnulib-tests'
make[8]: Leaving directory `/tmp/nix-build-coreutils-8.23.drv-0/coreutils-8.23/gnulib-tests'
make[7]: Leaving directory `/tmp/nix-build-coreutils-8.23.drv-0/coreutils-8.23/gnulib-tests'
make[6]: Leaving directory `/tmp/nix-build-coreutils-8.23.drv-0/coreutils-8.23'
make[5]: Leaving directory `/tmp/nix-build-coreutils-8.23.drv-0/coreutils-8.23'
...
============================================================================
Testsuite summary for GNU coreutils 8.23
============================================================================
# TOTAL: 563
# PASS:  439
# SKIP:  120
# XFAIL: 0
# FAIL:  3
# XPASS: 0
# ERROR: 1
============================================================================
See ./tests/test-suite.log
Please report to [email protected]
============================================================================
make[4]: *** [tests/test-suite.log] Error 1
make[4]: Leaving directory `/tmp/nix-build-coreutils-8.23.drv-0/coreutils-8.23'
make[3]: *** [check-TESTS] Error 2
make[3]: Leaving directory `/tmp/nix-build-coreutils-8.23.drv-0/coreutils-8.23'
make[2]: *** [check-am] Error 2
make[2]: Leaving directory `/tmp/nix-build-coreutils-8.23.drv-0/coreutils-8.23'
make[1]: *** [check-recursive] Error 1
make[1]: Leaving directory `/tmp/nix-build-coreutils-8.23.drv-0/coreutils-8.23'
make: *** [check] Error 2
builder for ‘/scratch/gopinath/nix/store/1rcj45a27mz06rlw354k1zzwvz0wf24k-coreutils-8.23.drv’ failed
 with exit code 2
cannot build derivation ‘/scratch/gopinath/nix/store/m2v75p5m7irqh0z2af5idypkil9v630m-stdenv.drv’: 1
 dependencies couldn't be built
cannot build derivation ‘/scratch/gopinath/nix/store/sp3ic057ydmkv4cnxrbgz016ivy3lac3-nix-1.8.drv’: 
1 dependencies couldn't be built
error: build of ‘/scratch/gopinath/nix/store/sp3ic057ydmkv4cnxrbgz016ivy3lac3-nix-1.8.drv’ failed

所以core-utils失败了。现在我该怎么办?错误测试是

...
ERROR: tests/chown/separator
============================

id: cannot find name for user ID 44172
separator.sh: set-up failure: 
...

失败的是

FAIL: tests/misc/help-version
=============================

0+1 records in
0+1 records out
whoami: cannot find name for user ID 44172
FAIL: whoami
FAIL: tests/id/uid
==================

id: cannot find name for user ID 44172
id: : no such user
id: 44172: no such user
id: 44172: no such user
id: +44172: no such user
id: 44172: no such user
id: 44172: no such user
id: +44172: no such user
id: 44172: no such user
id: 44172: no such user
id: +44172: no such user
...
FAIL: tests/id/zero
===================

id: cannot find name for user ID 44172
uid=44172 gid=16473 groups=16473,5087,5105,10550,12244,13985,14073,20416
id: 44172: no such user
id: 44172: no such user
....
id: cannot find name for group ID 16473
id: cannot find name for group ID 16473
....
--- exp 2015-04-12 04:20:21.655856440 +0000
+++ out2        2015-04-12 04:20:21.660856355 +0000
@@ -1,5 +1,17 @@
@@ -1,5 +1,17 @@

-id -g[z] 44172: id -gn[z] 44172: id -gr[z] 44172: id -grn[z] 44172: id -G[z] 44172: id -Gn[z] 44172
: id -Gr[z] 44172: id -Grn[z] 44172: id -u[z] 44172: id -un[z] 44172: id -ur[z] 44172: id -urn[z] 44
172: id -g[z] root: 0
+id -g[z] 44172: 
+id -gn[z] 44172: 
...

于是我在同一前缀上安装了 coreutils-8.23,然后再次尝试。不幸的是,上述测试还是出错了。似乎它总是试图使用系统,id而不管路径设置如何。

更新

我想禁用文件doChecks中的coreutils-8.23.drv。所以我克隆了 repohttps://github.com/nixos/nixpkgs并设置NIXPKGS指向它的环境变量。接下来,我修改以便pkgs/tools/misc/coreutils/default.nix始终doCheck = false。接下来我执行

nix-env -iA nix -f $NIXPKGS
...
FAIL: tests/dump-db.sh
running test tests/case-hack.sh
+ clearStore
+ echo 'clearing store...'
clearing store...
+ chmod -R +w /tmp/nix-build-nix-1.8.drv-0/nix-1.8/tests/test-tmp/store
+ rm -rf /tmp/nix-build-nix-1.8.drv-0/nix-1.8/tests/test-tmp/store
+ mkdir /tmp/nix-build-nix-1.8.drv-0/nix-1.8/tests/test-tmp/store
+ rm -rf /tmp/nix-build-nix-1.8.drv-0/nix-1.8/tests/test-tmp/db
+ mkdir /tmp/nix-build-nix-1.8.drv-0/nix-1.8/tests/test-tmp/db
+ nix-store --init
+ clearProfiles
+ profiles=/tmp/nix-build-nix-1.8.drv-0/nix-1.8/tests/test-tmp/var/nix/profiles
+ rm -rf /tmp/nix-build-nix-1.8.drv-0/nix-1.8/tests/test-tmp/var/nix/profiles
+ rm -f /tmp/nix-build-nix-1.8.drv-0/nix-1.8/tests/test-tmp/var/nix/gcroots/auto/mqgm5a11kh8r74bbz2gzygddh00lakss
+ rm -f /tmp/nix-build-nix-1.8.drv-0/nix-1.8/tests/test-tmp/var/nix/gcroots/ref
+ rm -rf /tmp/nix-build-nix-1.8.drv-0/nix-1.8/tests/test-tmp/case
+ opts='--option use-case-hack true'
+ nix-store --option use-case-hack true --restore /tmp/nix-build-nix-1.8.drv-0/nix-1.8/tests/test-tmp/case
+ nix-store --option use-case-hack true --dump /tmp/nix-build-nix-1.8.drv-0/nix-1.8/tests/test-tmp/case
+ cmp case.nar /tmp/nix-build-nix-1.8.drv-0/nix-1.8/tests/test-tmp/case.nar
++ nix-hash --option use-case-hack true --type sha256 /tmp/nix-build-nix-1.8.drv-0/nix-1.8/tests/test-tmp/case
++ nix-hash --flat --type sha256 case.nar
+ '[' ccd0c2353fbb6ff6853088e01f0557e8b9cbc9d11d2e1f8435175dc08091c2a3 = ccd0c2353fbb6ff6853088e01f0557e8b9cbc9d11d2e1f8435175dc08091c2a3 ']'
+ touch /tmp/nix-build-nix-1.8.drv-0/nix-1.8/tests/test-tmp/case/xt_CONNMARK.h~nix~case~hack~3
+ nix-store --option use-case-hack true --dump /tmp/nix-build-nix-1.8.drv-0/nix-1.8/tests/test-tmp/case
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’
PASS: tests/case-hack.sh
running test tests/check-reqs.sh
+ RESULT=/tmp/nix-build-nix-1.8.drv-0/nix-1.8/tests/test-tmp/result
+ nix-build -o /tmp/nix-build-nix-1.8.drv-0/nix-1.8/tests/test-tmp/result check-reqs.nix -A test1
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.
error: substituter ‘download-from-binary-cache.pl’ died unexpectedly
FAIL: tests/check-reqs.sh
30 out of 42 tests failed 
mk/tests.mk:11: recipe for target 'installcheck' failed
make: *** [installcheck] Error 1
builder for ‘/scratch/gopinath/nix/store/fl8hcbq2cqpadbdrlh2cf5zmafx79r6z-nix-1.8.drv’ failed with exit code 2
error: build of ‘/scratch/gopinath/nix/store/fl8hcbq2cqpadbdrlh2cf5zmafx79r6z-nix-1.8.drv’ failed

所以我禁用doInstallCheckpkgs/tools/package-management/nix/default.nix。以下是我迄今为止的更改

diff --git a/pkgs/tools/misc/coreutils/default.nix b/pkgs/tools/misc/coreutils/default.nix
index 1dc5bfa..635ae2c 100644
--- a/pkgs/tools/misc/coreutils/default.nix
+++ b/pkgs/tools/misc/coreutils/default.nix
@@ -59,7 +59,8 @@ let
     # (http://thread.gmane.org/gmane.comp.gnu.core-utils.bugs/19025),
     # Darwin (http://thread.gmane.org/gmane.comp.gnu.core-utils.bugs/19351),
     # and {Open,Free}BSD.
-    doCheck = stdenv ? glibc;
+    doCheck = false;
+    # stdenv ? glibc;

     # Saw random failures like ‘help2man: can't get '--help' info from
     # man/sha512sum.td/sha512sum’.
diff --git a/pkgs/tools/package-management/nix/default.nix b/pkgs/tools/package-management/nix/default.nix
index 2d10511..f272bf7 100644
--- a/pkgs/tools/package-management/nix/default.nix
+++ b/pkgs/tools/package-management/nix/default.nix
@@ -43,7 +43,7 @@ stdenv.mkDerivation rec {

   installFlags = "sysconfdir=$(out)/etc";

-  doInstallCheck = true;
+  doInstallCheck = false;

   crossAttrs = {
     postUnpack =

接下来,我运行nix-env -iA nix -f $NIXPKGS ;

downloading Nix expressions from ‘http://nixos.org/releases/nixpkgs/nixpkgs-15.05pre59184.e07ea5c/nixexprs.tar.xz’...
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
  0     0    0     0    0     0      0      0 --:--:-- --:--:-- --:--:--     0
unpacking channels...
installing ‘nix-1.8’
error: opening lock file ‘/nix/var/nix/profiles/default.lock’: No such file or directory

我已经通过了--localstatedir=$nix_root/var"配置。那么为什么它不使用该目录?任何有关进一步操作的帮助都将不胜感激。

相关内容