From 128663e4c8e8e3c2a56686c6018641ce7bcf92da Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ludovic=20Court=C3=A8s?= Date: Fri, 22 Mar 2013 22:58:19 +0100 Subject: [PATCH] store: Really disable file name canonicalization for derivation inputs. * guix/store.scm (write-contents)[call-with-binary-input-file]: Set %FILE-PORT-NAME-CANONICALIZATION to #f. * gnu/packages.scm (search-patch, search-bootstrap-binary): Leave %FILE-PORT-NAME-CANONICALIZATION unchanged. This reverts 9776ebb. --- gnu/packages.scm | 8 +++----- guix/store.scm | 14 ++++++++------ 2 files changed, 11 insertions(+), 11 deletions(-) diff --git a/gnu/packages.scm b/gnu/packages.scm index 821246bc38..b639541788 100644 --- a/gnu/packages.scm +++ b/gnu/packages.scm @@ -61,14 +61,12 @@ (define %bootstrap-binaries-path (define (search-patch file-name) "Search the patch FILE-NAME." - (with-fluids ((%file-port-name-canonicalization #f)) - (search-path (%patch-path) file-name))) + (search-path (%patch-path) file-name)) (define (search-bootstrap-binary file-name system) "Search the bootstrap binary FILE-NAME for SYSTEM." - (with-fluids ((%file-port-name-canonicalization #f)) - (search-path (%bootstrap-binaries-path) - (string-append system "/" file-name)))) + (search-path (%bootstrap-binaries-path) + (string-append system "/" file-name))) (define %distro-module-directory ;; Absolute path of the (gnu packages ...) module root. diff --git a/guix/store.scm b/guix/store.scm index 688ddbe714..4d078c5899 100644 --- a/guix/store.scm +++ b/guix/store.scm @@ -238,12 +238,14 @@ (define (write-contents file p size) "Write SIZE bytes from FILE to output port P." (define (call-with-binary-input-file file proc) ;; Open FILE as a binary file. This avoids scan-for-encoding, and thus - ;; avoids any initial buffering. - (let ((port (open-file file "rb"))) - (catch #t (cut proc port) - (lambda args - (close-port port) - (apply throw args))))) + ;; avoids any initial buffering. Disable file name canonicalization to + ;; avoid stat'ing like crazy. + (with-fluids ((%file-port-name-canonicalization #f)) + (let ((port (open-file file "rb"))) + (catch #t (cut proc port) + (lambda args + (close-port port) + (apply throw args)))))) (define (dump in size) (define buf-size 65536)