aboutsummaryrefslogtreecommitdiff
path: root/src/deployment.lisp
diff options
context:
space:
mode:
authorSean Whitton <spwhitton@spwhitton.name>2021-03-14 12:02:02 -0700
committerSean Whitton <spwhitton@spwhitton.name>2021-03-15 17:18:39 -0700
commit408556dc555e92d49024e11f54979576ef3d31bd (patch)
treee805a83a8d960269256ae4641c5c4808546b0011 /src/deployment.lisp
parent84fc11d93b724519c38d0eeaa31ebd02dbb0738a (diff)
downloadconsfigurator-408556dc555e92d49024e11f54979576ef3d31bd.tar.gz
call :PREPROCESS and :HOSTATTRS subroutines later
Avoids us trying to eval propspecs at DEFHOST time, which can get us into ASDF loading loops. Signed-off-by: Sean Whitton <spwhitton@spwhitton.name>
Diffstat (limited to 'src/deployment.lisp')
-rw-r--r--src/deployment.lisp20
1 files changed, 8 insertions, 12 deletions
diff --git a/src/deployment.lisp b/src/deployment.lisp
index 4df5b59..54dc2c6 100644
--- a/src/deployment.lisp
+++ b/src/deployment.lisp
@@ -35,10 +35,7 @@ connections in CONNECTIONS have been both normalised and preprocessed."
(connect remaining)
(propappapply (eval-propspec (host-propspec *host*))))
(connection-teardown *connection*)))))
- ;; make a partial own-copy of HOST so that connections can add new pieces
- ;; of required prerequisite data; specifically, so that they can request
- ;; the source code of ASDF systems
- (let ((*host* (shallow-copy-host host)))
+ (let ((*host* (preprocess-host host)))
(connect (if (eq :local (caar connections))
connections
(cons '(:local) connections))))))
@@ -136,9 +133,11 @@ Useful to have one host act a controller, applying properties to other hosts.
Also useful to set up VMs, chroots, disk images etc. on localhost."
(:preprocess
(list (preprocess-connections connections)
- (if additional-properties
- (%union-propspec-into-host host additional-properties)
- host)))
+ (preprocess-host
+ (if additional-properties
+ (%union-propspec-into-host (shallow-copy-host host)
+ additional-properties)
+ host))))
(:hostattrs
(declare (ignore connections additional-properties))
(%propagate-hostattrs host))
@@ -152,7 +151,8 @@ PROPERTIES, and not the host's usual properties, unless they also appear in
PROPERTIES, like DEPLOY-THESE."
(:preprocess
(list (preprocess-connections connections)
- (%replace-propspec-into-host host properties)))
+ (preprocess-host
+ (%replace-propspec-into-host (shallow-copy-host host) properties))))
(:hostattrs
(declare (ignore connections properties))
(%propagate-hostattrs host))
@@ -165,10 +165,6 @@ PROPERTIES, like DEPLOY-THESE."
collect (apply #'preprocess-connection-args
(ensure-cons connection))))
-(defun shallow-copy-host (host)
- (make-instance 'host :props (host-propspec host)
- :attrs (copy-list (hostattrs host))))
-
(defun %propagate-hostattrs (host)
(dolist (system (propspec-systems (host-propspec host)))
(pushnew system (slot-value (host-propspec *host*) 'systems)))