diff options
author | Sean Whitton <spwhitton@spwhitton.name> | 2021-03-01 14:46:36 -0700 |
---|---|---|
committer | Sean Whitton <spwhitton@spwhitton.name> | 2021-03-01 14:47:27 -0700 |
commit | 5b83e1693cebb8c037da5cbbffac24b90c46caf4 (patch) | |
tree | 5652f221995031123f5a4cd7bbaabaaec44544de | |
parent | be2b15288d2d979345c3893c1fadd7650684fea5 (diff) | |
download | consfigurator-5b83e1693cebb8c037da5cbbffac24b90c46caf4.tar.gz |
bind a variable to block trying to load ASDF systems in remote Lisps
Signed-off-by: Sean Whitton <spwhitton@spwhitton.name>
-rw-r--r-- | src/data.lisp | 17 | ||||
-rw-r--r-- | src/propspec.lisp | 15 |
2 files changed, 17 insertions, 15 deletions
diff --git a/src/data.lisp b/src/data.lisp index 0b68cd9..550004e 100644 --- a/src/data.lisp +++ b/src/data.lisp @@ -370,23 +370,17 @@ achieved by sending the return value of this function into a REPL's stdin." (missing-data-source (lambda (c) (declare (ignore c)) - (invoke-restart 'skip-data-source))) - ;; we can skip missing components when our particular restart - ;; is available because we've already uploaded everything - ;; that was declared to be required - (asdf/find-component:missing-component - (lambda (c) - (declare (ignore c)) - (let ((restart (find-restart 'continue-without-system))) - (when restart (invoke-restart restart)))))) - ,@forms))) + (invoke-restart 'skip-data-source)))) + (let ((*remote-lisp* t)) + ,@forms)))) (let ((intern-forms (loop for name in '("MISSING-DATA-SOURCE" "SKIP-DATA-SOURCE" - "CONTINUE-WITHOUT-SYSTEM") + "*REMOTE-LISP*") collect `(export (intern ,name (find-package "CONSFIGURATOR")) (find-package "CONSFIGURATOR")))) + (proclamations `((proclaim '(special *remote-lisp*)))) (load-forms (loop for system in (slot-value (slot-value *host* 'propspec) 'systems) @@ -405,6 +399,7 @@ achieved by sending the return value of this function into a REPL's stdin." #'prin1-to-string `((make-package "CONSFIGURATOR") ,@intern-forms + ,@proclamations (define-condition missing-data-source (error) ()) (require "asdf") (let ((*standard-output* *error-output*)) diff --git a/src/propspec.lisp b/src/propspec.lisp index 628c1e0..4ebe92c 100644 --- a/src/propspec.lisp +++ b/src/propspec.lisp @@ -169,15 +169,22 @@ an atomic property application." (t propapp)))) +(defvar *remote-lisp* nil + "Whether this Lisp is one started up within a call to DEPLOY*.") + (defmethod eval-propspec ((propspec propspec)) "Apply properties as specified by PROPSPEC." (when (and (subtypep (class-of *connection*) 'posix-connection) (eq :lisp (propspec->type propspec))) (error "Cannot apply :LISP properties using a POSIX connection")) - (loop for system in (slot-value propspec 'systems) - unless (asdf:component-loaded-p system) - do (restart-case (asdf:load-system system) - (continue-without-system () nil))) + ;; Don't try to load systems if we are a remote Lisp, as we don't upload the + ;; .asd files, and we don't want to load out of /usr/share/common-lisp as we + ;; might get a different version of the library at worst, or a lot of + ;; warnings at best + (unless *remote-lisp* + (loop for system in (slot-value propspec 'systems) + unless (asdf:component-loaded-p system) + do (asdf:load-system system))) (loop for form in (slot-value propspec 'applications) for propapp = (compile-propapp form) do (propappapply propapp))) |