diff options
author | Sean Whitton <spwhitton@spwhitton.name> | 2021-02-24 10:06:30 -0700 |
---|---|---|
committer | Sean Whitton <spwhitton@spwhitton.name> | 2021-02-24 10:06:30 -0700 |
commit | abcde492596564dbc69ee0fc7f5cb0380937c9b2 (patch) | |
tree | 926877c8339859000d9c1f0fce4d699c5a762776 | |
parent | ac17e28f7d927cad8884b33e66c47abaab8f85e3 (diff) | |
download | consfigurator-abcde492596564dbc69ee0fc7f5cb0380937c9b2.tar.gz |
remote Lisp images can ignore failures to load consfigs as systems
We ensure the packages comprising those systems will be loaded.
Signed-off-by: Sean Whitton <spwhitton@spwhitton.name>
-rw-r--r-- | src/data.lisp | 23 | ||||
-rw-r--r-- | src/package.lisp | 1 | ||||
-rw-r--r-- | src/propspec.lisp | 3 |
3 files changed, 21 insertions, 6 deletions
diff --git a/src/data.lisp b/src/data.lisp index 98b8386..5ec2c2a 100644 --- a/src/data.lisp +++ b/src/data.lisp @@ -354,13 +354,26 @@ host which will run the Lisp image must already be established. Called by connections which start up remote Lisp images." (flet ((wrap (forms) - `(handler-bind ((missing-data-source - (lambda (c) - (declare (ignore c)) - (invoke-restart 'skip-data-source)))) + `(handler-bind + (;; we can skip missing data sources because these are not + ;; expected to be available outside of the root Lisp + (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))) (let ((intern-forms - (loop for name in '("MISSING-DATA-SOURCE" "SKIP-DATA-SOURCE") + (loop for name in '("MISSING-DATA-SOURCE" + "SKIP-DATA-SOURCE" + "CONTINUE-WITHOUT-SYSTEM") collect `(export (intern ,name (find-package "CONSFIGURATOR")) (find-package "CONSFIGURATOR")))) diff --git a/src/package.lisp b/src/package.lisp index db93cee..d40f464 100644 --- a/src/package.lisp +++ b/src/package.lisp @@ -88,6 +88,7 @@ ;; propspec.lisp #:in-consfig + #:continue-without-system ;; host.lisp #:defhost diff --git a/src/propspec.lisp b/src/propspec.lisp index b46b6b5..3dc4ba5 100644 --- a/src/propspec.lisp +++ b/src/propspec.lisp @@ -143,7 +143,8 @@ an atomic property application." "Apply properties as specified by PROPSPEC." (loop for system in (slot-value propspec 'systems) unless (asdf:component-loaded-p system) - do (asdf:load-system system)) + do (restart-case (asdf:load-system system) + (continue-without-system () nil))) (loop for form in (slot-value propspec 'applications) for propapp = (compile-propapp form) do (propappapply propapp))) |