~ruther/guix-local

c6e948592485fecfb1d290afb3a5bf4045bc6a9c — Ludovic Courtès 12 years ago a7e59c5
substitute-binary: Avoid reloading the ACL repeatedly.

* guix/scripts/substitute-binary.scm (guix-substitute-binary) <--query>:
  Cache the result of (current-acl); pass it to 'valid-narinfo?' calls.
  This saves 12% wall-clock time for "guix build emacs -n".
1 files changed, 3 insertions(+), 2 deletions(-)

M guix/scripts/substitute-binary.scm
M guix/scripts/substitute-binary.scm => guix/scripts/substitute-binary.scm +3 -2
@@ 630,9 630,10 @@ substituter disabled~%")
   (with-error-handling                           ; for signature errors
     (match args
       (("--query")
        (let ((cache (delay (open-cache %cache-url))))
        (let ((cache (delay (open-cache %cache-url)))
              (acl   (current-acl)))
          (define (valid? obj)
            (and (narinfo? obj) (valid-narinfo? obj)))
            (and (narinfo? obj) (valid-narinfo? obj acl)))

          (let loop ((command (read-line)))
            (or (eof-object? command)