aboutsummaryrefslogtreecommitdiff
path: root/src/connection
diff options
context:
space:
mode:
Diffstat (limited to 'src/connection')
-rw-r--r--src/connection/sbcl.lisp38
1 files changed, 20 insertions, 18 deletions
diff --git a/src/connection/sbcl.lisp b/src/connection/sbcl.lisp
index 206b5ab..db5ac7e 100644
--- a/src/connection/sbcl.lisp
+++ b/src/connection/sbcl.lisp
@@ -18,33 +18,35 @@
(in-package :consfigurator.connection.sbcl)
(named-readtables:in-readtable :consfigurator)
-(defproplist sbcl-available :posix ()
- (os:etypecase
- (debianlike (apt:installed "sbcl" "build-essential"))))
-
(defparameter *sbcl* '("sbcl" "--noinform" "--noprint"
"--disable-debugger" "--no-sysinit" "--no-userinit"))
-(defmethod establish-connection ((type (eql :sbcl)) remaining &key)
+(defmethod establish-connection
+ ((type (eql :sbcl)) remaining
+ &key (package-manager nil package-manager-supplied-p))
+ "Start up a remote Lisp image using SBCL.
+
+Specifying PACKAGE-MANAGER avoids the need to see what package managers are
+available on PATH, which can provide a performance improvement."
(when (lisp-connection-p)
(warn
"Looks like you might be starting a fresh Lisp image directly from the root
Lisp. This can mean that prerequisite data gets extracted from encrypted
stores and stored unencrypted under ~~/.cache, and as such is not
recommended."))
- (unless (zerop (mrun :for-exit "command" "-v" "sbcl"))
- ;; If we're not the final hop then we don't know the OS of the host to
- ;; which we're currently connected, so we can't apply SBCL-AVAILABLE.
- ;;
- ;; TODO In the case of INSTALLER:CLEANLY-INSTALLED-ONCE this code will
- ;; have us trying to use apt to install sbcl on a Fedora host, say, upon
- ;; the first connection, before Debian has been installed. Perhaps we
- ;; should just have some code which tries to install sbcl based on the
- ;; package manager(s) it can find on PATH. Could reuse that code for
- ;; CHROOT::%DEBOOTSTRAP-MANUALLY-INSTALLED.
- (if remaining
- (failed-change "sbcl not on PATH and don't know how to install.")
- (sbcl-available)))
+ ;; Allow the user to request no attempt to install the dependencies at all,
+ ;; perhaps because they know they're already manually installed.
+ (unless (and package-manager-supplied-p (not package-manager))
+ (handler-case (package:installed
+ package-manager '(:apt "sbcl")
+ package:*consfigurator-system-dependencies*)
+ ;; If we couldn't find any package manager on PATH, just proceed in the
+ ;; hope that everything we need is already installed; we'll find out
+ ;; whether it's actually a problem pretty quickly, when the remote SBCL
+ ;; tries to compile and load the ASDF systems.
+ (package:package-manager-not-found (c)
+ (apply #'warn (simple-condition-format-control c)
+ (simple-condition-format-arguments c)))))
(let ((requirements (asdf-requirements-for-host-and-features
(safe-read-from-string
(run :input "(prin1 *features*)" *sbcl*)