aboutsummaryrefslogtreecommitdiff
path: root/src/connection
diff options
context:
space:
mode:
authorSean Whitton <spwhitton@spwhitton.name>2021-05-17 14:18:39 -0700
committerSean Whitton <spwhitton@spwhitton.name>2021-05-17 17:01:18 -0700
commitb2fbc36eedd14e0eb6c012554810a5b75a2e015a (patch)
tree3d9fe6165981c183d146e1edc375f95b7c3dea81 /src/connection
parent3525237f97a3d01ee7d600e6441b520951e874b9 (diff)
downloadconsfigurator-b2fbc36eedd14e0eb6c012554810a5b75a2e015a.tar.gz
separately upload, compile and load each ASDF system
This avoids recompiling unchanged systems on every deploy, which makes for a decent performance boost, especially on systems with less processing power. Drop the idea of relying on distribution packages on the remote side -- we want to use the same version of the source as is running in the root Lisp. Signed-off-by: Sean Whitton <spwhitton@spwhitton.name>
Diffstat (limited to 'src/connection')
-rw-r--r--src/connection/sbcl.lisp43
1 files changed, 23 insertions, 20 deletions
diff --git a/src/connection/sbcl.lisp b/src/connection/sbcl.lisp
index 72ed822..770d408 100644
--- a/src/connection/sbcl.lisp
+++ b/src/connection/sbcl.lisp
@@ -24,6 +24,9 @@
(os:etypecase
(debianlike (apt:installed "sbcl"))))
+(defparameter *sbcl* '("sbcl" "--noinform" "--noprint"
+ "--disable-debugger" "--no-sysinit" "--no-userinit"))
+
(defmethod establish-connection ((type (eql :sbcl)) remaining &key)
(when (lisp-connection-p)
(warn
@@ -32,24 +35,24 @@ Lisp. This can mean that prerequisite data gets extracted from encrypted
stores and stored unencrypted under ~~/.cache, and as such is not
recommended."))
(ignoring-hostattrs (sbcl-available))
- (request-lisp-systems)
- (upload-all-prerequisite-data)
- (inform t "Waiting for remote Lisp to exit, this may take some time ... ")
- (force-output)
- (multiple-value-bind (program forms)
- (continue-deploy*-program remaining)
- (multiple-value-bind (out err exit)
- (run :may-fail :input program
- "sbcl" "--noinform" "--noprint"
- "--disable-debugger"
- "--no-sysinit" "--no-userinit")
- (inform t (if (zerop exit) "done." "failed.") :fresh-line nil)
- (when-let ((lines (lines out)))
- (inform t " Output was:" :fresh-line nil)
- (with-indented-inform (inform t lines)))
- (unless (zerop exit)
- ;; print FORMS not PROGRAM because latter might contain sudo passwords
- (failed-change
- "~&Remote Lisp failed; stderr was:~%~%~A~&~%Program we sent:~%~%~S"
- err forms))))
+ (let ((requirements (asdf-requirements-for-host-and-features
+ (safe-read-from-string
+ (run :input "(prin1 *features*)" *sbcl*)
+ :package :cl-user))))
+ (request-asdf-requirements requirements)
+ (upload-all-prerequisite-data)
+ (inform t "Waiting for remote Lisp to exit, this may take some time ... ")
+ (force-output)
+ (multiple-value-bind (program forms)
+ (continue-deploy*-program remaining requirements)
+ (multiple-value-bind (out err exit) (run :may-fail :input program *sbcl*)
+ (inform t (if (zerop exit) "done." "failed.") :fresh-line nil)
+ (when-let ((lines (lines out)))
+ (inform t " Output was:" :fresh-line nil)
+ (with-indented-inform (inform t lines)))
+ (unless (zerop exit)
+ ;; print FORMS not PROGRAM because latter might contain sudo passwords
+ (failed-change
+ "~&Remote Lisp failed; stderr was:~%~%~A~&~%Program we sent:~%~%~S"
+ err forms)))))
nil)