summaryrefslogtreecommitdiff
path: root/guix
diff options
context:
space:
mode:
authorLudovic Courtès <ludo@gnu.org>2015-02-23 23:52:28 +0100
committerLudovic Courtès <ludo@gnu.org>2015-02-24 00:01:34 +0100
commitb69c5c2ced1e41fdb5c2e747b1fb3a338ca63768 (patch)
treeeafabb8dcb62eb56ea00e2a46f7fb42109c9f69d /guix
parent12d720fd1a9c43019f2d5afa051b45c7633b3ab0 (diff)
downloadgnu-guix-b69c5c2ced1e41fdb5c2e747b1fb3a338ca63768.tar
gnu-guix-b69c5c2ced1e41fdb5c2e747b1fb3a338ca63768.tar.gz
tests: Skip tests that would fail due to the shebang length.
Reported by Daniel Kochmański <dkochmanski@hellsgate.pl>. Fixes <http://bugs.gnu.org/19888>. * guix/tests.scm (shebang-too-long?): New procedure. * tests/builders.scm ("gnu-build"): Conditionalize on not (shebang-too-long?). * tests/packages.scm ("GNU Make, bootstrap"): Likewise. * tests/guix-package.sh (shebang_not_too_long): New function. Use it to determine whether to build 'gnu-make-boot0'.
Diffstat (limited to 'guix')
-rw-r--r--guix/tests.scm12
1 files changed, 12 insertions, 0 deletions
diff --git a/guix/tests.scm b/guix/tests.scm
index d004a50a36..0896e842da 100644
--- a/guix/tests.scm
+++ b/guix/tests.scm
@@ -32,6 +32,7 @@
random-text
random-bytevector
network-reachable?
+ shebang-too-long?
mock
%substitute-directory
with-derivation-narinfo
@@ -185,6 +186,17 @@ CONTENTS."
(delete-file (string-append dir "/example.out"))
(delete-file (string-append dir "/example.nar")))))
+(define (shebang-too-long?)
+ "Return true if the typical shebang in the current store would exceed
+Linux's static limit---the BINPRM_BUF_SIZE constant, normally 128 characters
+all included."
+ (define shebang
+ (string-append "#!" (%store-prefix) "/"
+ (make-string 32 #\a)
+ "-bootstrap-binaries-0/bin/bash\0"))
+
+ (> (string-length shebang) 128))
+
(define-syntax with-derivation-substitute
(syntax-rules (sha256 =>)
"Evaluate BODY in a context where DRV is substitutable with the given