From 0bd31a2188b6ee29b6280f58a577799d73a07ecf Mon Sep 17 00:00:00 2001 From: Ludovic Courtès Date: Fri, 14 Jun 2013 15:48:29 +0200 Subject: derivations: Micro-optimize `derivation-hash'. * guix/derivations.scm (derivation-hash): Use a UTF-8-encoded string output port. This makes things deterministic, and slightly faster. --- guix/derivations.scm | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/guix/derivations.scm b/guix/derivations.scm index cf329819c4..3c433a2685 100644 --- a/guix/derivations.scm +++ b/guix/derivations.scm @@ -469,8 +469,9 @@ in SIZE bytes." (drv (make-derivation outputs inputs sources system builder args env-vars))) (sha256 - (string->utf8 (call-with-output-string - (cut write-derivation drv <>)))))))))) + (with-fluids ((%default-port-encoding "UTF-8")) + (string->utf8 (call-with-output-string + (cut write-derivation drv <>))))))))))) (define (store-path type hash name) ; makeStorePath "Return the store path for NAME/HASH/TYPE." -- cgit v1.2.3