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.
This commit is contained in:
Ludovic Courtès 2013-06-14 15:48:29 +02:00
parent 62751a5ddd
commit 0bd31a2188

View file

@ -469,8 +469,9 @@ (define derivation-hash ; `hashDerivationModulo' in derivations.cc
(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."