forked from lix-project/lix
parent
4724903c78
commit
418a837897
1
Makefile
1
Makefile
|
@ -18,7 +18,6 @@ makefiles = \
|
||||||
src/nix-channel/local.mk \
|
src/nix-channel/local.mk \
|
||||||
src/nix-build/local.mk \
|
src/nix-build/local.mk \
|
||||||
src/build-remote/local.mk \
|
src/build-remote/local.mk \
|
||||||
perl/local.mk \
|
|
||||||
scripts/local.mk \
|
scripts/local.mk \
|
||||||
corepkgs/local.mk \
|
corepkgs/local.mk \
|
||||||
misc/systemd/local.mk \
|
misc/systemd/local.mk \
|
||||||
|
|
52
configure.ac
52
configure.ac
|
@ -121,7 +121,6 @@ AC_PATH_PROG(xmllint, xmllint, false)
|
||||||
AC_PATH_PROG(xsltproc, xsltproc, false)
|
AC_PATH_PROG(xsltproc, xsltproc, false)
|
||||||
AC_PATH_PROG(flex, flex, false)
|
AC_PATH_PROG(flex, flex, false)
|
||||||
AC_PATH_PROG(bison, bison, false)
|
AC_PATH_PROG(bison, bison, false)
|
||||||
NEED_PROG(perl, perl)
|
|
||||||
NEED_PROG(sed, sed)
|
NEED_PROG(sed, sed)
|
||||||
NEED_PROG(tar, tar)
|
NEED_PROG(tar, tar)
|
||||||
NEED_PROG(bzip2, bzip2)
|
NEED_PROG(bzip2, bzip2)
|
||||||
|
@ -131,23 +130,6 @@ AC_PATH_PROG(dot, dot)
|
||||||
AC_PATH_PROG(pv, pv, pv)
|
AC_PATH_PROG(pv, pv, pv)
|
||||||
|
|
||||||
|
|
||||||
# Test that Perl has the open/fork feature (Perl 5.8.0 and beyond).
|
|
||||||
AC_MSG_CHECKING([whether Perl is recent enough])
|
|
||||||
if ! $perl -e 'open(FOO, "-|", "true"); while (<FOO>) { print; }; close FOO or die;'; then
|
|
||||||
AC_MSG_RESULT(no)
|
|
||||||
AC_MSG_ERROR([Your Perl version is too old. Nix requires Perl 5.8.0 or newer.])
|
|
||||||
fi
|
|
||||||
AC_MSG_RESULT(yes)
|
|
||||||
|
|
||||||
|
|
||||||
# Figure out where to install Perl modules.
|
|
||||||
AC_MSG_CHECKING([for the Perl installation prefix])
|
|
||||||
perlversion=$($perl -e 'use Config; print $Config{version};')
|
|
||||||
perlarchname=$($perl -e 'use Config; print $Config{archname};')
|
|
||||||
AC_SUBST(perllibdir, [${libdir}/perl5/site_perl/$perlversion/$perlarchname])
|
|
||||||
AC_MSG_RESULT($perllibdir)
|
|
||||||
|
|
||||||
|
|
||||||
NEED_PROG(cat, cat)
|
NEED_PROG(cat, cat)
|
||||||
NEED_PROG(tr, tr)
|
NEED_PROG(tr, tr)
|
||||||
AC_ARG_WITH(coreutils-bin, AC_HELP_STRING([--with-coreutils-bin=PATH],
|
AC_ARG_WITH(coreutils-bin, AC_HELP_STRING([--with-coreutils-bin=PATH],
|
||||||
|
@ -213,40 +195,6 @@ if test "$gc" = yes; then
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
|
||||||
# Check for the required Perl dependencies (DBI, DBD::SQLite).
|
|
||||||
perlFlags="-I$perllibdir"
|
|
||||||
|
|
||||||
AC_ARG_WITH(dbi, AC_HELP_STRING([--with-dbi=PATH],
|
|
||||||
[prefix of the Perl DBI library]),
|
|
||||||
perlFlags="$perlFlags -I$withval")
|
|
||||||
|
|
||||||
AC_ARG_WITH(dbd-sqlite, AC_HELP_STRING([--with-dbd-sqlite=PATH],
|
|
||||||
[prefix of the Perl DBD::SQLite library]),
|
|
||||||
perlFlags="$perlFlags -I$withval")
|
|
||||||
|
|
||||||
AC_MSG_CHECKING([whether DBD::SQLite works])
|
|
||||||
if ! $perl $perlFlags -e 'use DBI; use DBD::SQLite;' 2>&5; then
|
|
||||||
AC_MSG_RESULT(no)
|
|
||||||
AC_MSG_FAILURE([The Perl modules DBI and/or DBD::SQLite are missing.])
|
|
||||||
fi
|
|
||||||
AC_MSG_RESULT(yes)
|
|
||||||
|
|
||||||
AC_SUBST(perlFlags)
|
|
||||||
|
|
||||||
|
|
||||||
# Whether to build the Perl bindings
|
|
||||||
AC_MSG_CHECKING([whether to build the Perl bindings])
|
|
||||||
AC_ARG_ENABLE(perl-bindings, AC_HELP_STRING([--enable-perl-bindings],
|
|
||||||
[whether to build the Perl bindings (recommended) [default=yes]]),
|
|
||||||
perlbindings=$enableval, perlbindings=yes)
|
|
||||||
if test "$enable_shared" = no; then
|
|
||||||
# Perl bindings require shared libraries.
|
|
||||||
perlbindings=no
|
|
||||||
fi
|
|
||||||
AC_SUBST(perlbindings)
|
|
||||||
AC_MSG_RESULT($perlbindings)
|
|
||||||
|
|
||||||
|
|
||||||
AC_ARG_ENABLE(init-state, AC_HELP_STRING([--disable-init-state],
|
AC_ARG_ENABLE(init-state, AC_HELP_STRING([--disable-init-state],
|
||||||
[do not initialise DB etc. in `make install']),
|
[do not initialise DB etc. in `make install']),
|
||||||
init_state=$enableval, init_state=yes)
|
init_state=$enableval, init_state=yes)
|
||||||
|
|
|
@ -42,7 +42,7 @@ purposes. It uses <command>ssh</command> and
|
||||||
<command>nix-copy-closure</command> to copy the build inputs and
|
<command>nix-copy-closure</command> to copy the build inputs and
|
||||||
outputs and perform the remote build. To use it, you should set
|
outputs and perform the remote build. To use it, you should set
|
||||||
<envar>NIX_BUILD_HOOK</envar> to
|
<envar>NIX_BUILD_HOOK</envar> to
|
||||||
<filename><replaceable>prefix</replaceable>/libexec/nix/build-remote.pl</filename>.
|
<filename><replaceable>prefix</replaceable>/libexec/nix/build-remote</filename>.
|
||||||
You should also define a list of available build machines and point
|
You should also define a list of available build machines and point
|
||||||
the environment variable <envar>NIX_REMOTE_SYSTEMS</envar> to
|
the environment variable <envar>NIX_REMOTE_SYSTEMS</envar> to
|
||||||
it. <envar>NIX_REMOTE_SYSTEMS</envar> must be an absolute path. An
|
it. <envar>NIX_REMOTE_SYSTEMS</envar> must be an absolute path. An
|
||||||
|
@ -68,7 +68,7 @@ bits of information:
|
||||||
should not have a passphrase!</para></listitem>
|
should not have a passphrase!</para></listitem>
|
||||||
|
|
||||||
<listitem><para>The maximum number of builds that
|
<listitem><para>The maximum number of builds that
|
||||||
<filename>build-remote.pl</filename> will execute in parallel on the
|
<filename>build-remote</filename> will execute in parallel on the
|
||||||
machine. Typically this should be equal to the number of CPU cores.
|
machine. Typically this should be equal to the number of CPU cores.
|
||||||
For instance, the machine <literal>itchy</literal> in the example
|
For instance, the machine <literal>itchy</literal> in the example
|
||||||
will execute up to 8 builds in parallel.</para></listitem>
|
will execute up to 8 builds in parallel.</para></listitem>
|
||||||
|
@ -80,7 +80,7 @@ bits of information:
|
||||||
<listitem><para>A comma-separated list of <emphasis>supported
|
<listitem><para>A comma-separated list of <emphasis>supported
|
||||||
features</emphasis>. If a derivation has the
|
features</emphasis>. If a derivation has the
|
||||||
<varname>requiredSystemFeatures</varname> attribute, then
|
<varname>requiredSystemFeatures</varname> attribute, then
|
||||||
<filename>build-remote.pl</filename> will only perform the
|
<filename>build-remote</filename> will only perform the
|
||||||
derivation on a machine that has the specified features. For
|
derivation on a machine that has the specified features. For
|
||||||
instance, the attribute
|
instance, the attribute
|
||||||
|
|
||||||
|
@ -106,11 +106,11 @@ requiredSystemFeatures = [ "kvm" ];
|
||||||
You should also set up the environment variable
|
You should also set up the environment variable
|
||||||
<envar>NIX_CURRENT_LOAD</envar> to point at a directory (e.g.,
|
<envar>NIX_CURRENT_LOAD</envar> to point at a directory (e.g.,
|
||||||
<filename>/var/run/nix/current-load</filename>) that
|
<filename>/var/run/nix/current-load</filename>) that
|
||||||
<filename>build-remote.pl</filename> uses to remember how many builds
|
<filename>build-remote</filename> uses to remember how many builds
|
||||||
it is currently executing remotely. It doesn't look at the actual
|
it is currently executing remotely. It doesn't look at the actual
|
||||||
load on the remote machine, so if you have multiple instances of Nix
|
load on the remote machine, so if you have multiple instances of Nix
|
||||||
running, they should use the same <envar>NIX_CURRENT_LOAD</envar>
|
running, they should use the same <envar>NIX_CURRENT_LOAD</envar>
|
||||||
file. Maybe in the future <filename>build-remote.pl</filename> will
|
file. Maybe in the future <filename>build-remote</filename> will
|
||||||
look at the actual remote load.</para>
|
look at the actual remote load.</para>
|
||||||
|
|
||||||
</chapter>
|
</chapter>
|
||||||
|
|
22
release.nix
22
release.nix
|
@ -24,18 +24,14 @@ let
|
||||||
inherit officialRelease;
|
inherit officialRelease;
|
||||||
|
|
||||||
buildInputs =
|
buildInputs =
|
||||||
[ curl bison flex perl libxml2 libxslt bzip2 xz
|
[ curl bison flex libxml2 libxslt bzip2 xz
|
||||||
pkgconfig sqlite libsodium boehmgc
|
pkgconfig sqlite libsodium boehmgc
|
||||||
docbook5 docbook5_xsl
|
docbook5 docbook5_xsl
|
||||||
autoconf-archive
|
autoconf-archive
|
||||||
git
|
git
|
||||||
];
|
];
|
||||||
|
|
||||||
configureFlags = ''
|
configureFlags = "--enable-gc";
|
||||||
--with-dbi=${perlPackages.DBI}/${perl.libPrefix}
|
|
||||||
--with-dbd-sqlite=${perlPackages.DBDSQLite}/${perl.libPrefix}
|
|
||||||
--enable-gc
|
|
||||||
'';
|
|
||||||
|
|
||||||
postUnpack = ''
|
postUnpack = ''
|
||||||
# Clean up when building from a working tree.
|
# Clean up when building from a working tree.
|
||||||
|
@ -73,7 +69,7 @@ let
|
||||||
src = tarball;
|
src = tarball;
|
||||||
|
|
||||||
buildInputs =
|
buildInputs =
|
||||||
[ curl perl bzip2 xz openssl pkgconfig sqlite boehmgc ]
|
[ curl bzip2 xz openssl pkgconfig sqlite boehmgc ]
|
||||||
++ lib.optional stdenv.isLinux libsodium
|
++ lib.optional stdenv.isLinux libsodium
|
||||||
++ lib.optional stdenv.isLinux
|
++ lib.optional stdenv.isLinux
|
||||||
(aws-sdk-cpp.override {
|
(aws-sdk-cpp.override {
|
||||||
|
@ -83,8 +79,6 @@ let
|
||||||
|
|
||||||
configureFlags = ''
|
configureFlags = ''
|
||||||
--disable-init-state
|
--disable-init-state
|
||||||
--with-dbi=${perlPackages.DBI}/${perl.libPrefix}
|
|
||||||
--with-dbd-sqlite=${perlPackages.DBDSQLite}/${perl.libPrefix}
|
|
||||||
--enable-gc
|
--enable-gc
|
||||||
--sysconfdir=/etc
|
--sysconfdir=/etc
|
||||||
'';
|
'';
|
||||||
|
@ -147,15 +141,13 @@ let
|
||||||
src = tarball;
|
src = tarball;
|
||||||
|
|
||||||
buildInputs =
|
buildInputs =
|
||||||
[ curl perl bzip2 openssl pkgconfig sqlite xz libsodium
|
[ curl bzip2 openssl pkgconfig sqlite xz libsodium
|
||||||
# These are for "make check" only:
|
# These are for "make check" only:
|
||||||
graphviz libxml2 libxslt
|
graphviz libxml2 libxslt
|
||||||
];
|
];
|
||||||
|
|
||||||
configureFlags = ''
|
configureFlags = ''
|
||||||
--disable-init-state
|
--disable-init-state
|
||||||
--with-dbi=${perlPackages.DBI}/${perl.libPrefix}
|
|
||||||
--with-dbd-sqlite=${perlPackages.DBDSQLite}/${perl.libPrefix}
|
|
||||||
'';
|
'';
|
||||||
|
|
||||||
dontInstall = false;
|
dontInstall = false;
|
||||||
|
@ -282,7 +274,7 @@ let
|
||||||
src = jobs.tarball;
|
src = jobs.tarball;
|
||||||
diskImage = (diskImageFun vmTools.diskImageFuns)
|
diskImage = (diskImageFun vmTools.diskImageFuns)
|
||||||
{ extraPackages =
|
{ extraPackages =
|
||||||
[ "perl-DBD-SQLite" "perl-devel" "sqlite" "sqlite-devel" "bzip2-devel" "emacs" "libcurl-devel" "openssl-devel" "xz-devel" ]
|
[ "sqlite" "sqlite-devel" "bzip2-devel" "emacs" "libcurl-devel" "openssl-devel" "xz-devel" ]
|
||||||
++ extraPackages; };
|
++ extraPackages; };
|
||||||
memSize = 1024;
|
memSize = 1024;
|
||||||
meta.schedulingPriority = 50;
|
meta.schedulingPriority = 50;
|
||||||
|
@ -303,14 +295,14 @@ let
|
||||||
src = jobs.tarball;
|
src = jobs.tarball;
|
||||||
diskImage = (diskImageFun vmTools.diskImageFuns)
|
diskImage = (diskImageFun vmTools.diskImageFuns)
|
||||||
{ extraPackages =
|
{ extraPackages =
|
||||||
[ "libdbd-sqlite3-perl" "libsqlite3-dev" "libbz2-dev" "libwww-curl-perl" "libcurl-dev" "libcurl3-nss" "libssl-dev" "liblzma-dev" ]
|
[ "libsqlite3-dev" "libbz2-dev" "libcurl-dev" "libcurl3-nss" "libssl-dev" "liblzma-dev" ]
|
||||||
++ extraPackages; };
|
++ extraPackages; };
|
||||||
memSize = 1024;
|
memSize = 1024;
|
||||||
meta.schedulingPriority = 50;
|
meta.schedulingPriority = 50;
|
||||||
postInstall = "make installcheck";
|
postInstall = "make installcheck";
|
||||||
configureFlags = "--sysconfdir=/etc";
|
configureFlags = "--sysconfdir=/etc";
|
||||||
debRequires =
|
debRequires =
|
||||||
[ "curl" "libdbd-sqlite3-perl" "libsqlite3-0" "libbz2-1.0" "bzip2" "xz-utils" "libwww-curl-perl" "libssl1.0.0" "liblzma5" ]
|
[ "curl" "libsqlite3-0" "libbz2-1.0" "bzip2" "xz-utils" "libssl1.0.0" "liblzma5" ]
|
||||||
++ extraDebPackages;
|
++ extraDebPackages;
|
||||||
debMaintainer = "Eelco Dolstra <eelco.dolstra@logicblox.com>";
|
debMaintainer = "Eelco Dolstra <eelco.dolstra@logicblox.com>";
|
||||||
doInstallCheck = true;
|
doInstallCheck = true;
|
||||||
|
|
|
@ -926,7 +926,7 @@ static void opServe(Strings opFlags, Strings opArgs)
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
case cmdBuildPaths: { /* Used by build-remote.pl. */
|
case cmdBuildPaths: {
|
||||||
|
|
||||||
if (!writeAllowed) throw Error("building paths is not allowed");
|
if (!writeAllowed) throw Error("building paths is not allowed");
|
||||||
PathSet paths = readStorePaths<PathSet>(*store, in);
|
PathSet paths = readStorePaths<PathSet>(*store, in);
|
||||||
|
|
|
@ -5,14 +5,14 @@ clearStore
|
||||||
outPath1=$(echo 'with import ./config.nix; mkDerivation { name = "foo1"; builder = builtins.toFile "builder" "mkdir $out; echo hello > $out/foo"; }' | nix-build - --no-out-link --option auto-optimise-store true)
|
outPath1=$(echo 'with import ./config.nix; mkDerivation { name = "foo1"; builder = builtins.toFile "builder" "mkdir $out; echo hello > $out/foo"; }' | nix-build - --no-out-link --option auto-optimise-store true)
|
||||||
outPath2=$(echo 'with import ./config.nix; mkDerivation { name = "foo2"; builder = builtins.toFile "builder" "mkdir $out; echo hello > $out/foo"; }' | nix-build - --no-out-link --option auto-optimise-store true)
|
outPath2=$(echo 'with import ./config.nix; mkDerivation { name = "foo2"; builder = builtins.toFile "builder" "mkdir $out; echo hello > $out/foo"; }' | nix-build - --no-out-link --option auto-optimise-store true)
|
||||||
|
|
||||||
inode1="$(perl -e "print ((lstat('$outPath1/foo'))[1])")"
|
inode1="$(stat --format=%i $outPath1/foo)"
|
||||||
inode2="$(perl -e "print ((lstat('$outPath2/foo'))[1])")"
|
inode2="$(stat --format=%i $outPath2/foo)"
|
||||||
if [ "$inode1" != "$inode2" ]; then
|
if [ "$inode1" != "$inode2" ]; then
|
||||||
echo "inodes do not match"
|
echo "inodes do not match"
|
||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
|
|
||||||
nlink="$(perl -e "print ((lstat('$outPath1/foo'))[3])")"
|
nlink="$(stat --format=%h $outPath1/foo)"
|
||||||
if [ "$nlink" != 3 ]; then
|
if [ "$nlink" != 3 ]; then
|
||||||
echo "link count incorrect"
|
echo "link count incorrect"
|
||||||
exit 1
|
exit 1
|
||||||
|
@ -20,7 +20,7 @@ fi
|
||||||
|
|
||||||
outPath3=$(echo 'with import ./config.nix; mkDerivation { name = "foo3"; builder = builtins.toFile "builder" "mkdir $out; echo hello > $out/foo"; }' | nix-build - --no-out-link)
|
outPath3=$(echo 'with import ./config.nix; mkDerivation { name = "foo3"; builder = builtins.toFile "builder" "mkdir $out; echo hello > $out/foo"; }' | nix-build - --no-out-link)
|
||||||
|
|
||||||
inode3="$(perl -e "print ((lstat('$outPath3/foo'))[1])")"
|
inode3="$(stat --format=%i $outPath3/foo)"
|
||||||
if [ "$inode1" = "$inode3" ]; then
|
if [ "$inode1" = "$inode3" ]; then
|
||||||
echo "inodes match unexpectedly"
|
echo "inodes match unexpectedly"
|
||||||
exit 1
|
exit 1
|
||||||
|
@ -28,8 +28,8 @@ fi
|
||||||
|
|
||||||
nix-store --optimise
|
nix-store --optimise
|
||||||
|
|
||||||
inode1="$(perl -e "print ((lstat('$outPath1/foo'))[1])")"
|
inode1="$(stat --format=%i $outPath1/foo)"
|
||||||
inode3="$(perl -e "print ((lstat('$outPath3/foo'))[1])")"
|
inode3="$(stat --format=%i $outPath3/foo)"
|
||||||
if [ "$inode1" != "$inode3" ]; then
|
if [ "$inode1" != "$inode3" ]; then
|
||||||
echo "inodes do not match"
|
echo "inodes do not match"
|
||||||
exit 1
|
exit 1
|
||||||
|
|
Loading…
Reference in a new issue