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:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user