Open vrthra opened 9 years ago
I think it's because of this line in nix/configure.ac https://github.com/NixOS/nix/blob/master/configure.ac#L47
# State should be stored in /nix/var, unless the user overrides it explicitly.
test "$localstatedir" = '${prefix}/var' && localstatedir=/nix/var
That is, if your $localstatedir is $prefix/var, it's replaced with /nix/var, even if, as in your case, you did override it explicitly.
I have no idea why it's doing this, my workaround was to use something else for $localstatedir when configuring nix.
But my prefix is /scratch/gopinath/usr/nix-boot
and localstatedir
is /scratch/gopinath/nix/var
!
Sorry, mixed up nix-boot and nix-root. Must be something else then.
It seems to be picking it up from somewhere else I can see in nix/config.status
S["storedir"]="/scratch/gopinath/nix/store"
S["localstatedir"]="/scratch/gopinath/nix/var"
I have also tried setting
export NIX_STORE_DIR=$nix_root/store
export NIX_STATE_DIR=$nix_root/var
in the environment, I dont know why nix-env is not picking up those settings at least.
So apparently, the problem was a link from $HOME/.nix-profile
to /nix/var/nix/profiles/default
that got created at some time. If I remove this link, nix-env -iA nix -f $NIXPKGS
succeeds. Now, I am stuck with the final step in the wiki .
$ ln -s $HOME/nix/var/nix/profiles/default $HOME/.nix-profile
Unfortunately in my case, /scratch/gopinath/nix/var/nix/profiles
does not have a default
directory, but a per-user/gopinath/channels/...
directory
For what it worth, it works for me on Ubuntu 12.10 with these steps:
configure and build nix
./configure --enable-gc --prefix=/home/artem/src/nix/install-1.8 \
--with-store-dir=/home/artem/src/nix/store \
--localstatedir=/home/artem/src/nix/var
make
make install
mkdir ~/.nix-defexpr
create ~/.nixpkgs/config.nix with these overrides:
...
storeDir = "/home/artem/src/nix/store";
stateDir = "/home/artem/src/nix/var";
...
temporarily add /home/artem/src/nix/install-1.8/bin to PATH, then
nix-env -iA nix -f $NIXPKGS
this will download and bootstrap stdenv, and build nix again with all dependencies, as expected.
restore PATH
Note that the resulting nix is configured in step 4 to use the same store and state dirs as bootstrap nix in step 2, so when I'm doing
/home/artem/src/nix/var/nix/profiles/default/bin/nix-env -iA nix -f $NIXPKGS
it just says
replacing old ‘nix-1.8’
installing ‘nix-1.8’
and does nothing else, as expected - it finds that nix is already in the store.
I see these differences from your setup:
Also, you can check how the nix that you build in-store is configured
nix-instantiate --eval -E 'with import ./<your-nixpkgs-dir-here> { } ; nix.configureFlags'
in my case, it prints
"--with-store-dir=/home/artem/src/nix/store --localstatedir=/home/artem/src/nix/var --sysconfdir=/etc\n--with-dbi=/home/artem/src/nix/store/24bhn7pfxnky9afna225aj86p5khfc3l-perl-DBI-1.631/lib/perl5/site_perl\n--with-dbd-sqlite=/home/artem/src/nix/store/9fyh8wa9wcqb6l5789lpp9f4csj1361h-perl-DBD-SQLite-1.44/lib/perl5/site_perl\n--with-www-curl=/home/artem/src/nix/store/g4r6dfbr3yhmgcnvx40l5ablgjliy3h1-perl-WWW-Curl-4.17/lib/perl5/site_perl\n--disable-init-state\n--enable-gc\n"
so it picks up --with-store-dir and --localstatedir from ~/.nixpkgs/config.nix
Also, you can check if it sees ~/.nixpkgs/config.nix at all like this:
nix-instantiate --eval -E 'with import ./<your-nixpkgs-dir-here> { } ; config'
if it's there, it prints
{ packageOverrides = <LAMBDA>; }
when I remove it, it prints
{ }
Thanks, I am rebuilding the entire thing. I will update once it is done.
I was able to complete the installation once I fixed the link $HOME/.nix-profile
.
$ nix-instantiate --eval -E 'with import /scratch/gopinath/nixpkgs { } ; nix.configureFlags'
"--with-store-dir=/scratch/gopinath/nix/store --localstatedir=/scratch/gopinath/nix/var --sysconfdir=/etc\n--with-dbi=/scratch/gopinath/nix/store/8chh42ypqq8zx9pa0w7mry309d6pyawk-perl-DBI-1.631/lib/perl5/site_perl\n--with-dbd-sqlite=/scratch/gopinath/nix/store/zvi44yi1ahpabnca9dibs4w1qs6c9mh6-perl-DBD-SQLite-1.44/lib/perl5/site_perl\n--with-www-curl=/scratch/gopinath/nix/store/96gnqa8q99czrx3n2p3svvvxcdppr2fj-perl-WWW-Curl-4.17/lib/perl5/site_perl\n--disable-init-state\n--enable-gc\n"
Invoking it nix-env -iA nix -f $NIXPKGS
seems to work
I am now trying to see which of my steps are absolutely necessary. Thanks for all the help.
So, after going through the complete steps again, and using steps from @fictitious here is what I found. The set of absolutely required packages for my platform (I had to upgrade these packages, some of which are mentioned in the wiki, while (starred) others are not.). The versions are what I tested with, and were latest versions at this time.:
bison-3.0.tar.gz* DBI-1.631.tar.gz libxml2-2.9.2.tar.gz*
bzip2-1.0.6.tar.gz flex-2.5.39.tar.bz2 libxslt-1.1.28.tar.gz*
coreutils-8.23.tar.xz* WWW-Curl-4.15.tar.gz
curl-7.35.0.tar.lzma gcc-4.9.2.tar.gz*
DBD-SQLite-1.40.tar.gz sqlite-autoconf-3080300.tar.gz
I also did not enable gc, but enabled static nix. I also still had to remove the nonet, and also add pthread to LDFLAGS.
./configure --enable-static --enable-static-nix --prefix=$nix_boot --with-store-dir=$nix_root/store --localstatedir=$nix_root/var;
/usr/bin/perl -pi -e 's#--nonet# #g' doc/manual/local.mk;
echo "GLOBAL_LDFLAGS += -lpthread" >> doc/manual/local.mk;
I checked out git@github.com:nixos/nixpkgs.git
to ~/.nix-defexpr
rather than using $NIXPKGS
for convenience.
Now, the only problem I find when executing nix-env -iA nix
is that, the doCheck
fails on nix
and its requirement coreutils
fails on doInstallCheck
(the errors same as given previously). So my changes were
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;
# 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 =
With these changes, nix-env -i nix
goes through, and I verified that the system works by using $ nix-instantiate --eval -E 'with import /scratch/gopinath/nixpkgs { } ; nix.configureFlags'
and also by installing ruby
, python
, ghc
, and jdk8
Coreutils check problems: we don't have these on Hydra and I also haven't seen them locally (when rebuilding stdenv+coreutils+nix a few times). They're probably related to you not using chrooted builds and to coreutils tests being often bogus (and thus unreliable, e.g. https://github.com/NixOS/nixpkgs/issues/5652, https://github.com/NixOS/nixpkgs/issues/6306).
@vrthra @vcunat I got to here from @vrthra original threads in superuser.
I also have same issue here and I went through similar steps as @vrthra did.
I am now using the prooted method from here: https://nixos.org/wiki/How_to_install_nix_in_home_%28on_another_distribution%29
The last step fails: env NIX_STORE_DIR=$HOME/nix nix-env -i nix
It is because the coreutil. Here is my error:
ERROR: tests/rm/deep-2.sh
building tests/rm/dir-no-w.log
PASS: tests/rm/dir-no-w.sh
building tests/rm/dir-nonrecur.log
--
ERROR: tests/chown/separator.sh
building tests/cp/abuse.log
PASS: tests/cp/abuse.sh
building tests/cp/acl.log
--
ERROR: tests/du/long-from-unreadable.sh
building tests/du/long-sloop.log
long-sloop.sh: skipped test: Your system appears to be able to handle more than $n symlinks
SKIP: tests/du/long-sloop.sh
--
# ERROR: 3
.. contents:: :depth: 2
--
ERROR: tests/rm/deep-2
======================
File name too long at -e line 2.
--
ERROR: tests/chown/separator
============================
id: cannot find name for user ID 1165
--
ERROR: tests/du/long-from-unreadable
====================================
File name too long at -e line 2.
--
# ERROR: 3
============================================================================
See ./tests/test-suite.log
Please report to bug-coreutils@gnu.org
I am not sure about the File name too long at -e line 2
problem with rm and du. But for chown, @vrthra and I have similar id: cannot find name for user ID 1165
problem. I believe it is because the user is not store locally which means the /etc/passwd does not store the username. The server I use should use the LDAP authentication. I can get my user using getent passwd
Do you have any ideas to solve the coreutil problem? Or how can I configure the coreutil package (to remove the check) using the nix-env -i nix
command?
Thanks!
You should be able to switch off the check phase by defining a packageOverrides
for coreutils
in your config.nix. See wiki e.g. pkgs.mu
for details; you need to add doCheck = false;
.
About the coreutils problem: I have tried out installing Nix on a Ubuntu 14.04 system without root privileges, except that I used root privileges for the installation of some prerequisites from the official Ubuntu repository. My steps are in principle the following:
The 4th steps causes a bootstrapping where the GNU toolchain and other utilities are installed in the Nix store. Coreutils is among these packages.
Initially I ran into the problem with one of the coreutils tests failing, just like others in this thread. I could not figure out how to set up a "packageOverrides" definition to achieve "doCheck = false".
However, it turns out that if I install the 'unscd' package (using Synaptic, with root privileges) and repeat the bootstrapping then it runs to completion, and coreutils is indeed installed in the Nix store. Unscd is described as a "Micro Name Service Caching Daemon" and one of its benefits is to speed up name resolutions.
The unscd daemon starts automatically upon installation and upon reboot in the Ubuntu environment. I did not make any changes to the installed default configuration file.
My host is on a corporate LAN and configured to use a centralized service for user authentication. Maybe this is significant; maybe the coreutils problem would not be there on a stand-alone Ubuntu installation with Internet access.
Is it possible to auto disable the check when custom directory is used?
I am trying to proot bootstrap like @qqldd.
As @fowlay found, I cannot use overrideDerivation, as suggested by @vcunat, to fix the issue. my config.nix is:
{
packageOverrides = pkgs: {
coreutils = pkgs.coreutils.overrideDerivation (oldAttrs : {
doCheck = false;
name = oldAttrs.name + "-user-install";
});
usrnix = pkgs.nix.override {
storeDir = "/home/gil2a4/nix/store";
stateDir = "/home/gil2a4/nix/var";
};
};
}
Then:
env NIX_STORE_DIR=/home/gil2a4/nix/store NIX_STATE_DIR=/home/gil2a4/nix/var nix-env -iA nixpkgs.coreutils
installs the correct, overridden coreutils, but
env NIX_STORE_DIR=/home/gil2a4/nix/store NIX_STATE_DIR=/home/gil2a4/nix/var nix-env -iA nixpkgs.usrnix
Uses the old coreutils.
I am trying to automate building, is there a way to fix this without changing the file in nixpkgs, I'd prefer not to have to pull my own copy of nixpkgs and patch the doCheck line
As @zhou13 suggested, the checks are now disabled when using non-standard storeDir
.
Since coreutils is now fixed, I tried to run the manual installation again. This is the script I used:
#!/bin/bash
set -e
base=$1
shift;
export nix_boot=${NIX_BOOT-$base/nix-boot/usr}
export nix_root=${NIX_ROOT-$base/nix}
export RUN_EXPENSIVE_TESTS=no
export PATH=$nix_boot/bin:/usr/bin:/bin # wiki
export PKG_CONFIG_PATH=$nix_boot/lib/pkgconfig:$PKG_CONFIG_PATH # wiki
export LDFLAGS="-L$nix_boot/lib -L$nix_boot/lib64 $LDFLAGS" # wiki
export CPPFLAGS="-I$nix_boot/include $CPPFLAGS" # wiki
export PERL5OPT="-I$nix_boot/lib/perl" # wiki
#export PERL5OPT="-I$nix_boot/lib64/perl5" # wiki on some systems.
export NIXPKGS=$base/nix-boot/nixpkgs
unset PERL5LIB PERL_LOCAL_LIB_ROOT PERL_MB_OPT PERL_MM_OPT # Perl INSTALLBASE error.
all="get prepare \
gcc \
bzip2 \
curl \
sqlite \
dbi \
dbd \
wwwcurl \
bison \
flex \
coreutils \
nixbootstrap nix nixconfig nixprofile"
get() {
# remove echo to download.
echo wget -c $1
}
case $1 in
-h) echo $all; exit 0;;
get)
mkdir -p src
(cd ./static;
files="https://nixos.org/releases/nix/nix-1.10/nix-1.10.tar.xz
http://bzip.org/1.0.6/bzip2-1.0.6.tar.gz
http://curl.haxx.se/download/curl-7.35.0.tar.lzma
https://www.sqlite.org/2014/sqlite-autoconf-3080300.tar.gz
http://pkgs.fedoraproject.org/repo/extras/perl-DBI/DBI-1.631.tar.gz/444d3c305e86597e11092b517794a840/DBI-1.631.tar.gz
http://pkgs.fedoraproject.org/repo/pkgs/perl-DBD-SQLite/DBD-SQLite-1.40.tar.gz/b9876882186499583428b14cf5c0e29c/DBD-SQLite-1.40.tar.gz
http://search.cpan.org/CPAN/authors/id/S/SZ/SZBALINT/WWW-Curl-4.15.tar.gz
http://ftp.gnu.org/gnu/bison/bison-3.0.4.tar.gz
http://sourceforge.mirrorservice.org/f/fl/flex/flex-2.5.36.tar.gz
https://ftp.gnu.org/gnu/gcc/gcc-4.9.2/gcc-4.9.2.tar.gz
http://ftp.gnu.org/gnu/coreutils/coreutils-8.23.tar.xz"
for i in $files;
do
y=$(echo $i | sed -e 's#.*/##g')
get -c $i;
case $i in
*xz) xzcat $y;;
*gz) zcat $y;;
*lzma) xzcat $y;;
*tar) cat $y;;
*) cat $y;;
esac | (cd ../src && tar -xvpf -)
done )
;;
-sh) $2; exit 0;;
bzip2)
(cd src/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 src/curl-7.35.0/;
./configure --prefix=$nix_boot;
make;
make install; ) ;;
sqlite)
(cd src/sqlite-autoconf-3080300/;
./configure --prefix=$nix_boot;
make;
make install; ) ;;
libxml2)
(cd src/libxml2-2.9.2; ./configure --prefix=$nix_boot;
make;
cp ./libxml2-2.9.2/xmllint $nix_boot/bin
# make install;
) ;;
libxslt)
(cd src/libxslt-1.1.28; ./configure --prefix=$nix_boot;
make;
make install; ) ;;
gcc)
(cd src/gcc-4.9.2; ./contrib/download_prerequisites; )
rm -rf src/gcc-objs;
mkdir -p src/gcc-objs
(cd src/gcc-objs; ./../gcc-4.9.2/configure --prefix=$nix_boot --disable-multilib;
make;
make install; ) ;;
bison)
(cd src/bison-3.0*; ./configure --prefix=$nix_boot;
make;
make install; ) ;;
flex)
(cd src/flex-2.5.*; ./configure --prefix=$nix_boot;
make;
make install; );;
coreutils)
(cd src/coreutils-8.23; ./configure --enable-install-program=hostname --prefix=$nix_boot;
make;
make install; );;
bash)
(cd src/bash-4.3; ./configure --prefix=$nix_boot;
make;
make install; );;
dbi)
(cd src/DBI-1.631/;
echo perl Makefile.PL PREFIX=$nix_boot PERLMAINCC=$nix_boot/bin/gcc > myconfig.sh;
chmod +x myconfig.sh;
./myconfig.sh;
make;
make install; ) ;;
dbd)
(cd src/DBD-SQLite-1.40/;
echo perl Makefile.PL PREFIX=$nix_boot PERLMAINCC=$nix_boot/bin/gcc > myconfig.sh;
chmod +x myconfig.sh;
./myconfig.sh;
make;
make install; ) ;;
wwwcurl)
(cd src/WWW-Curl-4.15;
echo perl Makefile.PL PREFIX=$nix_boot PERLMAINCC=$nix_boot/bin/gcc > myconfig.sh;
chmod +x myconfig.sh;
./myconfig.sh;
make;
make install; ) ;;
prepare)
rm -rf nix
rm -rf $NIXPKGS
rm -rf ~/.nix-profile
git clone https://github.com/NixOS/nix nix
git clone git@github.com:NixOS/nixpkgs.git $NIXPKGS
;;
nixbootstrap)
(cd nix;
./bootstrap.sh ) ;;
nix)
(cd nix;
echo "./configure --prefix=$nix_boot \
--with-store-dir=$nix_root/store \
--localstatedir=$nix_root/var" > myconfig.sh;
chmod +x ./myconfig.sh
./myconfig.sh
# --with-coreutils-bin=$nix_boot/usr/bin;
/usr/bin/perl -pi -e 's#--nonet# #g' doc/manual/local.mk;
echo "GLOBAL_LDFLAGS += -lpthread" >> doc/manual/local.mk;
make;
make install; ) ;;
nixconfig)
( export LD_LIBRARY_PATH="$nix_boot/lib:$nix_boot/lib64:$LD_LIBRARY_PATH";
echo $LD_LIBRARY_PATH;
# nix-channel --add http://nixos.org/channels/nixpkgs-unstable && \
# nix-channel --update &&
# nix-env -i nix
$nix_boot/bin/nix-env -iA nix -f $NIXPKGS )
$nix_root/var/nix/profiles/default/bin/nix-env -iA nix -f $NIXPKGS
;;
nixprofile)
ln -s $nix_root/var/nix/profiles/default $HOME/.nix-profile
;;
all) for i in $all;
do env nix_boot=$nix_boot nix_root=$nix_root ./$0 $i ;
done ;;
*) echo $0 '<install-base>' all
echo $all;
echo nix_root=$nix_root
echo nix_boot=$nix_boot
echo PATH=$PATH
echo PKG_CONFIG_PATH=$PKG_CONFIG_PATH
echo LDFLAGS=$LDFLAGS
echo CPPFLAGS=$CPPFLAGS
echo PERL5OPT=$PERL5OPT
echo NIXPKGS=$NIXPKGS ;;
esac
It 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
./nix-install.sh /scratch/gopinatr all
So with the latest checkout, I have another problem.
nix-env
fails to read the store.
./nix-install.sh /scratch/gopinatr nixconfig
error: current Nix store schema is version 9, but I only support 7
or
$nix_root/var/nix/profiles/default/bin/nix-env -iA nix -f $NIXPKGS
error: current Nix store schema is version 9, but I only support 7
However, the nix-env that I installed in $nix_boot/usr/bin/nix-env
has no problems with the store.
bash-4.2$ export LD_LIBRARY_PATH=/scratch/gopinatr/nix-boot/usr/lib:/scratch/gopinatr/nix-boot/usr/lib64:
bash-4.2$ $nix_boot/bin/nix-env -iA nix -f $NIXPKGS
replacing old ‘nix-1.11.2’
installing ‘nix-1.11.2’
@vrthra I just found myself in the same situation. If you bootstrap using nix from git, the resulting store won't work with nix-1.11.
I was inspecting ./nixpkgs/pkgs/tools/package-management/nix
and found that I will have to use nix-1.12pre4523_3b81b26
Now, using that instead of nix-1.11
(update in the previous shell script)
nixconfig)
(
export LD_LIBRARY_PATH="$nix_boot/lib:$nix_boot/lib64:$LD_LIBRARY_PATH";
$nix_boot/bin/nix-env -i nix-1.12pre4523_3b81b26 -f $NIXPKGS )
$nix_root/var/nix/profiles/default/bin/nix-env -i nix-1.12pre4523_3b81b26 -f $NIXPKGS
;;
Running this
bash-4.2$ $nix_boot/bin/nix-env -i nix-1.12pre4523_3b81b26 -f $NIXPKGS
replacing old ‘nix-1.12pre4523_3b81b26’
installing ‘nix-1.12pre4523_3b81b26’
bash-4.2$ unset LD_LIBRARY_PATH
bash-4.2$ $nix_root/var/nix/profiles/default/bin/nix-env -i nix-1.12pre4523_3b81b26 -f $NIXPKGS
error: creating directory ‘/nix’: Permission denied
....
shrinking RPATHs of ELF executables and libraries in /scratch/gopinatr/nix/store/56npz4ixahpqk4304cyyas2v866lvi1j-nix-1.12pre4523_3b81b26-debug
patching script interpreter paths in /scratch/gopinatr/nix/store/56npz4ixahpqk4304cyyas2v866lvi1j-nix-1.12pre4523_3b81b26-debug
building path(s) ‘/scratch/gopinatr/nix/store/cqz9cjn8nmiqqyd5b997c9qyx2p09b9n-user-environment’
created 115 symlinks in user environment
error: creating directory ‘/nix’: Permission denied
You will have to update ~/.nixpkgs/config.nix to override unstable version with nixUnstable = self.nix.override {
.
Could you please share your command lines too? I have now
pkgs:
{
packageOverrides = self: {
nixUnstable = self.nix.override {
storeDir = "/scratch/gopinatr/nix/store";
stateDir = "/scratch/gopinatr/nix/var";
};
};
}
How do I install nixUnstable
now? running
$nix_boot/bin/nix-env -i nix -f $NIXPKGS
seems to install nix-1.11.2
rather than nix-1.12pre4523_3b81b26
Oh, sorry
nixUnstable = self.nixUnstable.override {
Something is still wrong for me.
pkgs:
{
packageOverrides = self: {
nixUnstable = self.nixUnstable.override {
storeDir = "/scratch/gopinatr/nix/store";
stateDir = "/scratch/gopinatr/nix/var";
};
};
}
And command line
bash-4.2$ $nix_boot/bin/nix-env -iA nixUnstable -f $NIXPKGS
replacing old ‘nix-1.12pre4523_3b81b26’
installing ‘nix-1.12pre4523_3b81b26’
bash-4.2$ unset LD_LIBRARY_PATH
bash-4.2$ $nix_root/var/nix/profiles/default/bin/nix-env -iA nixUnstable -f $NIXPKGS
error: current Nix store schema is version 9, but I only support 7
@vrthra It seems like revision 3b81b26 is too old https://github.com/NixOS/nix/blob/3b81b2645706d7f8d9c0ec228426dee8ef1fc7ac/src/libstore/local-store.hh#L22 I'm out of ideas.
Got one. Try editing nixpkgs/pkgs/tools/package-management/nix/default.nix to set unstable to use e.g. nix-1.12pre4663_1b5b654
In that case url needs update http://hydra.nixos.org/build/36462474/download/3/ as in http://hydra.nixos.org/build/36462474
It seems http://hydra.nixos.org/build/36462474/download/3/nix-1.12pre4663_1b5b654.tar.xz
is 404.
Probably https://github.com/NixOS/hydra/issues/321
Can you use nix-store -r /nix/store/lyxnia5x46wigvxf0cc26x2s673hiwrn-nix-tarball-1.12pre4663_1b5b654/tarballs/nix-1.12pre4663_1b5b654.tar.xz
?
@groxxda I did not understand what you meant? The file nix-1.12pre4663_1b5b654.tar.xz
is not present in my system. Did you mean for me to download it from somewhere else?
i.e
bash-4.2$ ./usr/bin/nix-store -r $nix_root/nix/store/lyxnia5x46wigvxf0cc26x2s673hiwrn-nix-tarball-1.12pre4663_1b5b654/tarballs/nix-1.12pre4663_1b5b654.tar.xz
error: getting status of ‘/scratch/gopinatr/nix/nix/store/lyxnia5x46wigvxf0cc26x2s673hiwrn-nix-tarball-1.12pre4663_1b5b654/tarballs/nix-1.12pre4663_1b5b654.tar.xz’: No such file or directory
bash-4.2$ ./usr/bin/nix-store -r /nix/store/lyxnia5x46wigvxf0cc26x2s673hiwrn-nix-tarball-1.12pre4663_1b5b654/tarballs/nix-1.12pre4663_1b5b654.tar.xz
error: getting status of ‘/nix/store/lyxnia5x46wigvxf0cc26x2s673hiwrn-nix-tarball-1.12pre4663_1b5b654/tarballs/nix-1.12pre4663_1b5b654.tar.xz’: No such file or directory
bash-4.2$ find $nix_root -name nix-1.12pre4663_1b5b654.tar.xz
For me nix-store -r ...
downloads the file from the binary cache:
nix-store -r /nix/store/lyxnia5x46wigvxf0cc26x2s673hiwrn-nix-tarball-1.12pre4663_1b5b654/
these paths will be fetched (1.52 MiB download, 1.98 MiB unpacked):
/nix/store/lyxnia5x46wigvxf0cc26x2s673hiwrn-nix-tarball-1.12pre4663_1b5b654
fetching path ‘/nix/store/lyxnia5x46wigvxf0cc26x2s673hiwrn-nix-tarball-1.12pre4663_1b5b654’...
*** Downloading ‘https://cache.nixos.org/nar/0ndrm5w5lwx3ln0mpbl92wnxvnpamxpkx0jg78qfkqym96d82n63.nar.xz’ (signed by ‘cache.nixos.org-1’) to ‘/nix/store/lyxnia5x46wigvxf0cc26x2s673hiwrn-nix-tarball-1.12pre4663_1b5b654’...
@groxxda This probably doesn't work for installation with storage in home.
@veprbl @groxxda I used a VM to install Nix, and used that vm to download using nix-store -r
as you mentioned. Using that, I was able to install
bash-4.2$ $nix_boot/bin/nix-env -iA nixUnstable -f $NIXPKGS
...
building path(s) ‘/scratch/gopinatr/nix/store/dl9zv5lqa3amsnn5n09sh2zv5y3h2i2c-user-environment’
created 5 symlinks in user environment
bash-4.2$ unset LD_LIBRARY_PATH
bash-4.2$ $nix_root/var/nix/profiles/default/bin/nix-env -iA nixUnstable -f $NIXPKGS
replacing old ‘nix-1.11.2’
installing ‘nix-1.11.2’
building path(s) ‘/scratch/gopinatr/nix/store/biaf7h3cl5c1z07rmdm8mzwgp2yds5rw-user-environment’
created 5 symlinks in user environment
bash-4.2$ nix-env -q
nix-1.11.2
bash-4.2$ which nix-env
/nfs/stak/students/g/gopinatr/.nix-profile/bin/nix-env
Thanks for all the help! I suppose once the nix 1.11.2
is released, users will be able to download the tarball any way, so this seems to be fixed!.
Related: #691 #692 #569 #566 #324 #295
FAIL: tests/id/zero
We observed a similar coreutils test failure without custom directory:
I marked this as stale due to inactivity. → More info
I closed this issue due to inactivity. → More info
I have been trying to follow the Nix wiki 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.Environment:
My efforts
This is what I have tried so far; I used the below script
install.sh
on the extracted folder/scratch/gopinath/usr/nix-boot
Every thing works fine until I hit the
nix
. On bothnix 1.8
and onnix
from the repository, I getIf I do
make clean
and thenmake
I getOn debug, it seems that
xsltproc
is called with--nonet
flag as inIt seems
nonet
flag is messing with me here somehow, even when using the latestxmllint
andxsltproc
(mentioned in the install script above).So I did
perl -pi -e 's#--nonet# #g'
ondoc/manual/local.mk
as I mention in the above script.It 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
isI worked around this error by modifying
doc/manual/local.mk
by adding a lineGLOBAL_LDFLAGS += -lpthread
. Now the error isAnd apparently this was because my bison was old
I updated this to bison 3.0 (in the script above), and the errors went away, but
flex
needs to be updatedAnd updating to
flex 2.5.39
seems to remove the remaining errors. Now, on adding the channelThis was resolved by setting LD_LIBRARY_PATH to look in
$nix_boot/lib64
After that, the guide asks me to install nix withIt seems that here is a solution. So,
So
core-utils
fails. Now what do I do? The error test isAnd fails are
So 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.It seemed that I could hack through by disabling
doChecks
in thecoreutils-8.23.drv
file. So I cloned the repo https://github.com/nixos/nixpkgs and setNIXPKGS
enviornment variable pointing to it. Next, I modified thepkgs/tools/misc/coreutils/default.nix
so thatdoCheck = false
always. Next I executedSo I disabled
doInstallCheck
inpkgs/tools/package-management/nix/default.nix
. Here are my changes so farNext, I ran
nix-env -iA nix -f $NIXPKGS ;
which resulted inI had passed
--localstatedir=$nix_root/var"
to the configure. So why is it not using that directory?