diff options
| author | Ludovic Courtès <ludo@gnu.org> | 2016-01-12 16:08:19 +0100 |
|---|---|---|
| committer | Ludovic Courtès <ludo@gnu.org> | 2016-01-12 17:47:36 +0100 |
| commit | 27ab3cee754d89135083b778a00675d9a2d00415 (patch) | |
| tree | 964ea9c0820959a7db0a27bde08671d076d2bc87 /m4 | |
| parent | d33fa0c71435396280aff94e7608c5c5be0e06a4 (diff) | |
build: Warn against long hash bang lines for tests.
* m4/guix.m4 (GUIX_TEST_HASH_BANG_LENGTH): New macro.
(GUIX_CHECK_FILE_NAME_LIMITS): Use it. Warn against long hash bang
lines in tests.
Diffstat (limited to 'm4')
| -rw-r--r-- | m4/guix.m4 | 14 |
1 files changed, 13 insertions, 1 deletions
diff --git a/m4/guix.m4 b/m4/guix.m4 index 1e5985b30bf..96319b2c148 100644 --- a/m4/guix.m4 +++ b/m4/guix.m4 | |||
| @@ -1,5 +1,5 @@ | |||
| 1 | dnl GNU Guix --- Functional package management for GNU | 1 | dnl GNU Guix --- Functional package management for GNU |
| 2 | dnl Copyright © 2012, 2013, 2014, 2015 Ludovic Courtès <ludo@gnu.org> | 2 | dnl Copyright © 2012, 2013, 2014, 2015, 2016 Ludovic Courtès <ludo@gnu.org> |
| 3 | dnl Copyright © 2014 Mark H Weaver <mhw@netris.org> | 3 | dnl Copyright © 2014 Mark H Weaver <mhw@netris.org> |
| 4 | dnl | 4 | dnl |
| 5 | dnl This file is part of GNU Guix. | 5 | dnl This file is part of GNU Guix. |
| @@ -204,6 +204,14 @@ AC_DEFUN([GUIX_HASH_BANG_LENGTH], [ | |||
| 204 | [ac_cv_guix_hash_bang_length=`echo -n "$storedir/aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa-bootstrap-binaries-0/bin/bash" | wc -c`]) | 204 | [ac_cv_guix_hash_bang_length=`echo -n "$storedir/aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa-bootstrap-binaries-0/bin/bash" | wc -c`]) |
| 205 | ]) | 205 | ]) |
| 206 | 206 | ||
| 207 | dnl GUIX_TEST_HASH_BANG_LENGTH | ||
| 208 | AC_DEFUN([GUIX_TEST_HASH_BANG_LENGTH], [ | ||
| 209 | AC_REQUIRE([GUIX_TEST_ROOT_DIRECTORY]) | ||
| 210 | AC_CACHE_CHECK([the length of a hash bang line used in tests], | ||
| 211 | [ac_cv_guix_test_hash_bang_length], | ||
| 212 | [ac_cv_guix_test_hash_bang_length=`echo -n "$ac_cv_guix_test_root/store/aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa-bootstrap-binaries-0/bin/bash" | wc -c`]) | ||
| 213 | ]) | ||
| 214 | |||
| 207 | dnl GUIX_CHECK_FILE_NAME_LIMITS | 215 | dnl GUIX_CHECK_FILE_NAME_LIMITS |
| 208 | dnl | 216 | dnl |
| 209 | dnl GNU/Linux has a couple of silly limits that we can easily run into. | 217 | dnl GNU/Linux has a couple of silly limits that we can easily run into. |
| @@ -212,6 +220,7 @@ AC_DEFUN([GUIX_CHECK_FILE_NAME_LIMITS], [ | |||
| 212 | AC_REQUIRE([GUIX_SOCKET_FILE_NAME_LENGTH]) | 220 | AC_REQUIRE([GUIX_SOCKET_FILE_NAME_LENGTH]) |
| 213 | AC_REQUIRE([GUIX_TEST_SOCKET_FILE_NAME_LENGTH]) | 221 | AC_REQUIRE([GUIX_TEST_SOCKET_FILE_NAME_LENGTH]) |
| 214 | AC_REQUIRE([GUIX_HASH_BANG_LENGTH]) | 222 | AC_REQUIRE([GUIX_HASH_BANG_LENGTH]) |
| 223 | AC_REQUIRE([GUIX_TEST_HASH_BANG_LENGTH]) | ||
| 215 | 224 | ||
| 216 | if test "$ac_cv_guix_socket_file_name_length" -ge ]SOCKET_FILE_NAME_LIMIT[; then | 225 | if test "$ac_cv_guix_socket_file_name_length" -ge ]SOCKET_FILE_NAME_LIMIT[; then |
| 217 | AC_MSG_ERROR([socket file name would exceed the maxium allowed length]) | 226 | AC_MSG_ERROR([socket file name would exceed the maxium allowed length]) |
| @@ -222,6 +231,9 @@ AC_DEFUN([GUIX_CHECK_FILE_NAME_LIMITS], [ | |||
| 222 | if test "$ac_cv_guix_hash_bang_length" -ge ]LINUX_HASH_BANG_LIMIT[; then | 231 | if test "$ac_cv_guix_hash_bang_length" -ge ]LINUX_HASH_BANG_LIMIT[; then |
| 223 | AC_MSG_ERROR([store directory '$storedir' would lead to overly long hash-bang lines]) | 232 | AC_MSG_ERROR([store directory '$storedir' would lead to overly long hash-bang lines]) |
| 224 | fi | 233 | fi |
| 234 | if test "$ac_cv_guix_test_hash_bang_length" -ge ]LINUX_HASH_BANG_LIMIT[; then | ||
| 235 | AC_MSG_WARN([test directory '$ac_cv_guix_test_root' may lead to overly long hash-bang lines]) | ||
| 236 | fi | ||
| 225 | ]) | 237 | ]) |
| 226 | 238 | ||
| 227 | dnl GUIX_CHECK_CXX11 | 239 | dnl GUIX_CHECK_CXX11 |
