Verified Commit 0d4031c6 authored by Eric Timmons's avatar Eric Timmons
Browse files

Handle :REQUIRE system dependencies

For the moment, we largely ignore them, as :REQUIRE should be used only with
modules that are distributed with the implementation.

However, :REQUIRE *can* be used with regular ASDF systems (sigh). So in the
future, we may need to keep a list of legitimite implementation distributed
modules and filter against that.
parent 8476155e
......@@ -19,4 +19,5 @@
(:file "suite")
(:file "quicklisp-bundle")
(:file "global-context")
(:file "grovel-with-require")
(:file "tests")))
......@@ -184,7 +184,8 @@ filesystem must be included. NAME is the pathname to the asd file."))
(defgeneric convert-asd-system-spec-to-req (dep &key why)
(:documentation
"Given an ASD dependency specification, return the requirement object it
represents."))
represents. Returns NIL if the dep is a :REQUIRE dep, as use of these should be
limited to modules distributed with an implementation."))
(defmethod convert-asd-system-spec-to-req ((dep string) &key why)
"A string simply maps to a system requirement."
......@@ -201,7 +202,8 @@ represents."))
:version-spec `((>= ,(third dep)))
:why why))
(:feature
(convert-asd-system-spec-to-req (third dep) :why why))))
(convert-asd-system-spec-to-req (third dep) :why why))
(:require nil)))
(defgeneric requirement-to-plist (req))
......
......@@ -499,8 +499,8 @@
(clpi-backing-object system-release))))
(defmethod system-release-requirements ((system-release clpi-system-release))
(mapcar #'convert-asd-system-spec-to-req
(clpi:system-release-dependencies (clpi-backing-object system-release))))
(remove nil (mapcar #'convert-asd-system-spec-to-req
(clpi:system-release-dependencies (clpi-backing-object system-release)))))
(defmethod system-release-satisfies-version-spec-p ((system-release clpi-system-release)
version-spec)
......
......@@ -279,8 +279,8 @@ include it."
info
(setf (system-release-system-version system-release) version)
(setf (system-release-requirements system-release)
(mapcar #'convert-asd-system-spec-to-req
(append depends-on defsystem-depends-on loaded-systems)))))
(remove nil (mapcar #'convert-asd-system-spec-to-req
(append depends-on defsystem-depends-on loaded-systems))))))
(defun grovel-system-release! (system-release)
"Invoke the groveler to get info on this system."
......
......@@ -425,8 +425,8 @@ include it."
info
(setf (system-release-system-version system-release) version)
(setf (system-release-requirements system-release)
(mapcar #'convert-asd-system-spec-to-req
(append depends-on defsystem-depends-on loaded-systems)))))
(remove nil (mapcar #'convert-asd-system-spec-to-req
(append depends-on defsystem-depends-on loaded-systems))))))
(defun grovel-system-release! (system-release)
(active-groveler-ensure-asd-loaded (system-release-absolute-asd-pathname system-release))
......
(in-package #:clpm-test)
(para:define-test grovel-with-require
(uiop:with-current-directory ((asdf:system-relative-pathname :clpm "test/grovel-with-require/"))
(with-clpm-env ()
(clpm '("bundle" "install" "-y")
:output :interactive
:error-output :interactive)
(clpm '("bundle" "exec"
"--"
"sbcl" "--non-interactive" "--no-userinit" "--no-sysinit"
"--eval" "(require :asdf)"
"--eval" "(asdf:load-system :grovel-with-require)"
"--quit")
:output :interactive
:error-output :interactive))))
;;; -*- mode: common-lisp -*-
(:api-version "0.3")
(:source "quicklisp"
:type :quicklisp
:url "http://localhost:8091/dist/quicklisp-test.txt")
(:asd "grovel-with-require.asd")
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;; This is autogenerated by CLPM. Do not edit by hand.
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
(:api-version "0.4")
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;; BEGIN SOURCES
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
:sources
(:implicit-file :type :file-system :system-files ("grovel-with-require.asd"))
("quicklisp" :url "http://localhost:8091/dist/quicklisp-test.txt" :type
:quicklisp)
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;; BEGIN REQUIREMENTS
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
:requirements
(:asd-file :name "grovel-with-require.asd")
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;; BEGIN RELEASES
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
:releases
("alexandria" :version "2021-02-21" :source "quicklisp" :systems ("alexandria"))
("grovel-with-require.asd" :version :newest :source :implicit-file :systems
("grovel-with-require"))
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;; BEGIN REVERSE-DEPENDENCIES
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
:reverse-dependencies
("alexandria"
((:system :name "grovel-with-require") (:system :name "alexandria")))
("grovel-with-require.asd" (t (:asd-file :name "grovel-with-require.asd")))
(uiop:define-package #:grovel-with-require
(:use #:cl
#:alexandria))
(in-package #:grovel-with-require)
(assert (equal (iota 3) '(0 1 2)))
(asdf:defsystem "grovel-with-require"
:depends-on (#:alexandria
(:feature :does-not-exist (:require "extensible-sequences")))
:components ((:file "file-1")))
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