Commit 8ce326b5 authored by Eric Timmons's avatar Eric Timmons
Browse files

Add (:grovel :lisp :implementation) and (:grovel :lisp :path) config paths

Control what Lisp implementation is used by the groveler.
parent 57a07561
......@@ -9,6 +9,8 @@
+ Pull CLPI documentation and implementation into separate project.
+ Pull QL integration for CLPI into separate project.
+ Build binaries with SBCL 2.0.4.
+ Add =(:grovel :lisp :implementation)= and =(:grovel :lisp :path)= for
controlling what Lisp implementation is used by the groveler.
* v0.2.1 - 2020-04-05
......
......@@ -6,11 +6,14 @@
CLPM is distributed in both source and binary form. For either version, first
install the dependencies:
+ tar :: Required.
+ A Lisp implementation :: SBCL is currently required if you are installing
from source. SBCL or CCL are the most tested implementations for groveling
dependencies from .asd files (necessary if you are installing a development
version of a project).
+ git :: If you want to use development versions of your dependencies.
+ sbcl or ccl :: Either is required if systems need to be groveled for
dependencies (likely needed if you use development versions of any
dependency). SBCL is required if you are installing from source.
+ tar :: Required.
* Prebuilt binaries
To install CLPM in binary form, download the appropriate file from
......
......@@ -40,11 +40,12 @@ files.
CLPM is distributed in both source and binary form. For either version, first
install the dependencies:
* tar :: Required.
* A Lisp implementation :: SBCL is currently required if you are installing
from source. SBCL or CCL are the most tested implementations for groveling
dependencies from .asd files (necessary if you are installing a development
version of a project).
* git :: If you want to use development versions of your dependencies.
* sbcl or ccl :: Either is required if systems need to be groveled for
dependencies (likely needed if you use development versions of any
dependency). SBCL is required if you are installing from source.
* tar :: Required.
** Prebuilt binaries
To install CLPM in binary form, download the appropriate file from
......
......@@ -154,6 +154,15 @@ The current configuration can be printed by running =clpm config info=.
This table contains configuration for groveling for dependencies and other
information from .asd files.
** =(:grovel :lisp)=
This table contains the configuration on which Lisp implementation to use
when groveling.
+ =:implementation= :: A keyword naming an implementation recognized by the
lisp-invocation library.
+ =:path= :: The command to execute when starting the Lisp
implementation. Needed only if using a non standard path.
** =(:grovel :sandbox)=
This table contains configuration of the sandbox used to isolate processes
that grovel for dependencies from .asd files. (Experimental)
......
......@@ -131,6 +131,18 @@
((:grovel)
:type hash-table)
((:grovel :lisp)
:type hash-table)
((:grovel :lisp :implementation)
:type keyword
:default :auto
:documentation
"The implementation to use when groveling. Must be recognized by
lisp-invocation library.")
((:grovel :lisp :path)
:type string
:documentation
"The command to use when executing the Lisp process for groveling.")
((:grovel :sandbox)
:type hash-table)
((:grovel :sandbox :type)
......@@ -277,6 +289,8 @@ path. Everything is a `:keyword` except for wildcards."
t)
(t
(error "Unable to parse ~S as a boolean." orig-value)))))
((eql type 'keyword)
(make-keyword (uiop:standard-case-symbol-name value)))
((and (listp type)
(eql (first type) 'member)
(every (lambda (x) (or (keywordp x) (eql x nil) (eql x t))) (rest type)))
......
......@@ -8,9 +8,11 @@
(:use #:cl
#:anaphora
#:asdf-system-groveler
#:clpm/config
#:clpm/log
#:clpm/sandbox
#:exit-hooks)
#:exit-hooks
#:lisp-invocation)
(:shadow #:make-groveler)
(:reexport #:asdf-system-groveler)
(:export #:*active-groveler*
......@@ -25,12 +27,32 @@
(defvar *active-groveler* nil)
(defun implementation-installed-p (implementation)
(ignore-errors
(zerop (nth-value 2 (uiop:run-program
(lisp-invocation-arglist
:implementation-type implementation
:lisp-path (config-value :grovel :lisp :path)
:eval "(print (lisp-implementation-type))"
:eval (quit-form :code 0 :implementation-type implementation))
:input nil
:output nil
:error-output nil)))))
(defun get-groveler-implementation ()
(let ((config-value (config-value :grovel :lisp :implementation)))
(if (eql config-value :auto)
(or (find-if #'implementation-installed-p '(:sbcl :ccl :ecl :abcl :clasp :cmu :clisp :acl :lw))
(error "Unable to find an installed lisp implementation."))
config-value)))
(defun make-groveler ()
(let ((dir (asdf-system-groveler:mkdtemp (merge-pathnames "clpm"
(uiop:temporary-directory)))))
(flet ((rewrite (args)
(sandbox-augment-command args :read-write-pathnames (list dir))))
(aprog1 (asdf-system-groveler:make-groveler :sbcl
(aprog1 (asdf-system-groveler:make-groveler (get-groveler-implementation)
:lisp-path (config-value :grovel :lisp :path)
:asdf-fasl-cache-dir dir
:keep-asdf-fasl-cache-dir nil
:rewrite-arguments-callback #'rewrite)
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment