1
0
mirror of https://git.savannah.gnu.org/git/guix.git synced 2026-05-23 09:35:56 +02:00

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
2dce88d5bb.
* tests/derivations.scm ("build-expression->derivation and builder
encoding"): New test.
This commit is contained in:
Ludovic Courtès
2017-04-21 22:43:28 +02:00
parent 0a3bed8819
commit 9231ef12f2
2 changed files with 17 additions and 6 deletions
+13
View File
@@ -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