summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorLudovic Courtès <ludo@gnu.org>2017-04-21 22:43:28 +0200
committerLudovic Courtès <ludo@gnu.org>2017-04-21 22:45:29 +0200
commit9231ef12f2a595b8f1e677dbe50cc499555302b6 (patch)
tree0b43e1e56e5e196c5d7592f67affb719e02fe451 /tests
parent0a3bed8819551c94fd715828f0522f55af836ea0 (diff)
derivations: Restore UTF-8 encoding of build scripts.
Reported by Mark H Weaver <mhw@netris.org> at <https://lists.gnu.org/archive/html/guix-devel/2017-04/msg00457.html>. * guix/derivations.scm (build-expression->derivation): Use a string output port for the expression. This reverts part of 2dce88d5bbe7a65e101c0734d1c6db44ecc8c299. * tests/derivations.scm ("build-expression->derivation and builder encoding"): New test.
Diffstat (limited to 'tests')
-rw-r--r--tests/derivations.scm13
1 files changed, 13 insertions, 0 deletions
diff --git a/tests/derivations.scm b/tests/derivations.scm
index 75c8d1dfb1..626e4d20e2 100644
--- a/tests/derivations.scm
+++ b/tests/derivations.scm
@@ -701,6 +701,19 @@
#:modules '((guix module that
does not exist)))))
+(test-equal "build-expression->derivation and builder encoding"
+ '("UTF-8" #t)
+ (let* ((exp '(λ (α) (+ α 1)))
+ (drv (build-expression->derivation %store "foo" exp)))
+ (match (derivation-builder-arguments drv)
+ ((... builder)
+ (call-with-input-file builder
+ (lambda (port)
+ (list (port-encoding port)
+ (->bool
+ (string-contains (get-string-all port)
+ "(λ (α) (+ α 1))")))))))))
+
(test-assert "build-expression->derivation and derivation-prerequisites"
(let ((drv (build-expression->derivation %store "fail" #f)))
(any (match-lambda