Make the location of the build directory in the sandbox configurable

This is mostly for use in the sandbox tests, since if the Nix store is
under /build, then we can't use /build as the build directory.
This commit is contained in:
Eelco Dolstra 2017-05-05 17:45:22 +02:00
parent 465cb68244
commit bb50c89319
No known key found for this signature in database
GPG key ID: 8170B4726D7198DE
4 changed files with 12 additions and 8 deletions

View file

@ -12,9 +12,13 @@ rm -rf $TEST_ROOT/store0 $TEST_ROOT/store1
# FIXME: --option is not passed to build-remote, so have to create a config file.
export NIX_CONF_DIR=$TEST_ROOT/etc2
mkdir -p $NIX_CONF_DIR
echo "build-sandbox-paths = /nix/store" > $NIX_CONF_DIR/nix.conf
echo "
build-sandbox-paths = /nix/store
sandbox-build-dir = /build-tmp
" > $NIX_CONF_DIR/nix.conf
outPath=$(nix-build build-hook.nix --no-out-link -j0 --option builders "local?root=$TEST_ROOT/store0; local?root=$TEST_ROOT/store1 - - 1 1 foo" --option build-sandbox-paths /nix/store)
outPath=$(nix-build build-hook.nix --no-out-link -j0 \
--option builders "local?root=$TEST_ROOT/store0; local?root=$TEST_ROOT/store1 - - 1 1 foo")
cat $outPath/foobar | grep FOOBAR