diff options
author | Sean Whitton <spwhitton@spwhitton.name> | 2021-11-30 20:22:29 -0700 |
---|---|---|
committer | Sean Whitton <spwhitton@spwhitton.name> | 2021-12-03 11:29:43 -0700 |
commit | f506d491b7069789a5aa94381cbf50970b35b2f0 (patch) | |
tree | b93737bd0c122f8c9774608b056598f7ad92669f | |
parent | 62d861cf5fbd4806fd6399e841fd24545fa085d3 (diff) | |
download | consfigurator-f506d491b7069789a5aa94381cbf50970b35b2f0.tar.gz |
signal a warning, not an error, when *CONSFIG* is not set
*CONSFIG* is meant to be an optional feature, and this should make it easier
to write code which doesn't use it. For example, code running in an
IMAGE-DUMPED image might use (deploy-these :local ...) to build a propspec,
but *PACKAGE* is likely to be COMMON-LISP-USER, not the user's consfig.
Signed-off-by: Sean Whitton <spwhitton@spwhitton.name>
-rw-r--r-- | src/package.lisp | 1 | ||||
-rw-r--r-- | src/propspec.lisp | 17 |
2 files changed, 15 insertions, 3 deletions
diff --git a/src/package.lisp b/src/package.lisp index 051bfab..63a701d 100644 --- a/src/package.lisp +++ b/src/package.lisp @@ -240,6 +240,7 @@ ;; propspec.lisp #:in-consfig + #:no-consfig #:propspec-systems #:propspec-props #:make-propspec diff --git a/src/propspec.lisp b/src/propspec.lisp index 1fa6744..2ef61d2 100644 --- a/src/propspec.lisp +++ b/src/propspec.lisp @@ -130,12 +130,23 @@ effect deployments: it sends over the ASDF systems specified by SYSTEMS." Consfigurator properties and property combinators code in this symbol's package applies to hosts.")))) +(define-condition no-consfig (simple-warning) ()) + (defclass propspec () ((systems :initarg :systems - :initform (or (symbol-value (find-symbol "*CONSFIG*")) - (error - "Looks like *CONSFIG* is not set; please call IN-CONSFIG")) + :initform + (or (handler-case (symbol-value (find-symbol "*CONSFIG*")) + (unbound-variable ())) + (warn 'no-consfig :format-arguments `(,*package*) :format-control +"Initialising propspec without any list of ASDF systems supplied, +and *PACKAGE* is not a package for which IN-CONSFIG has been called. +Consfigurator may not be able to start up remote Lisp images to effect +deployments involving this propspec; see the docstring for IN-CONSFIG. + +Either call IN-CONSFIG for ~S, explicitly pass +:SYSTEMS NIL to MAKE-PROPSPEC, or muffle this warning if code using this +propspec will not need to start up any remote Lisp images.")) :reader propspec-systems :documentation "List of names of ASDF systems, the loading of all of which is sufficient |