From 386857748097619b3b75a7bf93677b6aa742d03c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ludovic=20Court=C3=A8s?= Date: Tue, 9 Jul 2019 23:05:01 +0200 Subject: gexp: separates sources from derivation inputs. * guix/gexp.scm (lower-inputs): Return either records or store items. (lower-reference-graphs): Return file/input pairs. ()[sources]: New field. (lower-gexp): Adjust accordingly. (gexp->input-tuple): Remove. (gexp->derivation)[graphs-file-names]: Handle only the 'derivation-input?' and 'string?' cases. Pass #:sources to 'raw-derivation'; ensure #:inputs contains only records. * guix/remote.scm (remote-eval): Adjust to the new interface. * tests/gexp.scm ("lower-gexp"): Adjust to expect records instead of --- guix/remote.scm | 36 +++++++++++------------------------- 1 file changed, 11 insertions(+), 25 deletions(-) (limited to 'guix/remote.scm') diff --git a/guix/remote.scm b/guix/remote.scm index e503c76167..52ced16871 100644 --- a/guix/remote.scm +++ b/guix/remote.scm @@ -95,40 +95,26 @@ remote store." (remote -> (connect-to-remote-daemon session socket-name))) (define inputs - (cons (gexp-input (lowered-gexp-guile lowered)) + (cons (derivation-input (lowered-gexp-guile lowered)) (lowered-gexp-inputs lowered))) - (define to-build - (map (lambda (input) - (if (derivation? (gexp-input-thing input)) - (cons (gexp-input-thing input) - (gexp-input-output input)) - (gexp-input-thing input))) - inputs)) + (define sources + (lowered-gexp-sources lowered)) (if build-locally? - (let ((to-send (map (lambda (input) - (match (gexp-input-thing input) - ((? derivation? drv) - (derivation->output-path - drv (gexp-input-output input))) - ((? store-path? item) - item))) - inputs))) + (let ((to-send (append (map derivation-input-output-paths inputs) + sources))) (mbegin %store-monad - (built-derivations to-build) + (built-derivations inputs) ((store-lift send-files) to-send remote #:recursive? #t) (return (close-connection remote)) (return (%remote-eval lowered session)))) - (let ((to-send (map (lambda (input) - (match (gexp-input-thing input) - ((? derivation? drv) - (derivation-file-name drv)) - ((? store-path? item) - item))) - inputs))) + (let ((to-send (append (map (compose derivation-file-name + derivation-input-derivation) + inputs) + sources))) (mbegin %store-monad ((store-lift send-files) to-send remote #:recursive? #t) - (return (build-derivations remote to-build)) + (return (build-derivations remote inputs)) (return (close-connection remote)) (return (%remote-eval lowered session))))))) -- cgit v1.2.3