Commit c0b648ec authored by Robert P. Goldman's avatar Robert P. Goldman

2.019.5: Fixed a minor bug in WEAKLY-DEPENDS-ON handling and added test.

WEAKLY-DEPENDS-ON needed to pass the ERROR-P NIL to FIND-SYSTEM in order
to behave properly.

Added documentation for previously-undocumented weakly-depends-on.
parent dcdd0c56
......@@ -14,7 +14,7 @@
:licence "MIT"
:description "Another System Definition Facility"
:long-description "ASDF builds Common Lisp software organized into defined systems."
:version "2.019.4" ;; to be automatically updated by bin/bump-revision
:version "2.019.5" ;; to be automatically updated by bin/bump-revision
:depends-on ()
:components
((:file "asdf")
......
;;; -*- mode: Common-Lisp; Base: 10 ; Syntax: ANSI-Common-Lisp -*-
;;; This is ASDF 2.019.4: Another System Definition Facility.
;;; This is ASDF 2.019.5: Another System Definition Facility.
;;;
;;; Feedback, bug reports, and patches are all welcome:
;;; please mail to <asdf-devel@common-lisp.net>.
......@@ -107,7 +107,7 @@
;; "2.345.6" would be a development version in the official upstream
;; "2.345.0.7" would be your seventh local modification of official release 2.345
;; "2.345.6.7" would be your seventh local modification of development version 2.345.6
(asdf-version "2.019.4")
(asdf-version "2.019.5")
(existing-asdf (find-class 'component nil))
(existing-version *asdf-version*)
(already-there (equal asdf-version existing-version)))
......@@ -2793,7 +2793,7 @@ Returns the new tree (which probably shares structure with the old one)"
rest)))
(ret (find-component parent name)))
(when weakly-depends-on
(appendf depends-on (remove-if (complement #'find-system) weakly-depends-on)))
(appendf depends-on (remove-if (complement #'(lambda (x) (find-system x nil))) weakly-depends-on)))
(when *serial-depends-on*
(push *serial-depends-on* depends-on))
(if ret ; preserve identity
......
......@@ -895,7 +895,8 @@ For more details on what these methods do, @pxref{Operations} in
@example
system-definition := ( defsystem system-designator @var{system-option}* )
system-option := :defsystem-depends-on system-list
system-option := :defsystem-depends-on system-list
| :weakly-depends-on @var{system-list}
| :class class-name (see discussion below)
| module-option
| option
......@@ -980,6 +981,7 @@ extension loaded by @code{:defsystem-depends-on}, causing a name
conflict in the current package.
@subsection Defsystem depends on
@cindex :defsystem-depends-on
The @code{:defsystem-depends-on} option to @code{defsystem} allows the
programmer to specify another ASDF-defined system or set of systems that
......@@ -987,6 +989,22 @@ must be loaded @emph{before} the system definition is processed.
Typically this is used to load an ASDF extension that is used in the
system definition.
@subsection Weakly depends on
@cindex :weakly-depends-on
The @code{:weakly-depends-on} option to @code{defsystem} allows the
programmer to specify another ASDF-defined system or set of systems that
ASDF should @emph{try} to load, but need not load in order to be
successful. Typically this is used if there are a number of systems
that, if present, could provide additional functionality, but which are
not necessary for basic function.
Currently, although it is specified to be an option only to
@code{defsystem}, this option is accepted at any component, but it probably
only makes sense at the @code{defsystem} level. Programmers are cautioned not
to use this component option except at the @code{defsystem} level, as
this anomalous behavior may be removed without warning.
@subsection Pathname specifiers
@cindex pathname specifiers
......
(defsystem test-weakly-depends-on
:weakly-depends-on (does-not-exist)
:if-component-dep-fails :ignore
:components ((:file "file1")))
;;; -*- Lisp -*-
(load "script-support.lisp")
(load-asdf)
(quit-on-error
(setf asdf:*central-registry* '(*default-pathname-defaults*))
(asdf:load-system 'test-weakly-depends-on)
;; test that it compiled
(let* ((file1 (asdf:compile-file-pathname* "file1"))
(file1-date (file-write-date file1)))
(format t "~&test1 1: ~S ~S~%" file1 file1-date)
(assert file1-date)
;; and loaded
(assert (symbol-value (find-symbol (symbol-name :*file1*) :test-package)))))
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