summary refs log tree commit diff
path: root/guix/tests.scm
diff options
context:
space:
mode:
Diffstat (limited to 'guix/tests.scm')
-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