guix-commits
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

03/03: build: 'make check' errors out if file name limits would be hit.


From: Ludovic Courtès
Subject: 03/03: build: 'make check' errors out if file name limits would be hit.
Date: Tue, 12 Jan 2016 16:48:40 +0000

civodul pushed a commit to branch master
in repository guix.

commit bb251307642242bb9174e9c4d89909ca40926d67
Author: Ludovic Courtès <address@hidden>
Date:   Tue Jan 12 16:37:45 2016 +0100

    build: 'make check' errors out if file name limits would be hit.
    
    * Makefile.am (SCM_TESTS, SH_TESTS, TESTS, AM_TESTS_ENVIRONMENT)
    (SCM_LOG_COMPILER, SH_LOG_COMPILER, AM_SCM_LOG_FLAGS)
    (AM_SH_LOG_FLAGS): Move within 'if CAN_RUN_TESTS'.
    (check-local) [!CAN_RUN_TESTS]: New target.
    * daemon.am (AM_TESTS_ENVIRONMENT, TESTS): Ditto.
    * m4/guix.m4 (GUIX_CHECK_FILE_NAME_LIMITS): Add parameter and set it.
---
 Makefile.am  |   45 ++++++++++++++++++++++++++++++++++-----------
 configure.ac |    3 ++-
 daemon.am    |    6 +++++-
 m4/guix.m4   |    7 ++++++-
 4 files changed, 47 insertions(+), 14 deletions(-)

diff --git a/Makefile.am b/Makefile.am
index 760caed..6e9deeb 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -1,5 +1,5 @@
 # GNU Guix --- Functional package management for GNU
-# Copyright © 2012, 2013, 2014, 2015 Ludovic Courtès <address@hidden>
+# Copyright © 2012, 2013, 2014, 2015, 2016 Ludovic Courtès <address@hidden>
 # Copyright © 2013 Andreas Enge <address@hidden>
 # Copyright © 2015 Alex Kost <address@hidden>
 #
@@ -135,6 +135,18 @@ MODULES =                                  \
   guix.scm                                     \
   $(GNU_SYSTEM_MODULES)
 
+if HAVE_GUILE_JSON
+
+MODULES +=                                     \
+  guix/import/json.scm                         \
+  guix/import/pypi.scm                         \
+  guix/scripts/import/pypi.scm                 \
+  guix/import/cpan.scm                         \
+  guix/scripts/import/gem.scm                  \
+  guix/import/gem.scm
+
+endif
+
 if BUILD_SYSCALLS_MODULE
 
 MODULES +=                                     \
@@ -191,6 +203,11 @@ clean-go:
        -$(RM) -f $(GOBJECTS)
 
 
+# Test extensions; has to be unconditional.
+TEST_EXTENSIONS = .scm .sh
+
+if CAN_RUN_TESTS
+
 SCM_TESTS =                                    \
   tests/base32.scm                             \
   tests/base64.scm                             \
@@ -233,14 +250,6 @@ SCM_TESTS =                                        \
 
 if HAVE_GUILE_JSON
 
-MODULES +=                                     \
-  guix/import/json.scm                         \
-  guix/import/pypi.scm                         \
-  guix/scripts/import/pypi.scm                 \
-  guix/import/cpan.scm                         \
-  guix/scripts/import/gem.scm                  \
-  guix/import/gem.scm
-
 SCM_TESTS +=                                   \
   tests/pypi.scm                               \
   tests/cpan.scm                               \
@@ -272,8 +281,6 @@ endif BUILD_DAEMON
 
 TESTS = $(SCM_TESTS) $(SH_TESTS)
 
-TEST_EXTENSIONS = .scm .sh
-
 AM_TESTS_ENVIRONMENT = abs_top_srcdir="$(abs_top_srcdir)"
 
 SCM_LOG_COMPILER = $(top_builddir)/test-env $(GUILE)
@@ -289,6 +296,22 @@ tests/guix-gc.log:                                         
        \
   $(patsubst %.sh,%.log,$(filter-out tests/guix-gc.sh,$(SH_TESTS)))    \
   $(SCM_TESTS:%.scm=%.log)
 
+else !CAN_RUN_TESTS
+
+TESTS =
+SH_TESTS =
+SCM_TESTS =
+
+# Automake always generates a 'check' target, so better not override it.
+check-local:
+       @echo
+       @echo "Cannot run tests because file name limits would be exceeded." >&2
+       @echo "Look for 'length' in the 'config.log' file for details." >&2
+       @echo
+       @exit 1
+
+endif !CAN_RUN_TESTS
+
 # Public key used to sign substitutes from hydra.gnu.org.
 dist_pkgdata_DATA = hydra.gnu.org.pub
 
diff --git a/configure.ac b/configure.ac
index 0d06592..f61c04c 100644
--- a/configure.ac
+++ b/configure.ac
@@ -60,7 +60,8 @@ AC_SUBST([guix_localstatedir])
 AC_SUBST([guix_sysconfdir])
 AC_SUBST([guix_sbindir])
 
-GUIX_CHECK_FILE_NAME_LIMITS
+GUIX_CHECK_FILE_NAME_LIMITS([can_run_tests])
+AM_CONDITIONAL([CAN_RUN_TESTS], [test "x$can_run_tests" = "xyes"])
 
 dnl We require pkg.m4 (from pkg-config) and guile.m4 (from Guile.)
 dnl Make sure they are available.
diff --git a/daemon.am b/daemon.am
index 3241643..ba4be50 100644
--- a/daemon.am
+++ b/daemon.am
@@ -1,5 +1,5 @@
 # GNU Guix --- Functional package management for GNU
-# Copyright © 2012, 2013, 2014, 2015 Ludovic Courtès <address@hidden>
+# Copyright © 2012, 2013, 2014, 2015, 2016 Ludovic Courtès <address@hidden>
 #
 # This file is part of GNU Guix.
 #
@@ -208,12 +208,16 @@ EXTRA_DIST +=                                     \
   etc/guix-daemon.service.in   \
   etc/guix-daemon.conf.in
 
+if CAN_RUN_TESTS
+
 AM_TESTS_ENVIRONMENT +=                                \
   top_builddir="$(abs_top_builddir)"
 
 TESTS +=                                       \
   tests/guix-daemon.sh
 
+endif CAN_RUN_TESTS
+
 clean-local:
        -if test -d "$(GUIX_TEST_ROOT)"; then           \
          find "$(GUIX_TEST_ROOT)" | xargs chmod +w;    \
diff --git a/m4/guix.m4 b/m4/guix.m4
index 96319b2..563ce51 100644
--- a/m4/guix.m4
+++ b/m4/guix.m4
@@ -215,7 +215,8 @@ AC_DEFUN([GUIX_TEST_HASH_BANG_LENGTH], [
 dnl GUIX_CHECK_FILE_NAME_LIMITS
 dnl
 dnl GNU/Linux has a couple of silly limits that we can easily run into.
-dnl Make sure everything is fine with the current settings.
+dnl Make sure everything is fine with the current settings.  Set $1 to
+dnl 'yes' if tests can run, 'no' otherwise.
 AC_DEFUN([GUIX_CHECK_FILE_NAME_LIMITS], [
   AC_REQUIRE([GUIX_SOCKET_FILE_NAME_LENGTH])
   AC_REQUIRE([GUIX_TEST_SOCKET_FILE_NAME_LENGTH])
@@ -228,10 +229,14 @@ AC_DEFUN([GUIX_CHECK_FILE_NAME_LIMITS], [
   if test "$ac_cv_guix_test_socket_file_name_length" -ge 
]SOCKET_FILE_NAME_LIMIT[; then
     AC_MSG_WARN([socket file name limit may be exceeded when running tests])
   fi
+
+  $1=yes
   if test "$ac_cv_guix_hash_bang_length" -ge ]LINUX_HASH_BANG_LIMIT[; then
+    $1=no
     AC_MSG_ERROR([store directory '$storedir' would lead to overly long 
hash-bang lines])
   fi
   if test "$ac_cv_guix_test_hash_bang_length" -ge ]LINUX_HASH_BANG_LIMIT[; then
+    $1=no
     AC_MSG_WARN([test directory '$ac_cv_guix_test_root' may lead to overly 
long hash-bang lines])
   fi
 ])



reply via email to

[Prev in Thread] Current Thread [Next in Thread]