[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
14/16: build-derivations: scan for hashes, not full paths.
From: |
guix-commits |
Subject: |
14/16: build-derivations: scan for hashes, not full paths. |
Date: |
Sat, 20 Apr 2019 17:25:29 -0400 (EDT) |
reepca pushed a commit to branch guile-daemon
in repository guix.
commit 55c3dbdda656846ee9b2c2f94bbd371964f2d4ed
Author: Caleb Ristvedt <address@hidden>
Date: Fri Apr 19 23:14:58 2019 -0500
build-derivations: scan for hashes, not full paths.
* guix/store/build-derivations.scm (scanning-wrapper-port): Now assumes the
strings being searched for are store paths and searches for the
corresponding hash parts.
---
guix/store/build-derivations.scm | 19 ++++++++++++++-----
1 file changed, 14 insertions(+), 5 deletions(-)
diff --git a/guix/store/build-derivations.scm b/guix/store/build-derivations.scm
index beade05..9b3dca5 100644
--- a/guix/store/build-derivations.scm
+++ b/guix/store/build-derivations.scm
@@ -587,13 +587,20 @@ already in TRIE."
((current)
#f))))
-(define (scanning-wrapper-port output-port strings)
+(define (scanning-wrapper-port output-port paths)
"Creates a wrapper port which passes through bytes to OUTPUT-PORT and
returns it as well as a procedure which, when called, returns a list of all
-references out of the possibilities enumerated in STRINGS that were
-detected. STRINGS must not be empty."
+references out of the possibilities enumerated in PATHS that were
+detected. PATHS must not be empty."
;; Not sure if I should be using custom ports or soft ports...
- (let* ((lookback-size (apply max (map (compose bytevector-length
string->utf8)
+ (let* ((strings (map store-path-hash-part paths))
+ (string->path (fold (lambda (current prev)
+ (vhash-cons (store-path-hash-part current)
+ current
+ prev))
+ vlist-null
+ paths))
+ (lookback-size (apply max (map (compose bytevector-length
string->utf8)
strings)))
(smallest-length (apply min (map (compose bytevector-length
string->utf8)
@@ -664,7 +671,9 @@ detected. STRINGS must not be empty."
(if match-result
(begin
(set! references
- (let ((str-result (utf8->string match-result)))
+ (let ((str-result
+ (cdr (vhash-assoc (utf8->string match-result)
+ string->path))))
(format #t "Found reference to: ~a~%" str-result)
(cons str-result
references)))
- branch guile-daemon created (now b1ff580), guix-commits, 2019/04/20
- 03/16: guix: store: Register derivation outputs., guix-commits, 2019/04/20
- 08/16: linux-container: don't include /dev/ptmx or /dev/pts from host., guix-commits, 2019/04/20
- 11/16: syscalls: add missing pieces for derivation build environment, guix-commits, 2019/04/20
- 10/16: gnu: linux-container: Make it more suitable for derivation-building., guix-commits, 2019/04/20
- 04/16: guix/store/build-derivations.scm: new module., guix-commits, 2019/04/20
- 05/16: linux-container: new use-output argument., guix-commits, 2019/04/20
- 12/16: config: add variables for more directories, %impersonate-linux-2.6?, guix-commits, 2019/04/20
- 14/16: build-derivations: scan for hashes, not full paths.,
guix-commits <=
- 13/16: derivations: migrate the rest of the non-rpc-related bindings., guix-commits, 2019/04/20
- 01/16: gnu: address@hidden: Honor NIX_STORE., guix-commits, 2019/04/20
- 06/16: build-derivations: use call-with-container, guix-commits, 2019/04/20
- 09/16: build-derivations: Leaked environment variables more robust., guix-commits, 2019/04/20
- 15/16: build-derivations: Adapt docstrings to fit style., guix-commits, 2019/04/20
- 07/16: build-derivations: initial build-group support, guix-commits, 2019/04/20
- 02/16: guix: split (guix store) and (guix derivations)., guix-commits, 2019/04/20
- 16/16: build-derivations: move environment code to (guix store environment), guix-commits, 2019/04/20