From 8ad49499b98b53ac105acd6fe58225b37e60e40b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ludovic=20Court=C3=A8s?= Date: Sat, 5 Jul 2014 19:07:38 +0200 Subject: [PATCH] build: Support running the test suite from a directory with symlinks. Fixes . Reported by Alex Kost . * test-env.in: Canonicalize $NIX_STORE_DIR, and remove $NIX_IGNORE_SYMLINK_STORE setting. * tests/guix-register.sh: Likewise, canonicalize $new_store_dir and $new_store and leave $NIX_IGNORE_SYMLINK_STORE unchanged. --- test-env.in | 12 ++++++++---- tests/guix-register.sh | 5 ++--- 2 files changed, 10 insertions(+), 7 deletions(-) diff --git a/test-env.in b/test-env.in index a3b3536145..9d0c8cc414 100644 --- a/test-env.in +++ b/test-env.in @@ -27,8 +27,15 @@ if [ -x "@abs_top_builddir@/guix-daemon" ] then NIX_SETUID_HELPER="@abs_top_builddir@/nix-setuid-helper" # normally unused - NIX_IGNORE_SYMLINK_STORE=1 # in case the store is a symlink NIX_STORE_DIR="@GUIX_TEST_ROOT@/store" + + # Do that because store.scm calls `canonicalize-path' on it. + mkdir -p "$NIX_STORE_DIR" + + # Canonicalize the store directory name in an attempt to avoid symlinks in + # it or its parent directories. See . + NIX_STORE_DIR="`cd "@GUIX_TEST_ROOT@/store"; pwd -P`" + NIX_LOCALSTATE_DIR="@GUIX_TEST_ROOT@/var" NIX_LOG_DIR="@GUIX_TEST_ROOT@/var/log/guix" NIX_DB_DIR="@GUIX_TEST_ROOT@/db" @@ -71,9 +78,6 @@ then GUIX_ALLOW_UNAUTHENTICATED_SUBSTITUTES \ NIX_CONF_DIR XDG_CACHE_HOME - # Do that because store.scm calls `canonicalize-path' on it. - mkdir -p "$NIX_STORE_DIR" - # Launch the daemon without chroot support because is may be # unavailable, for instance if we're not running as root. "@abs_top_builddir@/pre-inst-env" \ diff --git a/tests/guix-register.sh b/tests/guix-register.sh index 019a451b3b..28b799b5c1 100644 --- a/tests/guix-register.sh +++ b/tests/guix-register.sh @@ -57,8 +57,8 @@ guile -c " # mkdir -p "$new_store/$storedir" -new_store_dir="`cd "$new_store/$storedir" ; pwd`" -new_store="`cd "$new_store" ; pwd`" +new_store_dir="`cd "$new_store/$storedir" ; pwd -P`" +new_store="`cd "$new_store" ; pwd -P`" to_copy="`guix build guile-bootstrap`" cp -r "$to_copy" "$new_store_dir" @@ -81,7 +81,6 @@ guix-register --prefix "$new_store" "$closure" # Now make sure this is recognized as valid. -NIX_IGNORE_SYMLINK_STORE=1 NIX_STORE_DIR="$new_store_dir" NIX_STATE_DIR="$new_store$localstatedir" NIX_LOG_DIR="$new_store$localstatedir/log/guix"